PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.12
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.12
1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 All 36 releases
← All changes | assets/js/apps/users.min.js +78 -76 1.1.9 → 1.1.12 View file →
@@ -1,5 +1,5 @@
1 -var openStationApp_users=function(Ce){"use strict";const Ht="desktop-mode";function Qe(){return window.wp?.i18n}function l(o,e=Ht){return Qe()?.__(o,e)??o}function x(o,...e){const t=Qe()?.sprintf;if(t)return t(o,...e);let s=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(i,n)=>{const a=n?Number.parseInt(n,10)-1:s++;return String(e[a]??"")})}function h(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function Ot(o){return!!o&&o.__wpdHtml===!0}const Ut="$$wpd$$",$=/\$\$wpd\$\$(\d+)\$\$/g,jt="$$wpd-node$$",Bt=/^\$\$wpd-node\$\$(\d+)\$\$$/,Vt=new Set(["style","script","textarea","title"]);function Kt(o){let e="",t=!1,s=null,i=!1,n=null,a="",r=!1;for(let c=0;c<o.length;c++){const d=o[c];e+=d;for(let p=0;p<d.length;p++){const u=d[p];if(i){d.startsWith("-->",p)&&(i=!1,p+=2);continue}if(n!==null){u==="<"&&d[p+1]==="/"&&d.slice(p+2,p+2+n.length).toLowerCase()===n&&(p+=1+n.length,n=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,Vt.has(a)&&(n=a),a=""):r&&(/[a-zA-Z0-9-]/.test(u)?a+=u.toLowerCase():r=!1);continue}if(d.startsWith("<!--",p)){i=!0,p+=3;continue}const m=d[p+1]??"";u==="<"&&/[a-zA-Z/!]/.test(m)&&(t=!0,a="",r=/[a-zA-Z]/.test(m))}c<o.length-1&&(e+=t||i||n!==null?`${Ut}${c}$$`:`<!--${jt}${c}$$-->`)}return e}const et=new WeakMap;function tt(o){const e=et.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=Kt(o);const s=[],i=(r,c)=>{if(r.nodeType===Node.ELEMENT_NODE){const u=r;for(const m of Array.from(u.attributes)){const f=m.name,g=m.value,v=f[0];if($.test(g))if($.lastIndex=0,v==="@"){const y=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"event",name:f.slice(1),valueIndex:y?Number(y[1]):0}),u.removeAttribute(f)}else if(v==="."){const y=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"prop",name:f.slice(1),valueIndex:y?Number(y[1]):0}),u.removeAttribute(f)}else if(v==="?"){const y=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"bool",name:f.slice(1),valueIndex:y?Number(y[1]):0}),u.removeAttribute(f)}else{const y=[],L=[];let A=0,T;for($.lastIndex=0;(T=$.exec(g))!==null;)y.push(g.slice(A,T.index)),L.push(Number(T[1])),A=T.index+T[0].length;y.push(g.slice(A)),s.push({path:c,kind:"attr",name:f,template:y,valueIndices:L}),u.setAttribute(f,"")}}}const d=Array.from(r.childNodes);let p=0;for(let u=0;u<d.length;u++){const m=d[u],f=u+p;if(m.nodeType===Node.COMMENT_NODE){const g=Bt.exec(m.data);if(g){const v=document.createTextNode("");m.parentNode.replaceChild(v,m),s.push({path:[...c,f],kind:"node",valueIndex:Number(g[1])})}continue}if(m.nodeType===Node.TEXT_NODE){const g=m.textContent||"";if(!$.test(g)){$.lastIndex=0;continue}$.lastIndex=0;const v=m.parentNode;let y=0,L;const A=[],T=[];for($.lastIndex=0;(L=$.exec(g))!==null;){L.index>y&&A.push(document.createTextNode(g.slice(y,L.index)));const C=document.createTextNode("");A.push(C),T.push({path:[...c,f+A.length-1],kind:"node",valueIndex:Number(L[1])}),y=L.index+L[0].length}y<g.length&&A.push(document.createTextNode(g.slice(y)));for(const C of A)v.insertBefore(C,m);v.removeChild(m),p+=A.length-1,s.push(...T)}else i(m,[...c,f])}};i(t.content,[]);const a={template:t,buildParts:r=>{const c=[];for(const d of s){let p=r;for(const u of d.path)p=p.childNodes[u];d.kind==="node"?c.push({kind:"node",valueIndex:d.valueIndex,child:{anchor:p,state:null}}):d.kind==="attr"?c.push({kind:"attr",element:p,name:d.name,template:d.template,valueIndices:d.valueIndices}):d.kind==="event"?c.push({kind:"event",valueIndex:d.valueIndex,element:p,name:d.name}):d.kind==="prop"?c.push({kind:"prop",valueIndex:d.valueIndex,element:p,name:d.name}):d.kind==="bool"&&c.push({kind:"bool",valueIndex:d.valueIndex,element:p,name:d.name})}return c}};return et.set(o,a),a}const ot=new WeakMap;function Yt(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function G(o,e){const t=ot.get(e);if(t&&t.strings===o.strings&&Yt(t,e)){be(t.parts,o.values);return}const s=tt(o.strings),i=s.template.content.cloneNode(!0),n=s.buildParts(i),a=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),be(n,o.values),ot.set(e,{strings:o.strings,parts:n,nodes:a})}function be(o,e){for(const t of o)if(t.kind==="node")ve(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let s=t.template[0];for(let i=0;i<t.valueIndices.length;i++)s+=st(e[t.valueIndices[i]]),s+=t.template[i+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 ve(o,e){if(e==null||e===!1){o.state&&(M(o.state),o.state=null);return}if(Array.isArray(e)){Jt(o,e);return}if(Ot(e)){Zt(o,e);return}if(e instanceof Node){Xt(o,e);return}Gt(o,st(e))}function Xt(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&M(t),Z(o,[e]),o.state={shape:"node",node:e})}function Gt(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&M(t);const s=document.createTextNode(e);Z(o,[s]),o.state={shape:"text",node:s,text:e}}function Zt(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){be(t.parts,e.values);return}t&&M(t);const s=tt(e.strings),i=s.template.content.cloneNode(!0),n=s.buildParts(i),a=Array.from(i.childNodes);Z(o,[i]),be(n,e.values),o.state={shape:"template",strings:e.strings,parts:n,nodes:a}}function Jt(o,e){const t=o.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let n=0;n<i;n++)ve(t.entries[n],e[n]);if(e.length<t.entries.length){for(let n=e.length;n<t.entries.length;n++){const a=t.entries[n];a.state&&M(a.state),a.anchor.remove()}t.entries.length=e.length}else for(let n=t.entries.length;n<e.length;n++){const a=document.createTextNode("");Z(o,[a]);const r={anchor:a,state:null};ve(r,e[n]),t.entries.push(r)}return}t&&M(t);const s=[];for(const i of e){const n=document.createTextNode("");Z(o,[n]);const a={anchor:n,state:null};ve(a,i),s.push(a)}o.state={shape:"array",entries:s}}function Z(o,e){const t=o.anchor.parentNode;if(t)for(const s of e)t.insertBefore(s,o.anchor)}function M(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&&(M(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&&M(e.state),e.anchor.remove()}function st(o){return o==null||o===!1?"":String(o)}function it(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)}}async function nt(o){if(o==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(o),!0}catch{}return Qt(o)}function Qt(o){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=o,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.insetInlineStart="-9999px",t.style.opacity="0",e.body.appendChild(t);const s=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),s?.focus?.(),i}const eo="data-os-mode";function _e(o=typeof document<"u"?document.documentElement:null){return!!o&&o.getAttribute(eo)==="mobile"}function to(o){return o.phone??_e()?h`<os-select
1 +var openStationApp_users=function(ze){"use strict";const jt="desktop-mode";function tt(){return window.wp?.i18n}function l(o,e=jt){return tt()?.__(o,e)??o}function x(o,...e){const t=tt()?.sprintf;if(t)return t(o,...e);let s=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(i,n)=>{const r=n?Number.parseInt(n,10)-1:s++;return String(e[r]??"")})}function h(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function Bt(o){return!!o&&o.__wpdHtml===!0}const Kt="$$wpd$$",$=/\$\$wpd\$\$(\d+)\$\$/g,Vt="$$wpd-node$$",Yt=/^\$\$wpd-node\$\$(\d+)\$\$$/,Xt=new Set(["style","script","textarea","title"]);function Gt(o){let e="",t=!1,s=null,i=!1,n=null,r="",a=!1;for(let c=0;c<o.length;c++){const d=o[c];e+=d;for(let p=0;p<d.length;p++){const u=d[p];if(i){d.startsWith("-->",p)&&(i=!1,p+=2);continue}if(n!==null){u==="<"&&d[p+1]==="/"&&d.slice(p+2,p+2+n.length).toLowerCase()===n&&(p+=1+n.length,n=null,t=!0,a=!1,r="");continue}if(s!==null){u===s&&(s=null);continue}if(t){u==='"'||u==="'"?(s=u,a=!1):u===">"?(t=!1,a=!1,Xt.has(r)&&(n=r),r=""):a&&(/[a-zA-Z0-9-]/.test(u)?r+=u.toLowerCase():a=!1);continue}if(d.startsWith("<!--",p)){i=!0,p+=3;continue}const m=d[p+1]??"";u==="<"&&/[a-zA-Z/!]/.test(m)&&(t=!0,r="",a=/[a-zA-Z]/.test(m))}c<o.length-1&&(e+=t||i||n!==null?`${Kt}${c}$$`:`<!--${Vt}${c}$$-->`)}return e}const ot=new WeakMap;function st(o){const e=ot.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=Gt(o);const s=[],i=(a,c)=>{if(a.nodeType===Node.ELEMENT_NODE){const u=a;for(const m of Array.from(u.attributes)){const f=m.name,g=m.value,_=f[0];if($.test(g))if($.lastIndex=0,_==="@"){const v=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"event",name:f.slice(1),valueIndex:v?Number(v[1]):0}),u.removeAttribute(f)}else if(_==="."){const v=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"prop",name:f.slice(1),valueIndex:v?Number(v[1]):0}),u.removeAttribute(f)}else if(_==="?"){const v=$.exec(g);$.lastIndex=0,s.push({path:c,kind:"bool",name:f.slice(1),valueIndex:v?Number(v[1]):0}),u.removeAttribute(f)}else{const v=[],L=[];let A=0,T;for($.lastIndex=0;(T=$.exec(g))!==null;)v.push(g.slice(A,T.index)),L.push(Number(T[1])),A=T.index+T[0].length;v.push(g.slice(A)),s.push({path:c,kind:"attr",name:f,template:v,valueIndices:L}),u.setAttribute(f,"")}}}const d=Array.from(a.childNodes);let p=0;for(let u=0;u<d.length;u++){const m=d[u],f=u+p;if(m.nodeType===Node.COMMENT_NODE){const g=Yt.exec(m.data);if(g){const _=document.createTextNode("");m.parentNode.replaceChild(_,m),s.push({path:[...c,f],kind:"node",valueIndex:Number(g[1])})}continue}if(m.nodeType===Node.TEXT_NODE){const g=m.textContent||"";if(!$.test(g)){$.lastIndex=0;continue}$.lastIndex=0;const _=m.parentNode;let v=0,L;const A=[],T=[];for($.lastIndex=0;(L=$.exec(g))!==null;){L.index>v&&A.push(document.createTextNode(g.slice(v,L.index)));const C=document.createTextNode("");A.push(C),T.push({path:[...c,f+A.length-1],kind:"node",valueIndex:Number(L[1])}),v=L.index+L[0].length}v<g.length&&A.push(document.createTextNode(g.slice(v)));for(const C of A)_.insertBefore(C,m);_.removeChild(m),p+=A.length-1,s.push(...T)}else i(m,[...c,f])}};i(t.content,[]);const r={template:t,buildParts:a=>{const c=[];for(const d of s){let p=a;for(const u of d.path)p=p.childNodes[u];d.kind==="node"?c.push({kind:"node",valueIndex:d.valueIndex,child:{anchor:p,state:null}}):d.kind==="attr"?c.push({kind:"attr",element:p,name:d.name,template:d.template,valueIndices:d.valueIndices}):d.kind==="event"?c.push({kind:"event",valueIndex:d.valueIndex,element:p,name:d.name}):d.kind==="prop"?c.push({kind:"prop",valueIndex:d.valueIndex,element:p,name:d.name}):d.kind==="bool"&&c.push({kind:"bool",valueIndex:d.valueIndex,element:p,name:d.name})}return c}};return ot.set(o,r),r}const it=new WeakMap;function Zt(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function G(o,e){const t=it.get(e);if(t&&t.strings===o.strings&&Zt(t,e)){be(t.parts,o.values);return}const s=st(o.strings),i=s.template.content.cloneNode(!0),n=s.buildParts(i),r=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),be(n,o.values),it.set(e,{strings:o.strings,parts:n,nodes:r})}function be(o,e){for(const t of o)if(t.kind==="node")ve(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let s=t.template[0];for(let i=0;i<t.valueIndices.length;i++)s+=nt(e[t.valueIndices[i]]),s+=t.template[i+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 ve(o,e){if(e==null||e===!1){o.state&&(M(o.state),o.state=null);return}if(Array.isArray(e)){to(o,e);return}if(Bt(e)){eo(o,e);return}if(e instanceof Node){Jt(o,e);return}Qt(o,nt(e))}function Jt(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&M(t),Z(o,[e]),o.state={shape:"node",node:e})}function Qt(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&M(t);const s=document.createTextNode(e);Z(o,[s]),o.state={shape:"text",node:s,text:e}}function eo(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){be(t.parts,e.values);return}t&&M(t);const s=st(e.strings),i=s.template.content.cloneNode(!0),n=s.buildParts(i),r=Array.from(i.childNodes);Z(o,[i]),be(n,e.values),o.state={shape:"template",strings:e.strings,parts:n,nodes:r}}function to(o,e){const t=o.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let n=0;n<i;n++)ve(t.entries[n],e[n]);if(e.length<t.entries.length){for(let n=e.length;n<t.entries.length;n++){const r=t.entries[n];r.state&&M(r.state),r.anchor.remove()}t.entries.length=e.length}else for(let n=t.entries.length;n<e.length;n++){const r=document.createTextNode("");Z(o,[r]);const a={anchor:r,state:null};ve(a,e[n]),t.entries.push(a)}return}t&&M(t);const s=[];for(const i of e){const n=document.createTextNode("");Z(o,[n]);const r={anchor:n,state:null};ve(r,i),s.push(r)}o.state={shape:"array",entries:s}}function Z(o,e){const t=o.anchor.parentNode;if(t)for(const s of e)t.insertBefore(s,o.anchor)}function M(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&&(M(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&&M(e.state),e.anchor.remove()}function nt(o){return o==null||o===!1?"":String(o)}function rt(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)}}async function at(o){if(o==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(o),!0}catch{}return oo(o)}function oo(o){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=o,t.setAttribute("readonly",""),t.setAttribute("aria-hidden","true"),t.style.position="fixed",t.style.insetInlineStart="-9999px",t.style.opacity="0",e.body.appendChild(t);const s=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),s?.focus?.(),i}const so="data-os-mode";function _e(o=typeof document<"u"?document.documentElement:null){return!!o&&o.getAttribute(so)==="mobile"}function io(o){return o.phone??_e()?h`<os-select
2 2 class="os-app-list__status"
3 3 os-bind=${o.bind}
4 4 os-action=${o.action}
5 5 .value=${o.value}
@@ -9,16 +9,16 @@
9 9 os-bind=${o.bind}
10 10 os-action=${o.action}
11 11 value=${o.value}
12 12 label=${o.label}
13 - >${o.segments.map(t=>h`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function oo(o,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&_e(t)){o.hasAttribute("stacked")||o.setAttribute("stacked","");const n=o.getAttribute("sticky-columns");return n!==null&&(o.setAttribute("data-os-sticky-columns",n),o.removeAttribute("sticky-columns")),!0}o.hasAttribute("stacked")&&o.removeAttribute("stacked");const i=o.getAttribute("data-os-sticky-columns");return i!==null&&(o.setAttribute("sticky-columns",i),o.removeAttribute("data-os-sticky-columns")),!1}function at(o){return Array.from(o.selection??[],String)}function so(){let o=null,e=!1,t=null,s=null;return{invalidateColumns(){o=null},invalidateData(){s=null},sync(i){const n={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},a=i.table;if(!a)return n;const r=i.rowId??(d=>d.id),c=oo(a);if(n.phone=c,c!==o&&(o=c,a.columns=i.columns(c),n.columnsChanged=!0),e||(e=!0,i.wire?.(a)),i.listKey!==t&&(t=i.listKey,at(a).length>0&&(a.clearSelection(),n.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==s){s=i.fingerprint,a.data=i.rows,n.dataChanged=!0;const d=new Set(i.rows.map(m=>String(r(m)))),p=at(a),u=p.filter(m=>d.has(m));u.length!==p.length&&(a.selection=u,n.selectionChanged=!0,i.onSelection?.(u))}return n}}}function io(o,e){const t=e.local??{},s={id:o,hasLocal:a=>Object.prototype.hasOwnProperty.call(t,a),runLocal:(a,r,c,d)=>{const p=t[a];if(!p)return r;const u={...r},m=p(u,c,d);return m===void 0?u:m},render:a=>{G(e.view(a),a.root),e.updated?.(a)},mounted:a=>e.mounted?.(a)},{placeholder:i}=e;i&&(s.placeholder=a=>i(a));const n=window;return(n.openStationApps??(n.openStationApps={}))[o]=s,s}class no{constructor(){this.data=null,this.loading=!1,this.error=!1,this.active=!1,this.previous=null,this.request=null,this.disposed=!1}update(e){const t=e.state.tab==="activity",s=t&&(!this.active||this.previous!==e.data);this.active=t,this.previous=e.data,s&&this.load(e)}async load(e){if(this.disposed||this.loading)return;const t=new AbortController;this.request=t,this.loading=!0,this.error=!1,e.repaint();try{const s=await e.fetch("/desktop-mode/v1/users/activity-summary",{signal:t.signal});if(!s.ok)throw new Error("Activity summary unavailable");const i=await s.json();t.signal.aborted||(this.data=i)}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.disposed||e.repaint()}}dispose(){this.disposed=!0,this.request?.abort()}}class ao{constructor(){this.data=null,this.loading=!1,this.error=!1,this.active=!1,this.previous=null,this.request=null,this.disposed=!1}update(e){const t=e.state.tab==="roles",s=t&&(!this.active||this.previous!==e.data);this.active=t,this.previous=e.data,s&&this.load(e)}async load(e){if(this.disposed||this.loading)return;const t=new AbortController;this.request=t,this.loading=!0,this.error=!1,e.repaint();try{const s=await e.fetch("/desktop-mode/v1/users/roles-summary",{signal:t.signal});if(!s.ok)throw new Error("Role summary unavailable");const i=await s.json();t.signal.aborted||(this.data=i)}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.disposed||e.repaint()}}dispose(){this.disposed=!0,this.request?.abort()}}class ro{constructor(){this.items=[],this.pending=!1,this.error=!1,this.key="",this.lastData=null,this.page=0,this.pages=0,this.expected=0,this.disposed=!1,this.ctx=null,this.observer=null,this.sentinel=null,this.restarting=!1}reconcile(e){this.ctx=e;const{state:t,data:s}=e,i=JSON.stringify([t.search,t.role,t.orderby,t.order,t.perPage]);if(i!==this.key&&(this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&s&&s!==this.lastData&&s.list.page===t.page)if(this.lastData=s,s.list.error)this.error=!0;else if(s.list.page>1&&s.list.page!==this.expected)this.restarting||(this.restarting=!0,queueMicrotask(()=>{this.disposed||e.dispatch("page",{page:1}).catch(()=>{this.error=!0}).finally(()=>{this.restarting=!1,this.disposed||e.repaint()})}));else{const n=s.list.page===1?s.list.items:[...this.items,...s.list.items];this.items=Array.from(new Map(n.map(a=>[a.id,a])).values()),this.page=s.list.page,this.pages=s.list.pages,this.error=!1}return s?{...e,data:{...s,list:{...s.list,items:this.items}}}:e}get hasMore(){return this.page>0&&this.page<this.pages}async more(){const e=this.ctx;if(!(!e||this.disposed||this.pending||e.loading||!this.hasMore)){this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const t=this.expected;(!await e.dispatch("page",{page:t})||e.data?.list.error||this.page!==t||!this.hasMore&&this.items.length<e.data.list.total)&&(this.error=!0)}catch{this.error=!0}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}}tail(){let e=this.items.length?l("You’re all caught up."):"";return this.pending?e=l("Loading more…"):this.hasMore&&(e=h`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?l("Could not load more. Retry"):l("Load more people")}</os-button>`),h`<div class="os-people__continuation" data-users-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-people__cards [data-users-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(s=>{s.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-people__cards"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}const W=class W 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(rt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,s){if(t===s)return;const i=lo(e);this._propValues[i]=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(i=>String(i).trim()).filter(i=>i!=="");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=rt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(s),set:i=>{let n;i==null||i===!1?n=null:i===!0?n="":n=String(i),this._propValues[t]=n,n===null?this.removeAttribute(s):this.setAttribute(s,n),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&G(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 i=document.createElement("style");i.textContent=s.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!W._lightStylesAdopted.has(e)){W._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)}}}};W.props=[],W.styles=[],W.shadow=!0,W._lightStylesAdopted=new WeakSet;let w=W;function S(o,e){customElements.get(o)||customElements.define(o,e)}function rt(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function lo(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const co=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function b(o,...e){let t=o[0];for(let s=1;s<o.length;s++){const i=e[s-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=o[s]}if(co){const s=new CSSStyleSheet;return s.replaceSync(t),{__wpdCss:!0,sheet:s,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function uo(o){if(!o)return 214;let e=5381;for(let t=0;t<o.length;t++)e=Math.imul(e,33)+o.charCodeAt(t);return(e%360+360)%360}const po=b`:host{display:inline-flex;position:relative;width:var( --os-ui-avatar-size,32px );height:var( --os-ui-avatar-size,32px );flex:0 0 auto;vertical-align:middle;line-height:0;perspective:calc( var( --os-ui-avatar-size,32px ) * 8 );--os-ui-avatar-tilt-x:0deg;--os-ui-avatar-tilt-y:0deg;--os-ui-avatar-hover:0;--os-ui-avatar-glare-x:50%;--os-ui-avatar-glare-y:50%}:host( [ hidden ] ){display:none}.os-avatar__tile{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var( --os-window-bg,#f0f0f1 );color:var( --os-ui-fg-on-accent,#fff );display:flex;align-items:center;justify-content:center;font-weight:700;font-size:calc( var( --os-ui-avatar-size,32px ) * 0.48 );line-height:1;letter-spacing:0;font-feature-settings:'tnum' 1;user-select:none;transform-style:preserve-3d;transform:rotateX( var( --os-ui-avatar-tilt-x ) ) rotateY( var( --os-ui-avatar-tilt-y ) ) scale( calc( 1 + var( --os-ui-avatar-hover ) * 0.07 ) );transition:transform 220ms cubic-bezier( 0.2,0.8,0.2,1 ),box-shadow 220ms cubic-bezier( 0.2,0.8,0.2,1 );box-shadow:inset 0 0 0 1px rgba( 255,255,255,calc( 0.18 + 0.22 * var( --os-ui-avatar-hover ) ) ),inset 0 0 0 calc( 1px + var( --os-ui-avatar-hover ) * 1px ) rgba( 0,0,0,calc( 0.08 + 0.04 * var( --os-ui-avatar-hover ) ) ),0 calc( 1px + var( --os-ui-avatar-hover ) * 8px ) calc( 6px + var( --os-ui-avatar-hover ) * 18px ) rgba( 0,0,0,calc( 0.08 + 0.18 * var( --os-ui-avatar-hover ) ) )}.os-avatar__tile::after{content:'';position:absolute;inset:0;border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),var( --os-ui-scrim,rgba( 255,255,255,0.55 ) ) 0%,var( --os-ui-hover,rgba( 255,255,255,0 ) ) 55% );opacity:var( --os-ui-avatar-hover );mix-blend-mode:overlay;pointer-events:none;transition:opacity 220ms cubic-bezier( 0.2,0.8,0.2,1 )}.os-avatar__tile::before{content:'';position:absolute;inset:calc( var( --os-ui-avatar-hover ) * -3px );border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),color-mix( in srgb,var( --os-ui-avatar-halo,rgb( 99,102,241 ) ) calc( 35% * var( --os-ui-avatar-hover ) ),transparent ) 0%,transparent 70% );filter:blur( 4px );pointer-events:none;z-index:-1;transition:inset 220ms cubic-bezier( 0.2,0.8,0.2,1 ),background 220ms}.os-avatar__tile img{width:calc( 100% + 2px );height:calc( 100% + 2px );margin:-1px;object-fit:cover;display:block;transform:translateZ( 1px )}.os-avatar__dot{position:absolute;bottom:0;inset-inline-end:0;width:calc( var( --os-ui-avatar-size,32px ) * 0.32 );height:calc( var( --os-ui-avatar-size,32px ) * 0.32 );min-width:8px;min-height:8px;border-radius:50%;box-sizing:border-box;border:2px solid var( --os-ui-avatar-dot-ring,var( --os-window-bg,#fff ) );background:var( --os-ui-avatar-dot-color,transparent );z-index:2}.os-avatar__dot--online{background:var( --os-ui-success-fg,#00a32a )}.os-avatar__dot--online::after{content:'';position:absolute;inset:-2px;border-radius:50%;border:1px solid var( --os-ui-success-fg,#00a32a );animation:os-avatar-presence 6s var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) ) infinite;pointer-events:none}@keyframes os-avatar-presence{0%{opacity:0.6;transform:scale( 1 )}20%{opacity:0;transform:scale( 2.2 )}100%{opacity:0;transform:scale( 2.2 )}}.os-avatar__dot--inactive{background:var( --os-ui-warning-fg,#dba617 )}.os-avatar__dot--offline{background:var( --os-ui-fg-muted,#8c8f94 )}@media ( prefers-reduced-motion:reduce ){.os-avatar__dot--online::after{animation:none;opacity:0.6}.os-avatar__tile{transform:none;transition:box-shadow 200ms}.os-avatar__tile::after,.os-avatar__tile::before{display:none}}`,lt={xs:20,sm:24,md:40,lg:64,xl:96},ct=new Set(["online","inactive","offline"]),oe=class oe extends w{constructor(){super(...arguments),this._presenceHandler=null,this._imgFailed=!1,this._onPointerMove=null,this._onPointerEnter=null,this._onPointerLeave=null,this._tiltRaf=0,this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%"}connectedCallback(){super.connectedCallback(),this._maybeAttachPresenceListener(),this._attachHoverEffect()}disconnectedCallback(){this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null),this._detachHoverEffect()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",s=this._attr("alt"),i=s!==null?s:t,n=this._attr("size"),a=this._resolveSize(n),r=this._presenceForRender(),c=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${a}px`);const d=e&&!this._imgFailed?"":this._initialsBg(t),p=e&&!this._imgFailed?h`<img
13 + >${o.segments.map(t=>h`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function no(o,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&_e(t)){o.hasAttribute("stacked")||o.setAttribute("stacked","");const n=o.getAttribute("sticky-columns");return n!==null&&(o.setAttribute("data-os-sticky-columns",n),o.removeAttribute("sticky-columns")),!0}o.hasAttribute("stacked")&&o.removeAttribute("stacked");const i=o.getAttribute("data-os-sticky-columns");return i!==null&&(o.setAttribute("sticky-columns",i),o.removeAttribute("data-os-sticky-columns")),!1}function lt(o){return Array.from(o.selection??[],String)}function ro(){let o=null,e=!1,t=null,s=null;return{invalidateColumns(){o=null},invalidateData(){s=null},sync(i){const n={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},r=i.table;if(!r)return n;const a=i.rowId??(d=>d.id),c=no(r);if(n.phone=c,c!==o&&(o=c,r.columns=i.columns(c),n.columnsChanged=!0),e||(e=!0,i.wire?.(r)),i.listKey!==t&&(t=i.listKey,lt(r).length>0&&(r.clearSelection(),n.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==s){s=i.fingerprint,r.data=i.rows,n.dataChanged=!0;const d=new Set(i.rows.map(m=>String(a(m)))),p=lt(r),u=p.filter(m=>d.has(m));u.length!==p.length&&(r.selection=u,n.selectionChanged=!0,i.onSelection?.(u))}return n}}}function ao(o,e){const t=e.local??{},s={id:o,hasLocal:r=>Object.prototype.hasOwnProperty.call(t,r),runLocal:(r,a,c,d)=>{const p=t[r];if(!p)return a;const u={...a},m=p(u,c,d);return m===void 0?u:m},render:r=>{G(e.view(r),r.root),e.updated?.(r)},mounted:r=>e.mounted?.(r)},{placeholder:i}=e;i&&(s.placeholder=r=>i(r));const n=window;return(n.openStationApps??(n.openStationApps={}))[o]=s,s}class lo{constructor(){this.data=null,this.loading=!1,this.error=!1,this.active=!1,this.previous=null,this.request=null,this.disposed=!1}update(e){const t=e.state.tab==="activity",s=t&&(!this.active||this.previous!==e.data);this.active=t,this.previous=e.data,s&&this.load(e)}async load(e){if(this.disposed||this.loading)return;const t=new AbortController;this.request=t,this.loading=!0,this.error=!1,e.repaint();try{const s=await e.fetch("/desktop-mode/v1/users/activity-summary",{signal:t.signal});if(!s.ok)throw new Error("Activity summary unavailable");const i=await s.json();t.signal.aborted||(this.data=i)}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.disposed||e.repaint()}}dispose(){this.disposed=!0,this.request?.abort()}}class co{constructor(){this.data=null,this.loading=!1,this.error=!1,this.active=!1,this.previous=null,this.request=null,this.disposed=!1}update(e){const t=e.state.tab==="roles",s=t&&(!this.active||this.previous!==e.data);this.active=t,this.previous=e.data,s&&this.load(e)}async load(e){if(this.disposed||this.loading)return;const t=new AbortController;this.request=t,this.loading=!0,this.error=!1,e.repaint();try{const s=await e.fetch("/desktop-mode/v1/users/roles-summary",{signal:t.signal});if(!s.ok)throw new Error("Role summary unavailable");const i=await s.json();t.signal.aborted||(this.data=i)}catch{t.signal.aborted||(this.error=!0)}finally{this.loading=!1,this.disposed||e.repaint()}}dispose(){this.disposed=!0,this.request?.abort()}}class uo{constructor(){this.items=[],this.pending=!1,this.error=!1,this.key="",this.lastData=null,this.page=0,this.pages=0,this.expected=0,this.disposed=!1,this.ctx=null,this.observer=null,this.sentinel=null,this.restarting=!1}reconcile(e){this.ctx=e;const{state:t,data:s}=e,i=JSON.stringify([t.search,t.role,t.orderby,t.order,t.perPage]);if(i!==this.key&&(this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&s&&s!==this.lastData&&s.list.page===t.page)if(this.lastData=s,s.list.error)this.error=!0;else if(s.list.page>1&&s.list.page!==this.expected)this.restarting||(this.restarting=!0,queueMicrotask(()=>{this.disposed||e.dispatch("page",{page:1}).catch(()=>{this.error=!0}).finally(()=>{this.restarting=!1,this.disposed||e.repaint()})}));else{const n=s.list.page===1?s.list.items:[...this.items,...s.list.items];this.items=Array.from(new Map(n.map(r=>[r.id,r])).values()),this.page=s.list.page,this.pages=s.list.pages,this.error=!1}return s?{...e,data:{...s,list:{...s.list,items:this.items}}}:e}get hasMore(){return this.page>0&&this.page<this.pages}async more(){const e=this.ctx;if(!(!e||this.disposed||this.pending||e.loading||!this.hasMore)){this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const t=this.expected;(!await e.dispatch("page",{page:t})||e.data?.list.error||this.page!==t||!this.hasMore&&this.items.length<e.data.list.total)&&(this.error=!0)}catch{this.error=!0}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}}tail(){let e=this.items.length?l("You’re all caught up."):"";return this.pending?e=l("Loading more…"):this.hasMore&&(e=h`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?l("Could not load more. Retry"):l("Load more people")}</os-button>`),h`<div class="os-people__continuation" data-users-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-people__cards [data-users-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(s=>{s.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-people__cards"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}const W=class W 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(ct)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,s){if(t===s)return;const i=po(e);this._propValues[i]=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(i=>String(i).trim()).filter(i=>i!=="");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=ct(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(s),set:i=>{let n;i==null||i===!1?n=null:i===!0?n="":n=String(i),this._propValues[t]=n,n===null?this.removeAttribute(s):this.setAttribute(s,n),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&G(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 i=document.createElement("style");i.textContent=s.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!W._lightStylesAdopted.has(e)){W._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)}}}};W.props=[],W.styles=[],W.shadow=!0,W._lightStylesAdopted=new WeakSet;let w=W;function S(o,e){customElements.get(o)||customElements.define(o,e)}function ct(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function po(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const ho=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function b(o,...e){let t=o[0];for(let s=1;s<o.length;s++){const i=e[s-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=o[s]}if(ho){const s=new CSSStyleSheet;return s.replaceSync(t),{__wpdCss:!0,sheet:s,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function mo(o){if(!o)return 214;let e=5381;for(let t=0;t<o.length;t++)e=Math.imul(e,33)+o.charCodeAt(t);return(e%360+360)%360}const fo=b`:host{display:inline-flex;position:relative;width:var( --os-ui-avatar-size,32px );height:var( --os-ui-avatar-size,32px );flex:0 0 auto;vertical-align:middle;line-height:0;perspective:calc( var( --os-ui-avatar-size,32px ) * 8 );--os-ui-avatar-tilt-x:0deg;--os-ui-avatar-tilt-y:0deg;--os-ui-avatar-hover:0;--os-ui-avatar-glare-x:50%;--os-ui-avatar-glare-y:50%}:host( [ hidden ] ){display:none}.os-avatar__tile{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var( --os-window-bg,#f0f0f1 );color:var( --os-ui-fg-on-accent,#fff );display:flex;align-items:center;justify-content:center;font-weight:700;font-size:calc( var( --os-ui-avatar-size,32px ) * 0.48 );line-height:1;letter-spacing:0;font-feature-settings:'tnum' 1;user-select:none;transform-style:preserve-3d;transform:rotateX( var( --os-ui-avatar-tilt-x ) ) rotateY( var( --os-ui-avatar-tilt-y ) ) scale( calc( 1 + var( --os-ui-avatar-hover ) * 0.07 ) );transition:transform 220ms cubic-bezier( 0.2,0.8,0.2,1 ),box-shadow 220ms cubic-bezier( 0.2,0.8,0.2,1 );box-shadow:inset 0 0 0 1px rgba( 255,255,255,calc( 0.18 + 0.22 * var( --os-ui-avatar-hover ) ) ),inset 0 0 0 calc( 1px + var( --os-ui-avatar-hover ) * 1px ) rgba( 0,0,0,calc( 0.08 + 0.04 * var( --os-ui-avatar-hover ) ) ),0 calc( 1px + var( --os-ui-avatar-hover ) * 8px ) calc( 6px + var( --os-ui-avatar-hover ) * 18px ) rgba( 0,0,0,calc( 0.08 + 0.18 * var( --os-ui-avatar-hover ) ) )}.os-avatar__tile::after{content:'';position:absolute;inset:0;border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),var( --os-ui-scrim,rgba( 255,255,255,0.55 ) ) 0%,var( --os-ui-hover,rgba( 255,255,255,0 ) ) 55% );opacity:var( --os-ui-avatar-hover );mix-blend-mode:overlay;pointer-events:none;transition:opacity 220ms cubic-bezier( 0.2,0.8,0.2,1 )}.os-avatar__tile::before{content:'';position:absolute;inset:calc( var( --os-ui-avatar-hover ) * -3px );border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),color-mix( in srgb,var( --os-ui-avatar-halo,rgb( 99,102,241 ) ) calc( 35% * var( --os-ui-avatar-hover ) ),transparent ) 0%,transparent 70% );filter:blur( 4px );pointer-events:none;z-index:-1;transition:inset 220ms cubic-bezier( 0.2,0.8,0.2,1 ),background 220ms}.os-avatar__tile img{width:calc( 100% + 2px );height:calc( 100% + 2px );margin:-1px;object-fit:cover;display:block;transform:translateZ( 1px )}.os-avatar__dot{position:absolute;bottom:0;inset-inline-end:0;width:calc( var( --os-ui-avatar-size,32px ) * 0.32 );height:calc( var( --os-ui-avatar-size,32px ) * 0.32 );min-width:8px;min-height:8px;border-radius:50%;box-sizing:border-box;border:2px solid var( --os-ui-avatar-dot-ring,var( --os-window-bg,#fff ) );background:var( --os-ui-avatar-dot-color,transparent );z-index:2}.os-avatar__dot--online{background:var( --os-ui-success-fg,#00a32a )}.os-avatar__dot--online::after{content:'';position:absolute;inset:-2px;border-radius:50%;border:1px solid var( --os-ui-success-fg,#00a32a );animation:os-avatar-presence 6s var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) ) infinite;pointer-events:none}@keyframes os-avatar-presence{0%{opacity:0.6;transform:scale( 1 )}20%{opacity:0;transform:scale( 2.2 )}100%{opacity:0;transform:scale( 2.2 )}}.os-avatar__dot--inactive{background:var( --os-ui-warning-fg,#dba617 )}.os-avatar__dot--offline{background:var( --os-ui-fg-muted,#8c8f94 )}@media ( prefers-reduced-motion:reduce ){.os-avatar__dot--online::after{animation:none;opacity:0.6}.os-avatar__tile{transform:none;transition:box-shadow 200ms}.os-avatar__tile::after,.os-avatar__tile::before{display:none}}`,dt={xs:20,sm:24,md:40,lg:64,xl:96},ut=new Set(["online","inactive","offline"]),oe=class oe extends w{constructor(){super(...arguments),this._presenceHandler=null,this._imgFailed=!1,this._onPointerMove=null,this._onPointerEnter=null,this._onPointerLeave=null,this._tiltRaf=0,this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%"}connectedCallback(){super.connectedCallback(),this._maybeAttachPresenceListener(),this._attachHoverEffect()}disconnectedCallback(){this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null),this._detachHoverEffect()}attributeChangedCallback(e,t,s){super.attributeChangedCallback(e,t,s),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",s=this._attr("alt"),i=s!==null?s:t,n=this._attr("size"),r=this._resolveSize(n),a=this._presenceForRender(),c=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${r}px`);const d=e&&!this._imgFailed?"":this._initialsBg(t),p=e&&!this._imgFailed?h`<img
14 14 src=${e}
15 15 alt=${i}
16 16 @error=${()=>this._onImgError()}
17 17 loading="lazy"
18 - />`:this._initials(t),u=r?h`<span
19 - class=${`os-avatar__dot os-avatar__dot--${r}`}
20 - aria-label=${this._presenceLabel(r)}
18 + />`:this._initials(t),u=a?h`<span
19 + class=${`os-avatar__dot os-avatar__dot--${a}`}
20 + aria-label=${this._presenceLabel(a)}
21 21 ></span>`:h``;return c?h`
22 22 <button
23 23 type="button"
24 24 class="os-avatar__tile"
@@ -34,9 +34,9 @@
34 34 aria-label=${i||"User"}
35 35 style=${d?`background:${d};`:""}
36 36 >${p}</div>
37 37 ${u}
38 - `}_attr(e){return this.getAttribute(e)}_resolveSize(e){if(!e)return 32;if(e in lt)return lt[e];const t=Number(e);return Number.isFinite(t)&&t>0?t:32}_initials(e){const t=e.trim();return t?Array.from(t)[0]?.toUpperCase()??"?":"?"}_initialsBg(e){const t=uo(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&ct.has(e)?e:null}_presenceLabel(e){switch(e){case"online":return"Online";case"inactive":return"Inactive";case"offline":return"Offline"}}_onImgError(){this._imgFailed=!0,this.requestUpdate()}_onClick(e){const t=this._attr("user-id"),s={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",s)}_attachHoverEffect(){typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(this._onPointerEnter=()=>{this.style.setProperty("--os-ui-avatar-hover","1")},this._onPointerLeave=()=>{this.style.setProperty("--os-ui-avatar-hover","0"),this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%",this._flushTilt()},this._onPointerMove=t=>{const s=this.getBoundingClientRect();if(s.width===0||s.height===0)return;const i=(t.clientX-s.left)/s.width-.5,n=(t.clientY-s.top)/s.height-.5,a=14;this._pendingTiltY=`${(i*a).toFixed(2)}deg`,this._pendingTiltX=`${(-n*a).toFixed(2)}deg`;const r=Math.max(0,Math.min(100,(i+.5)*100)),c=Math.max(0,Math.min(100,(n+.5)*100));this._pendingGlareX=`${r.toFixed(1)}%`,this._pendingGlareY=`${c.toFixed(1)}%`,this._tiltRaf||(this._tiltRaf=requestAnimationFrame(()=>this._flushTilt()))},this.addEventListener("pointerenter",this._onPointerEnter),this.addEventListener("pointerleave",this._onPointerLeave),this.addEventListener("pointermove",this._onPointerMove))}_flushTilt(){this._tiltRaf=0,this.style.setProperty("--os-ui-avatar-tilt-x",this._pendingTiltX),this.style.setProperty("--os-ui-avatar-tilt-y",this._pendingTiltY),this.style.setProperty("--os-ui-avatar-glare-x",this._pendingGlareX),this.style.setProperty("--os-ui-avatar-glare-y",this._pendingGlareY)}_detachHoverEffect(){this._onPointerMove&&(this.removeEventListener("pointermove",this._onPointerMove),this._onPointerMove=null),this._onPointerEnter&&(this.removeEventListener("pointerenter",this._onPointerEnter),this._onPointerEnter=null),this._onPointerLeave&&(this.removeEventListener("pointerleave",this._onPointerLeave),this._onPointerLeave=null),this._tiltRaf&&(cancelAnimationFrame(this._tiltRaf),this._tiltRaf=0)}_maybeAttachPresenceListener(){const e=this._attr("user-id"),t=this._attr("presence"),s=!!e&&!t;s&&!this._presenceHandler?(this._presenceHandler=i=>{const n=i.detail;n&&String(n.userId)===String(e)&&n.newStatus&&ct.has(n.newStatus)&&this.setAttribute("presence",n.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!s&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};oe.props=["src","alt","name","size","presence","userId","clickable"],oe.styles=[po],oe.help=void 0;let ze=oe;S("os-avatar",ze);const ho=b`:host{--_border:var( --os-ui-stat-border,var( --os-ui-border,#dcdcde ) );--_bg:var( --os-ui-stat-bg,transparent );--_value-color:var( --os-ui-stat-value-color,var( --wp-admin-theme-color,#2271b1 ) );--_value-size:var( --os-ui-stat-value-size,20px );--_label-color:var( --os-ui-stat-label-color,var( --os-ui-fg-muted,#646970 ) );display:flex;flex-direction:column;gap:2px;padding:var( --os-ui-stat-padding,10px 12px );border:1px solid var( --_border );border-radius:var( --os-ui-stat-radius,8px );background:var( --_bg );min-inline-size:0}:host( [ hidden ] ){display:none}.value{font-size:var( --_value-size );font-weight:700;line-height:1.1;color:var( --_value-color );font-variant-numeric:tabular-nums}.label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var( --_label-color )}.caption{font-size:11px;color:var( --_label-color )}.swatch{display:inline-block;inline-size:10px;block-size:10px;border-radius:3px;flex:none;background:var( --os-app-tone,var( --os-ui-fg-muted,#646970 ) )}`,se=class se extends w{render(){const e=this,t=e.caption||"";return h`
38 + `}_attr(e){return this.getAttribute(e)}_resolveSize(e){if(!e)return 32;if(e in dt)return dt[e];const t=Number(e);return Number.isFinite(t)&&t>0?t:32}_initials(e){const t=e.trim();return t?Array.from(t)[0]?.toUpperCase()??"?":"?"}_initialsBg(e){const t=mo(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&ut.has(e)?e:null}_presenceLabel(e){switch(e){case"online":return"Online";case"inactive":return"Inactive";case"offline":return"Offline"}}_onImgError(){this._imgFailed=!0,this.requestUpdate()}_onClick(e){const t=this._attr("user-id"),s={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",s)}_attachHoverEffect(){typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(this._onPointerEnter=()=>{this.style.setProperty("--os-ui-avatar-hover","1")},this._onPointerLeave=()=>{this.style.setProperty("--os-ui-avatar-hover","0"),this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%",this._flushTilt()},this._onPointerMove=t=>{const s=this.getBoundingClientRect();if(s.width===0||s.height===0)return;const i=(t.clientX-s.left)/s.width-.5,n=(t.clientY-s.top)/s.height-.5,r=14;this._pendingTiltY=`${(i*r).toFixed(2)}deg`,this._pendingTiltX=`${(-n*r).toFixed(2)}deg`;const a=Math.max(0,Math.min(100,(i+.5)*100)),c=Math.max(0,Math.min(100,(n+.5)*100));this._pendingGlareX=`${a.toFixed(1)}%`,this._pendingGlareY=`${c.toFixed(1)}%`,this._tiltRaf||(this._tiltRaf=requestAnimationFrame(()=>this._flushTilt()))},this.addEventListener("pointerenter",this._onPointerEnter),this.addEventListener("pointerleave",this._onPointerLeave),this.addEventListener("pointermove",this._onPointerMove))}_flushTilt(){this._tiltRaf=0,this.style.setProperty("--os-ui-avatar-tilt-x",this._pendingTiltX),this.style.setProperty("--os-ui-avatar-tilt-y",this._pendingTiltY),this.style.setProperty("--os-ui-avatar-glare-x",this._pendingGlareX),this.style.setProperty("--os-ui-avatar-glare-y",this._pendingGlareY)}_detachHoverEffect(){this._onPointerMove&&(this.removeEventListener("pointermove",this._onPointerMove),this._onPointerMove=null),this._onPointerEnter&&(this.removeEventListener("pointerenter",this._onPointerEnter),this._onPointerEnter=null),this._onPointerLeave&&(this.removeEventListener("pointerleave",this._onPointerLeave),this._onPointerLeave=null),this._tiltRaf&&(cancelAnimationFrame(this._tiltRaf),this._tiltRaf=0)}_maybeAttachPresenceListener(){const e=this._attr("user-id"),t=this._attr("presence"),s=!!e&&!t;s&&!this._presenceHandler?(this._presenceHandler=i=>{const n=i.detail;n&&String(n.userId)===String(e)&&n.newStatus&&ut.has(n.newStatus)&&this.setAttribute("presence",n.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!s&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};oe.props=["src","alt","name","size","presence","userId","clickable"],oe.styles=[fo],oe.help=void 0;let Ee=oe;S("os-avatar",Ee);const go=b`:host{--_border:var( --os-ui-stat-border,var( --os-ui-border,#dcdcde ) );--_bg:var( --os-ui-stat-bg,transparent );--_value-color:var( --os-ui-stat-value-color,var( --wp-admin-theme-color,#2271b1 ) );--_value-size:var( --os-ui-stat-value-size,20px );--_label-color:var( --os-ui-stat-label-color,var( --os-ui-fg-muted,#646970 ) );display:flex;flex-direction:column;gap:2px;padding:var( --os-ui-stat-padding,10px 12px );border:1px solid var( --_border );border-radius:var( --os-ui-stat-radius,8px );background:var( --_bg );min-inline-size:0}:host( [ hidden ] ){display:none}.value{font-size:var( --_value-size );font-weight:700;line-height:1.1;color:var( --_value-color );font-variant-numeric:tabular-nums}.label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var( --_label-color )}.caption{font-size:11px;color:var( --_label-color )}.swatch{display:inline-block;inline-size:10px;block-size:10px;border-radius:3px;flex:none;background:var( --os-app-tone,var( --os-ui-fg-muted,#646970 ) )}`,se=class se extends w{render(){const e=this,t=e.caption||"";return h`
39 39 <span class="value" part="value">${e.value||""}</span>
40 40 <span class="label" part="label">
41 41 ${this.hasAttribute("swatch")?h`<i class="swatch" aria-hidden="true"></i>`:""}
42 42 ${e.label||""}
@@ -41,9 +41,9 @@
41 41 ${this.hasAttribute("swatch")?h`<i class="swatch" aria-hidden="true"></i>`:""}
42 42 ${e.label||""}
43 43 </span>
44 44 ${t?h`<span class="caption" part="caption">${t}</span>`:""}
45 - `}};se.props=["value","label","caption","swatch"],se.styles=[ho],se.help=void 0;let Ee=se;S("os-stat",Ee);const I=b`: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 ) )}`,mo=b` .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%}}`,Re=b` .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%}}`,dt=b` .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}}`,ut=b` .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}}`,pt=b` .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}}`,ht=b` .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%}}`,mt=b` .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}}`,fo=b` 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}}`,Le=b` 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}}`,ft=b` @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}}`;b` ${I} ${mo} ${Re} ${dt} ${ut} ${pt} ${ht} ${mt} ${fo} ${Le} ${ft} `;const go=b` ${I} ${Le}: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}`,ie=class ie extends w{render(){const e=this.checked!==null,t=this.disabled!==null,s=this.label||"",i=this.value;return h`
45 + `}};se.props=["value","label","caption","swatch"],se.styles=[go],se.help=void 0;let Re=se;S("os-stat",Re);const I=b`: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 ) )}`,bo=b` .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%}}`,Le=b` .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%}}`,pt=b` .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}}`,ht=b` .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}}`,mt=b` .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}}`,ft=b` .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%}}`,gt=b` .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}}`,vo=b` 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}}`,Te=b` 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}}`,bt=b` @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}}`;b` ${I} ${bo} ${Le} ${pt} ${ht} ${mt} ${ft} ${gt} ${vo} ${Te} ${bt} `;const _o=b` ${I} ${Te}: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}`,ie=class ie extends w{render(){const e=this.checked!==null,t=this.disabled!==null,s=this.label||"",i=this.value;return h`
46 46 <label>
47 47 <input
48 48 type="checkbox"
49 49 .checked=${e}
@@ -52,9 +52,9 @@
52 52 @change=${n=>this._onChange(n)}
53 53 />
54 54 <span class="os-checkbox__label">${s}</span>
55 55 </label>
56 - `}_onChange(e){const s=e.target.checked;s?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:s,value:this.value})}};ie.props=["checked","value","label","disabled"],ie.styles=[go],ie.help=void 0;let Te=ie;S("os-checkbox",Te);const bo=b` ${I} ${Re} ${dt} ${ut} ${pt} ${ft}: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-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 )}}`,ne=class ne extends w{render(){const e=this.disabled!==null,t=this.busy!==null,s=this.type||"button";return h`
56 + `}_onChange(e){const s=e.target.checked;s?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:s,value:this.value})}};ie.props=["checked","value","label","disabled"],ie.styles=[_o],ie.help=void 0;let Ne=ie;S("os-checkbox",Ne);const yo=b` ${I} ${Le} ${pt} ${ht} ${mt} ${bt}: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 )}}`,ne=class ne extends w{static get observedAttributes(){return[...super.observedAttributes,"aria-label"]}render(){const e=this.disabled!==null,t=this.busy!==null,s=this.type||"button",i=this.getAttribute("aria-label")||"";return h`
57 57 <button
58 58 part="button"
59 59 class="os-holo-edge os-holo-sheen"
60 60 type=${s}
@@ -59,8 +59,9 @@
59 59 class="os-holo-edge os-holo-sheen"
60 60 type=${s}
61 61 ?disabled=${e||t}
62 62 aria-busy=${t?"true":"false"}
63 + aria-label=${i}
63 64 >
64 65 ${t?h`<span class="os-button__spinner" aria-hidden="true"></span>`:""}
65 66 <slot></slot>
66 67 <!--
@@ -72,16 +73,16 @@
72 73 -->
73 74 <span class="os-holo-glint" aria-hidden="true"></span>
74 75 <span class="os-holo-ring" aria-hidden="true"></span>
75 76 </button>
76 - `}};ne.props=["variant","disabled","type","busy","fill-cell"],ne.styles=[bo],ne.help=void 0;let Ne=ne;S("os-button",Ne);const vo=b` ${I} ${mt}: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}}`,_o=b`: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}`,ae=class ae extends w{render(){return h`
77 + `}};ne.props=["variant","disabled","type","busy","fill-cell"],ne.styles=[yo],ne.help=void 0;let Pe=ne;S("os-button",Pe);const xo=b` ${I} ${gt}: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}}`,ko=b`: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}`,re=class re extends w{render(){return h`
77 78 <slot></slot>
78 - `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};ae.props=["open"],ae.styles=[vo],ae.help=void 0;let Pe=ae;S("os-context-menu",Pe);const re=class re extends w{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 h`
79 + `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};re.props=["open"],re.styles=[xo],re.help=void 0;let Me=re;S("os-context-menu",Me);const ae=class ae extends w{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 h`
79 80 ${s?h`<span class="check" aria-hidden="true">✓</span>`:h``}
80 81 ${e?h`<span class="icon dashicons ${e}" aria-hidden="true"></span>`:h``}
81 82 <span class="label"><slot></slot></span>
82 83 ${t?h`<span class="chevron" aria-hidden="true">›</span>`:h``}
83 - `}};re.props=["value","icon","disabled","danger","heading","has-children","checked"],re.styles=[_o],re.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:h`
84 + `}};ae.props=["value","icon","disabled","danger","heading","has-children","checked"],ae.styles=[ko],ae.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:h`
84 85 <os-context-menu open style="position: relative; z-index: 0">
85 86 <os-context-menu-option heading>Every variant</os-context-menu-option>
86 87 <os-context-menu-option value="plain">Plain</os-context-menu-option>
87 88 <os-context-menu-option value="icon" icon="dashicons-admin-page">
@@ -97,10 +98,10 @@
97 98 <os-context-menu-option value="del" danger icon="dashicons-trash">
98 99 Danger
99 100 </os-context-menu-option>
100 101 </os-context-menu>
101 - `};let Me=re;S("os-context-menu-option",Me);function yo(o,e){o.style.visibility="hidden";const t=()=>{o.isConnected&&(e(o.getBoundingClientRect()),o.style.visibility="")};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}const xo=b`: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)}`,le=class le extends w{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 i=t.indexOf(this.ownerDocument.activeElement)+(e.key==="ArrowUp"?-1:1);e.key==="Home"&&(i=0),e.key==="End"&&(i=t.length-1),t[(i+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 h`<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>
102 - <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;yo(t,i=>{if(!this.opened)return;const n=this.getBoundingClientRect(),a=getComputedStyle(this).direction==="rtl";t.style.left=`${Math.max(8,Math.min(a?n.left:n.right-i.width,window.innerWidth-i.width-8))}px`,t.style.top=`${Math.max(8,Math.min(n.bottom+5+i.height<=window.innerHeight-8?n.bottom+5:n.top-i.height-5,window.innerHeight-i.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",i=>{i.composedPath().includes(this)||this.close(!1)},{capture:!0,signal:s}),document.addEventListener("focusin",i=>{i.composedPath().includes(this)||this.close(!1)},{signal:s}),document.addEventListener("scroll",i=>{i.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)}};le.props=["label","text"],le.styles=[xo],le.help=void 0;let Ie=le;S("os-action-menu",Ie);const qe=new Map;async function ko(o){if(!o)return null;let e;try{e=new URL(o,window.location.href)}catch{return o}if(!/gravatar\.com$/i.test(e.hostname))return o;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),s=qe.get(t);if(s!==void 0)return s instanceof Promise,s;const i=new URL(o,window.location.href);i.searchParams.set("d","blank");const n=new Promise(a=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const c=document.createElement("canvas");c.width=1,c.height=1;const d=c.getContext("2d",{willReadFrequently:!0});if(!d){a(o);return}d.drawImage(r,0,0,1,1);const p=d.getImageData(0,0,1,1).data;a(p[3]===0?null:o)}catch{a(o)}},r.onerror=()=>a(null),r.src=i.toString()}).then(a=>(qe.set(t,a),a));return qe.set(t,n),n}function gt(o){return o?.["48"]??o?.["96"]??o?.["24"]??""}function bt(o,e){e&&ko(e).then(t=>{o.isConnected&&(t?o.setAttribute("src",t):o.removeAttribute("src"))})}function wo(o){const e=document.createElement("button");e.type="button",e.setAttribute("data-noclick",""),e.setAttribute("aria-label",o.label),e.title=o.label;const t=o.variant==="danger",s=t?"var( --os-ui-danger, #d63638 )":"var( --os-ui-fg-muted, #50575e )",i=t?"var( --os-ui-danger, #d63638 )":"var( --os-ui-border, #c3c4c7 )",n="var( --os-ui-surface, #fff )",a=()=>{e.style.background=n,e.style.color=s,e.style.borderColor=i},r=()=>{t?(e.style.background="var( --os-ui-danger, #d63638 )",e.style.color="var( --os-ui-fg-on-accent, #fff )",e.style.borderColor="var( --os-ui-danger, #d63638 )"):(e.style.background="var( --os-ui-hover, #f0f0f1 )",e.style.color="var( --os-ui-fg, #1d2327 )",e.style.borderColor="var( --os-ui-border-strong, #8c8f94 )")},c=o.labelled===!0;if(e.style.cssText=["display: inline-flex","align-items: center","justify-content: center",c?"gap: 6px":"",c?"flex: 0 0 auto":"flex: 0 0 30px",c?"width: auto":"width: 30px",c?"height: 36px":"height: 30px",c?"padding: 0 12px":"padding: 0",c?"font-size: 13px":"",c?"font-weight: 600":"","margin: 0","border: 1px solid "+i,"border-radius: 6px","background: "+n,"color: "+s,"cursor: pointer","box-sizing: border-box","line-height: 1","font: inherit","transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease"].join(";"),e.addEventListener("mouseenter",r),e.addEventListener("mouseleave",a),e.addEventListener("focus",r),e.addEventListener("blur",a),e.appendChild(o.glyph),c){const d=document.createElement("span");d.textContent=o.label,d.style.cssText="white-space: nowrap; line-height: 1;",e.appendChild(d)}return e.addEventListener("click",d=>{d.stopPropagation(),o.onClick()}),e}const vt="desktop-mode-user-edit";function $o(o,e={}){if(!Number.isFinite(o)||o<=0)return!1;const t=window.wp?.os;return t?.openWindow?.(vt,{source:e.source??"user-edit/open",params:{userId:o}})?(t?.relations?.set?.(vt,{type:"user",id:o}),!0):(e.fallback?.(),!1)}const So=b` ${I} ${Le}: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}}`,B="__wpd_expander__",V="__wpd_select__",ce=class ce extends w{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 i=null;if(e!=="all"){i=new Set;for(const r of e)i.add(String(r))}const n=s.querySelectorAll("tr[data-row-id]");for(const r of n){const c=r.dataset.rowId;if(c===void 0||i&&!i.has(c))continue;const d=Number(r.dataset.rowIndex);if(!Number.isFinite(d))continue;const p=this._data[d];if(p===void 0)continue;const u=this._getRowId(p,d),m=this._selection.has(u);r.classList.toggle("is-selected",m);const f=r.querySelector("input.select-row-checkbox");f&&f.checked!==m&&(f.checked=m)}const a=t.querySelector("thead .select-all-checkbox");if(a){const{total:r,selected:c}=this._visibleSelectionStats();a.checked=r>0&&c===r,a.indeterminate=c>0&&c<r}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const i=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];i&&i.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 h`
102 + `};let Ie=ae;S("os-context-menu-option",Ie);function wo(o,e){o.style.visibility="hidden";const t=()=>{o.isConnected&&(e(o.getBoundingClientRect()),o.style.visibility="")};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}const $o=b`: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)}`,le=class le extends w{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 i=t.indexOf(this.ownerDocument.activeElement)+(e.key==="ArrowUp"?-1:1);e.key==="Home"&&(i=0),e.key==="End"&&(i=t.length-1),t[(i+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 h`<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>
103 + <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;wo(t,i=>{if(!this.opened)return;const n=this.getBoundingClientRect(),r=getComputedStyle(this).direction==="rtl";t.style.left=`${Math.max(8,Math.min(r?n.left:n.right-i.width,window.innerWidth-i.width-8))}px`,t.style.top=`${Math.max(8,Math.min(n.bottom+5+i.height<=window.innerHeight-8?n.bottom+5:n.top-i.height-5,window.innerHeight-i.height-8))}px`;const a=this.options();a[e?a.length-1:0]?.focus({preventScroll:!0})}),this.listeners=new AbortController;const{signal:s}=this.listeners;document.addEventListener("pointerdown",i=>{i.composedPath().includes(this)||this.close(!1)},{capture:!0,signal:s}),document.addEventListener("focusin",i=>{i.composedPath().includes(this)||this.close(!1)},{signal:s}),document.addEventListener("scroll",i=>{i.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)}};le.props=["label","text"],le.styles=[$o],le.help=void 0;let qe=le;S("os-action-menu",qe);const De=new Map;async function So(o){if(!o)return null;let e;try{e=new URL(o,window.location.href)}catch{return o}if(!/gravatar\.com$/i.test(e.hostname))return o;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),s=De.get(t);if(s!==void 0)return s instanceof Promise,s;const i=new URL(o,window.location.href);i.searchParams.set("d","blank");const n=new Promise(r=>{const a=new Image;a.crossOrigin="anonymous",a.onload=()=>{try{const c=document.createElement("canvas");c.width=1,c.height=1;const d=c.getContext("2d",{willReadFrequently:!0});if(!d){r(o);return}d.drawImage(a,0,0,1,1);const p=d.getImageData(0,0,1,1).data;r(p[3]===0?null:o)}catch{r(o)}},a.onerror=()=>r(null),a.src=i.toString()}).then(r=>(De.set(t,r),r));return De.set(t,n),n}function vt(o){return o?.["48"]??o?.["96"]??o?.["24"]??""}function _t(o,e){e&&So(e).then(t=>{o.isConnected&&(t?o.setAttribute("src",t):o.removeAttribute("src"))})}function Ao(o){const e=document.createElement("button");e.type="button",e.setAttribute("data-noclick",""),e.setAttribute("aria-label",o.label),e.title=o.label;const t=o.variant==="danger",s=t?"var( --os-ui-danger, #d63638 )":"var( --os-ui-fg-muted, #50575e )",i=t?"var( --os-ui-danger, #d63638 )":"var( --os-ui-border, #c3c4c7 )",n="var( --os-ui-surface, #fff )",r=()=>{e.style.background=n,e.style.color=s,e.style.borderColor=i},a=()=>{t?(e.style.background="var( --os-ui-danger, #d63638 )",e.style.color="var( --os-ui-fg-on-accent, #fff )",e.style.borderColor="var( --os-ui-danger, #d63638 )"):(e.style.background="var( --os-ui-hover, #f0f0f1 )",e.style.color="var( --os-ui-fg, #1d2327 )",e.style.borderColor="var( --os-ui-border-strong, #8c8f94 )")},c=o.labelled===!0;if(e.style.cssText=["display: inline-flex","align-items: center","justify-content: center",c?"gap: 6px":"",c?"flex: 0 0 auto":"flex: 0 0 30px",c?"width: auto":"width: 30px",c?"height: 36px":"height: 30px",c?"padding: 0 12px":"padding: 0",c?"font-size: 13px":"",c?"font-weight: 600":"","margin: 0","border: 1px solid "+i,"border-radius: 6px","background: "+n,"color: "+s,"cursor: pointer","box-sizing: border-box","line-height: 1","font: inherit","transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease"].join(";"),e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",r),e.addEventListener("focus",a),e.addEventListener("blur",r),e.appendChild(o.glyph),c){const d=document.createElement("span");d.textContent=o.label,d.style.cssText="white-space: nowrap; line-height: 1;",e.appendChild(d)}return e.addEventListener("click",d=>{d.stopPropagation(),o.onClick()}),e}const yt="desktop-mode-user-edit";function Co(o,e={}){if(!Number.isFinite(o)||o<=0)return!1;const t=window.wp?.os;return t?.openWindow?.(yt,{source:e.source??"user-edit/open",params:{userId:o}})?(t?.relations?.set?.(yt,{type:"user",id:o}),!0):(e.fallback?.(),!1)}const zo=b` ${I} ${Te}: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}}`,B="__wpd_expander__",K="__wpd_select__",ce=class ce extends w{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 i=null;if(e!=="all"){i=new Set;for(const a of e)i.add(String(a))}const n=s.querySelectorAll("tr[data-row-id]");for(const a of n){const c=a.dataset.rowId;if(c===void 0||i&&!i.has(c))continue;const d=Number(a.dataset.rowIndex);if(!Number.isFinite(d))continue;const p=this._data[d];if(p===void 0)continue;const u=this._getRowId(p,d),m=this._selection.has(u);a.classList.toggle("is-selected",m);const f=a.querySelector("input.select-row-checkbox");f&&f.checked!==m&&(f.checked=m)}const r=t.querySelector("thead .select-all-checkbox");if(r){const{total:a,selected:c}=this._visibleSelectionStats();r.checked=a>0&&c===a,r.indeterminate=c>0&&c<a}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const i=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];i&&i.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 h`
103 104 <div class="scroll" part="scroll">
104 105 <table part="table">
105 106 <colgroup></colgroup>
106 107 <thead></thead>
@@ -106,47 +107,47 @@
106 107 <thead></thead>
107 108 <tbody></tbody>
108 109 </table>
109 110 </div>
110 - `}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")||G(this.render(),e);const t=e.querySelector("colgroup"),s=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!s||!i)return;const n=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const a=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,a),this._paintColgroup(t,n),this._paintHead(s,n,a),this._paintBody(i,n,a),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(i),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 i of t){const n=document.createElement("col");i.width&&(n.style.width=i.width),s.push(n)}e.replaceChildren(...s)}_paintHead(e,t,s){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let c=0;c<t.length;c++)i.appendChild(this._buildHeaderCell(t[c],c,s));const n=e.querySelector(':scope > tr[part="header-row"]');n?e.replaceChild(i,n):e.insertBefore(i,e.firstChild);const a=t.some(c=>c.filter||Array.isArray(c.filterOptions)||typeof c.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(a){const c=[];for(let u=0;u<t.length;u++)c.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 d=Array.from(r.children);let p=d.length===c.length;if(p){for(let u=0;u<c.length;u++)if(d[u]!==c[u]){p=!1;break}}if(!p){const u=new Set(c);for(const m of c)r.appendChild(m);for(const m of Array.from(r.children))u.has(m)||r.removeChild(m)}}else r&&r.remove()}_buildHeaderCell(e,t,s){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,s),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===V){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:c}=this._visibleSelectionStats();a.checked=r>0&&c===r,a.indeterminate=c>0&&c<r,a.addEventListener("change",()=>{a.checked?this.selectAll():this.clearSelection()}),i.appendChild(a)}return i}if(i.textContent=e.label??(e.key===B?"":e.key),e.sortable){i.classList.add("is-sortable");const n=this._sort?.key===e.key,a=document.createElement("span");a.className="sort-indicator";let r="";n&&(r=this._sort.direction==="asc"?" ▲":" ▼"),a.textContent=r,i.appendChild(a),n&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,s){const i=this._filterCache.get(e.key),n=Array.isArray(e.filterOptions),a=typeof e.filterRender=="function";let r;if(!e.filter&&!n&&!a||e.key===B||e.key===V?r="none":a?r="custom":e.filter==="select"||n?r="select":r="text",i&&i.kind===r){if(i.th.className="",this._applyCellClasses(i.th,e,t,s),r==="select"){const u=i.control,m=this._resolveFilterOptions(e),f=m.map(g=>g.value).join("|");f!==i.optionsKey?(this._populateSelect(u,m,this._filters[e.key]??""),i.optionsKey=f):u.value=this._filters[e.key]??""}else if(r==="text"){const u=i.control,m=this._filters[e.key]??"";u.value!==m&&u.ownerDocument.activeElement!==u&&(u.value=m)}else r==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e});return i.th}const c=document.createElement("th");if(this._applyCellClasses(c,e,t,s),r==="none")return this._filterCache.set(e.key,{th:c,control:null,optionsKey:"",kind:"none"}),c;if(r==="custom"&&e.filterRender)return e.filterRender(c,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e}),this._filterCache.set(e.key,{th:c,control:null,optionsKey:"",kind:"custom"}),c;let d,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 m=this._resolveFilterOptions(e);this._populateSelect(u,m,this._filters[e.key]??""),p=m.map(f=>f.value).join("|"),u.addEventListener("change",()=>{this._onFilterChange(e.key,u.value)}),d=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)}),d=u}return c.appendChild(d),this._filterCache.set(e.key,{th:c,control:d,optionsKey:p,kind:r}),c}_populateSelect(e,t,s){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const n of t){const a=document.createElement("option");a.value=n.value,a.textContent=n.label,n.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 n=this._readLoadingRows();for(let a=0;a<n;a++)e.appendChild(this._buildSkeletonRow(t,a));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:n,index:a}of i)if(e.appendChild(this._stacked?this._buildStackedRow(n,a,t):this._buildBodyRow(n,a,t,s)),this._expanded.has(a)&&this._subTable){const r=this._subTable(n,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 i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",s.appendChild(i),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 i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const n of[55+t*7%25,30+t*11%15]){const a=document.createElement("span");a.className="skeleton-bar",a.style.width=`${n}%`,i.appendChild(a)}return s.appendChild(i),s}for(const i of e){const n=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}%`,n.appendChild(a),s.appendChild(n)}return s}_buildBodyRow(e,t,s,i){const n=document.createElement("tr");n.setAttribute("part","row"),n.dataset.rowIndex=String(t);const a=this._getRowId(e,t);n.dataset.rowId=String(a),this._selection.has(a)&&n.classList.add("is-selected"),n.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<s.length;r++)n.appendChild(this._buildBodyCell(s[r],r,e,t,i));return n}_buildStackedRow(e,t,s){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const n=this._getRowId(e,t);i.dataset.rowId=String(n),this._selection.has(n)&&i.classList.add("is-selected"),i.addEventListener("click",d=>{this._onRowClick(e,t,d)});const a=document.createElement("td");a.className="stack-body";let r=0,c=0;for(let d=0;d<s.length;d++){const p=s[d];if(p.key===V||p.key===B){i.appendChild(this._buildBodyCell(p,d,e,t,0));continue}c++;const u=Ao(p,r++);if(u==="hidden")continue;const m=document.createElement("div");if(m.className=`stack-cell stack-${u}`,m.dataset.key=p.key,u==="meta"&&p.label){const v=document.createElement("span");v.className="stack-label",v.textContent=p.label,m.appendChild(v)}const f=document.createElement("span");f.className="stack-value";const g=e[p.key];p.render?this._mountCellContent(f,p.render(g,e,t)):g!=null&&(f.textContent=String(g)),m.appendChild(f),a.appendChild(m)}return a.colSpan=Math.max(1,c),i.appendChild(a),i}_buildBodyCell(e,t,s,i,n){const a=document.createElement("td");if(this._applyCellClasses(a,e,t,n),e.minWidth&&(a.style.minWidth=e.minWidth),e.key===V){const c=this._getRowId(s,i),d=document.createElement("input");return d.type="checkbox",d.className="select-row-checkbox",d.setAttribute("data-noclick",""),d.setAttribute("aria-label","Select row"),d.checked=this._selection.has(c),d.addEventListener("change",()=>{d.checked?this.select(c):this.deselect(c)}),a.appendChild(d),this._stacked&&(a.setAttribute("data-noclick",""),a.addEventListener("click",p=>{p.target===a&&(d.checked=!d.checked,d.dispatchEvent(new Event("change")))})),a}if(e.key===B){if(!(this._subTable?!!this._subTable(s,i):!1))return a;const d=this._expanded.has(i),p=document.createElement("button");return p.type="button",p.className="expander",p.setAttribute("data-noclick",""),p.setAttribute("aria-expanded",d?"true":"false"),p.setAttribute("aria-label",d?"Collapse row":"Expand row"),p.textContent=d?"▾":"▸",p.addEventListener("click",u=>{this._toggleRow(i,s,u)}),a.appendChild(p),a}const r=s[e.key];if(e.render){const c=e.render(r,s,i);this._mountCellContent(a,c)}else r!=null&&(a.textContent=String(r));return a}_buildSubTableRow(e,t){const s=document.createElement("tr");s.classList.add("subtable"),s.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const n=document.createElement("div");if(n.classList.add("subtable-inner"),e instanceof Node)n.appendChild(e);else if(_t(e))G(e,n);else{const a=document.createElement("os-table");a.columns=e.columns,a.data=e.data,e.subTable&&(a.subTable=e.subTable),n.appendChild(a)}return i.appendChild(n),s.appendChild(i),s}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}_t(t)&&G(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const i=this.shadowRoot?.querySelector("tbody");if(i){const n=this._effectiveColumns(),a=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,a),this._paintBody(i,n,a),this._applyStickyOffsets()}}_onRowClick(e,t,s){const i=s.composedPath?.()??[];for(const n of i){if(n instanceof Element&&n.hasAttribute("data-noclick"))return;if(n===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:s})}_toggleRow(e,t,s){s.stopPropagation();const i=this._expanded.has(e);i?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!i}),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 i=this._data[s];let n=!0;for(const a of t){const r=this._columns.find(u=>u.key===a);if(r&&typeof r.filterRender=="function")continue;const c=this._filters[a]??"",d=i[a],p=d==null?"":String(d);if(r?.filter==="select"){if(p!==c){n=!1;break}}else if(!p.toLowerCase().includes(c.toLowerCase())){n=!1;break}}n&&e.push({row:i,index:s})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(n=>n.key===this._sort.key);if(!t)return e;const s=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((n,a)=>{const r=t.sortValue?t.sortValue(n.row,n.row[t.key]):n.row[t.key],c=t.sortValue?t.sortValue(a.row,a.row[t.key]):a.row[t.key];return Co(r,c)*s}),i}_uniqueValues(e){const t=new Set;for(const s of this._data){const i=s[e];i!=null&&t.add(String(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:s,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(s,i))&&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 i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(s=i);return s}_applyCellClasses(e,t,s,i){t.key===B&&e.classList.add("col-expander"),t.key===V&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(s,i,t)&&(e.classList.add("is-sticky"),s===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:V,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:B,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),i=[];let n=0;for(let r=0;r<s.length;r++)i[r]=n,s[r].classList.contains("is-sticky")&&(n+=s[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const c=Array.from(r.children);for(let d=0;d<c.length;d++)c[d].classList.contains("is-sticky")&&(c[d].style.insetInlineStart=`${i[d]}px`)}),this._maybeWarnStickyOffsetRace(s,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const s=this._readStickyColumns();if(s<2)return;const i=Math.min(s-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const n=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${i} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${n}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."))}};ce.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ce.styles=[So],ce.help=void 0;let De=ce;function _t(o){return!!o&&o.__wpdHtml===!0}function Ao(o,e){return o.stack?o.stack:e===0?"title":o.label?"meta":"actions"}function Co(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))}S("os-table",De);const zo=b`: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 ye=null;function Eo(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 i of Array.from(s)){const n=i;if(!n||!n.selectorText)continue;const a=n.selectorText.match(/\.dashicons-([a-z0-9-]+)::?before/i);if(!a)continue;const r=n.style?.content;if(!r)continue;const c=Eo(r);c&&o.set(a[1],c)}}return o}function Ro(o){ye||(ye=yt());const e=o.startsWith("dashicons-")?o.slice(10):o;return ye.get(e)??null}function Lo(){ye=yt()}let xt=!1;function To(){if(xt||typeof window>"u")return;xt=!0;const o=()=>{Lo()};document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",o,{once:!0}),window.addEventListener("load",o,{once:!0})}To();const de=class de extends w{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 i=Ro(t);return i?h`<span
111 + `}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")||G(this.render(),e);const t=e.querySelector("colgroup"),s=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!s||!i)return;const n=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const r=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,r),this._paintColgroup(t,n),this._paintHead(s,n,r),this._paintBody(i,n,r),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(i),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 i of t){const n=document.createElement("col");i.width&&(n.style.width=i.width),s.push(n)}e.replaceChildren(...s)}_paintHead(e,t,s){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let c=0;c<t.length;c++)i.appendChild(this._buildHeaderCell(t[c],c,s));const n=e.querySelector(':scope > tr[part="header-row"]');n?e.replaceChild(i,n):e.insertBefore(i,e.firstChild);const r=t.some(c=>c.filter||Array.isArray(c.filterOptions)||typeof c.filterRender=="function");let a=e.querySelector(":scope > tr.filter-row");if(r){const c=[];for(let u=0;u<t.length;u++)c.push(this._buildFilterCell(t[u],u,s));a||(a=document.createElement("tr"),a.classList.add("filter-row"),a.setAttribute("part","filter-row"),e.appendChild(a));const d=Array.from(a.children);let p=d.length===c.length;if(p){for(let u=0;u<c.length;u++)if(d[u]!==c[u]){p=!1;break}}if(!p){const u=new Set(c);for(const m of c)a.appendChild(m);for(const m of Array.from(a.children))u.has(m)||a.removeChild(m)}}else a&&a.remove()}_buildHeaderCell(e,t,s){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,s),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===K){if(this._readSelectable()==="multi"){const r=document.createElement("input");r.type="checkbox",r.className="select-all-checkbox",r.setAttribute("data-noclick",""),r.setAttribute("aria-label","Select all rows");const{total:a,selected:c}=this._visibleSelectionStats();r.checked=a>0&&c===a,r.indeterminate=c>0&&c<a,r.addEventListener("change",()=>{r.checked?this.selectAll():this.clearSelection()}),i.appendChild(r)}return i}if(i.textContent=e.label??(e.key===B?"":e.key),e.sortable){i.classList.add("is-sortable");const n=this._sort?.key===e.key,r=document.createElement("span");r.className="sort-indicator";let a="";n&&(a=this._sort.direction==="asc"?" ▲":" ▼"),r.textContent=a,i.appendChild(r),n&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,s){const i=this._filterCache.get(e.key),n=Array.isArray(e.filterOptions),r=typeof e.filterRender=="function";let a;if(!e.filter&&!n&&!r||e.key===B||e.key===K?a="none":r?a="custom":e.filter==="select"||n?a="select":a="text",i&&i.kind===a){if(i.th.className="",this._applyCellClasses(i.th,e,t,s),a==="select"){const u=i.control,m=this._resolveFilterOptions(e),f=m.map(g=>g.value).join("|");f!==i.optionsKey?(this._populateSelect(u,m,this._filters[e.key]??""),i.optionsKey=f):u.value=this._filters[e.key]??""}else if(a==="text"){const u=i.control,m=this._filters[e.key]??"";u.value!==m&&u.ownerDocument.activeElement!==u&&(u.value=m)}else a==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e});return i.th}const c=document.createElement("th");if(this._applyCellClasses(c,e,t,s),a==="none")return this._filterCache.set(e.key,{th:c,control:null,optionsKey:"",kind:"none"}),c;if(a==="custom"&&e.filterRender)return e.filterRender(c,{value:this._filters[e.key]??"",setValue:u=>this._onFilterChange(e.key,u),col:e}),this._filterCache.set(e.key,{th:c,control:null,optionsKey:"",kind:"custom"}),c;let d,p="";if(a==="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 m=this._resolveFilterOptions(e);this._populateSelect(u,m,this._filters[e.key]??""),p=m.map(f=>f.value).join("|"),u.addEventListener("change",()=>{this._onFilterChange(e.key,u.value)}),d=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)}),d=u}return c.appendChild(d),this._filterCache.set(e.key,{th:c,control:d,optionsKey:p,kind:a}),c}_populateSelect(e,t,s){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const n of t){const r=document.createElement("option");r.value=n.value,r.textContent=n.label,n.value===s&&(r.selected=!0),e.appendChild(r)}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 n=this._readLoadingRows();for(let r=0;r<n;r++)e.appendChild(this._buildSkeletonRow(t,r));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:n,index:r}of i)if(e.appendChild(this._stacked?this._buildStackedRow(n,r,t):this._buildBodyRow(n,r,t,s)),this._expanded.has(r)&&this._subTable){const a=this._subTable(n,r);a&&e.appendChild(this._buildSubTableRow(a,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const s=document.createElement("td");s.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",s.appendChild(i),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 i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const n of[55+t*7%25,30+t*11%15]){const r=document.createElement("span");r.className="skeleton-bar",r.style.width=`${n}%`,i.appendChild(r)}return s.appendChild(i),s}for(const i of e){const n=document.createElement("td"),r=document.createElement("span");r.className="skeleton-bar";const a=50+(t*7+s.children.length*13)%40;r.style.width=`${a}%`,n.appendChild(r),s.appendChild(n)}return s}_buildBodyRow(e,t,s,i){const n=document.createElement("tr");n.setAttribute("part","row"),n.dataset.rowIndex=String(t);const r=this._getRowId(e,t);n.dataset.rowId=String(r),this._selection.has(r)&&n.classList.add("is-selected"),n.addEventListener("click",a=>{this._onRowClick(e,t,a)});for(let a=0;a<s.length;a++)n.appendChild(this._buildBodyCell(s[a],a,e,t,i));return n}_buildStackedRow(e,t,s){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const n=this._getRowId(e,t);i.dataset.rowId=String(n),this._selection.has(n)&&i.classList.add("is-selected"),i.addEventListener("click",d=>{this._onRowClick(e,t,d)});const r=document.createElement("td");r.className="stack-body";let a=0,c=0;for(let d=0;d<s.length;d++){const p=s[d];if(p.key===K||p.key===B){i.appendChild(this._buildBodyCell(p,d,e,t,0));continue}c++;const u=Eo(p,a++);if(u==="hidden")continue;const m=document.createElement("div");if(m.className=`stack-cell stack-${u}`,m.dataset.key=p.key,u==="meta"&&p.label){const v=document.createElement("span");v.className="stack-label",v.textContent=p.label,m.appendChild(v)}const f=document.createElement("span");f.className="stack-value";const g=e[p.key],_=ye(g);p.render?this._mountCellContent(f,p.render(g,e,t)):_!==null?f.appendChild(this._slotFor(_)):g!=null&&(f.textContent=String(g)),m.appendChild(f),r.appendChild(m)}return r.colSpan=Math.max(1,c),i.appendChild(r),i}_buildBodyCell(e,t,s,i,n){const r=document.createElement("td");if(this._applyCellClasses(r,e,t,n),e.minWidth&&(r.style.minWidth=e.minWidth),e.key===K){const d=this._getRowId(s,i),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(d),p.addEventListener("change",()=>{p.checked?this.select(d):this.deselect(d)}),r.appendChild(p),this._stacked&&(r.setAttribute("data-noclick",""),r.addEventListener("click",u=>{u.target===r&&(p.checked=!p.checked,p.dispatchEvent(new Event("change")))})),r}if(e.key===B){if(!(this._subTable?!!this._subTable(s,i):!1))return r;const p=this._expanded.has(i),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",m=>{this._toggleRow(i,s,m)}),r.appendChild(u),r}const a=s[e.key],c=ye(a);if(e.render){const d=e.render(a,s,i);this._mountCellContent(r,d)}else c!==null?r.appendChild(this._slotFor(c)):a!=null&&(r.textContent=String(a));return r}_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 i=document.createElement("td");i.colSpan=t;const n=document.createElement("div");if(n.classList.add("subtable-inner"),e instanceof Node)n.appendChild(e);else if(xt(e))G(e,n);else{const r=document.createElement("os-table");r.columns=e.columns,r.data=e.data,e.subTable&&(r.subTable=e.subTable),n.appendChild(r)}return i.appendChild(n),s.appendChild(i),s}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}xt(t)&&G(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const i=this.shadowRoot?.querySelector("tbody");if(i){const n=this._effectiveColumns(),r=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,r),this._paintBody(i,n,r),this._applyStickyOffsets()}}_onRowClick(e,t,s){const i=s.composedPath?.()??[];for(const n of i){if(n instanceof Element&&n.hasAttribute("data-noclick"))return;if(n===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:s})}_toggleRow(e,t,s){s.stopPropagation();const i=this._expanded.has(e);i?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!i}),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 i=this._data[s];let n=!0;for(const r of t){const a=this._columns.find(u=>u.key===r);if(a&&typeof a.filterRender=="function")continue;const c=this._filters[r]??"",d=i[r],p=We(d);if(a?.filter==="select"){if(p!==c){n=!1;break}}else if(!p.toLowerCase().includes(c.toLowerCase())){n=!1;break}}n&&e.push({row:i,index:s})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(n=>n.key===this._sort.key);if(!t)return e;const s=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((n,r)=>{const a=n.row[t.key],c=r.row[t.key],d=t.sortValue?t.sortValue(n.row,a):kt(a),p=t.sortValue?t.sortValue(r.row,c):kt(c);return Ro(d,p)*s}),i}_uniqueValues(e){const t=new Set;for(const s of this._data){const i=s[e];i!=null&&t.add(We(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:s,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(s,i))&&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 i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(s=i);return s}_applyCellClasses(e,t,s,i){t.key===B&&e.classList.add("col-expander"),t.key===K&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(s,i,t)&&(e.classList.add("is-sticky"),s===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:K,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:B,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),i=[];let n=0;for(let a=0;a<s.length;a++)i[a]=n,s[a].classList.contains("is-sticky")&&(n+=s[a].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(a=>{const c=Array.from(a.children);for(let d=0;d<c.length;d++)c[d].classList.contains("is-sticky")&&(c[d].style.insetInlineStart=`${i[d]}px`)}),this._maybeWarnStickyOffsetRace(s,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const s=this._readStickyColumns();if(s<2)return;const i=Math.min(s-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const n=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${i} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${n}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."))}};ce.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ce.styles=[zo],ce.help=void 0;let Fe=ce;function xt(o){return!!o&&o.__wpdHtml===!0}function Eo(o,e){return o.stack?o.stack:e===0?"title":o.label?"meta":"actions"}function ye(o){return o&&typeof o=="object"&&typeof o.slot=="string"?o.slot:null}function We(o){if(o==null)return"";if(ye(o)!==null){const e=o.text;return e==null?"":String(e)}return String(o)}function kt(o){return ye(o)!==null?We(o):o}function Ro(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))}S("os-table",Fe);const Lo=b`: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 xe=null;function To(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 wt(){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 i of Array.from(s)){const n=i;if(!n||!n.selectorText)continue;const r=n.selectorText.match(/\.dashicons-([a-z0-9-]+)::?before/i);if(!r)continue;const a=n.style?.content;if(!a)continue;const c=To(a);c&&o.set(r[1],c)}}return o}function No(o){xe||(xe=wt());const e=o.startsWith("dashicons-")?o.slice(10):o;return xe.get(e)??null}function Po(){xe=wt()}let $t=!1;function Mo(){if($t||typeof window>"u")return;$t=!0;const o=()=>{Po()};document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",o,{once:!0}),window.addEventListener("load",o,{once:!0})}Mo();const de=class de extends w{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 i=No(t);return i?h`<span
111 112 class="os-icon__glyph os-icon__glyph--char dashicons dashicons-${t}"
112 113 aria-hidden="true"
113 114 >${i}</span>`:h`<span
114 115 class="os-icon__glyph dashicons dashicons-${t}"
115 116 aria-hidden="true"
116 - ></span>`}};de.props=["name","size"],de.styles=[zo],de.help=void 0;let Fe=de;S("os-icon",Fe);const No=b`:host{display:inline;color:inherit;font:inherit}`,xe=new Set;let J=null;const Po=3e4;function Mo(){J===null&&(J=window.setInterval(()=>{for(const o of xe)o.tick()},Po))}function Io(){J!==null&&xe.size===0&&(window.clearInterval(J),J=null)}function qo(o){if(!o)return null;const e=t=>{const s=new Date(t);return Number.isNaN(s.getTime())?null:s};return Do(o)?e(o):e(o.replace(" ","T")+"Z")}function Do(o){const e=Math.max(o.indexOf("T"),o.indexOf(" ")),t=e===-1?"":o.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let We=null,He=null;function kt(){return typeof navigator<"u"&&navigator.language||"en"}function Fo(){return We||(We=new Intl.RelativeTimeFormat(kt(),{numeric:"auto"})),We}function wt(){return He||(He=new Intl.RelativeTimeFormat(kt(),{numeric:"always",style:"narrow"})),He}function Wo(o,e){const t=Fo(),s=o.getTime()-e,i=Math.round(s/1e3),n=Math.abs;return n(i)<45?t.format(0,"second"):$t(t,i)}function $t(o,e){const t=Math.abs,s=Math.round(e/60);if(t(s)<45)return o.format(s,"minute");const i=Math.round(s/60);if(t(i)<22)return o.format(i,"hour");const n=Math.round(i/24);if(t(n)<26)return o.format(n,"day");const a=Math.round(n/30);if(t(a)<11)return o.format(a,"month");const r=Math.round(n/365);return o.format(r,"year")}function Ho(o,e){const t=Math.round((o.getTime()-e)/1e3),s=Math.abs;return s(t)<45?wt().format(0,"second"):s(t)>604800?o.toLocaleDateString(void 0,{month:"short",day:"numeric"}):$t(wt(),t)}const ue=class ue extends w{connectedCallback(){super.connectedCallback(),xe.add(this),Mo()}disconnectedCallback(){xe.delete(this),Io()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=qo(e);if(!t)return h`<span>${e??""}</span>`;const s=Date.now(),i=this.hasAttribute("compact")?Ho(t,s):Wo(t,s),n=t.toLocaleString();return h`<time datetime=${t.toISOString()} title=${n}
117 + ></span>`}};de.props=["name","size"],de.styles=[Lo],de.help=void 0;let He=de;S("os-icon",He);const Io=b`:host{display:inline;color:inherit;font:inherit}`,ke=new Set;let J=null;const qo=3e4;function Do(){J===null&&(J=window.setInterval(()=>{for(const o of ke)o.tick()},qo))}function Fo(){J!==null&&ke.size===0&&(window.clearInterval(J),J=null)}function Wo(o){if(!o)return null;const e=t=>{const s=new Date(t);return Number.isNaN(s.getTime())?null:s};return Ho(o)?e(o):e(o.replace(" ","T")+"Z")}function Ho(o){const e=Math.max(o.indexOf("T"),o.indexOf(" ")),t=e===-1?"":o.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let Oe=null,Ue=null;function St(){return typeof navigator<"u"&&navigator.language||"en"}function Oo(){return Oe||(Oe=new Intl.RelativeTimeFormat(St(),{numeric:"auto"})),Oe}function At(){return Ue||(Ue=new Intl.RelativeTimeFormat(St(),{numeric:"always",style:"narrow"})),Ue}function Uo(o,e){const t=Oo(),s=o.getTime()-e,i=Math.round(s/1e3),n=Math.abs;return n(i)<45?t.format(0,"second"):Ct(t,i)}function Ct(o,e){const t=Math.abs,s=Math.round(e/60);if(t(s)<45)return o.format(s,"minute");const i=Math.round(s/60);if(t(i)<22)return o.format(i,"hour");const n=Math.round(i/24);if(t(n)<26)return o.format(n,"day");const r=Math.round(n/30);if(t(r)<11)return o.format(r,"month");const a=Math.round(n/365);return o.format(a,"year")}function jo(o,e){const t=Math.round((o.getTime()-e)/1e3),s=Math.abs;return s(t)<45?At().format(0,"second"):s(t)>604800?o.toLocaleDateString(void 0,{month:"short",day:"numeric"}):Ct(At(),t)}const ue=class ue extends w{connectedCallback(){super.connectedCallback(),ke.add(this),Do()}disconnectedCallback(){ke.delete(this),Fo()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=Wo(e);if(!t)return h`<span>${e??""}</span>`;const s=Date.now(),i=this.hasAttribute("compact")?jo(t,s):Uo(t,s),n=t.toLocaleString();return h`<time datetime=${t.toISOString()} title=${n}
117 118 >${i}</time
118 - >`}};ue.props=["datetime","compact"],ue.styles=[No],ue.help=void 0;let Oe=ue;S("os-relative-time",Oe);function St(o){if(typeof o=="number")return o>0?o*1e3:NaN;const e=String(o??"");if(!e||e.startsWith("0000-00-00"))return NaN;let t=e.includes(" ")?e.replace(" ","T"):e;!/Z$/.test(t)&&!/[+-]\d{2}:?\d{2}$/.test(t)&&(t+="Z");const s=Date.parse(t);return Number.isFinite(s)?s:NaN}function Oo(o){const e=St(o);if(!Number.isFinite(e)){const s=document.createElement("span");return s.textContent="—",s}const t=document.createElement("os-relative-time");return t.setAttribute("datetime",new Date(e).toISOString()),t.title=it(e,"datetime"),t}function Uo(o){nt(o).catch(()=>!1)}const jo=()=>[{value:"",label:l("All")},{value:"online",label:l("Online")},{value:"recent",label:l("Active 30d")},{value:"never",label:l("No sign-in recorded")}];function Bo(o,e){if(e==="online")return o.filter(t=>t.openstation_presence==="online");if(e==="recent"){const t=Math.floor(Date.now()/1e3);return o.filter(s=>{const i=s.openstation_last_login;return typeof i=="number"&&i>0&&t-i<2592e3})}return e==="never"?o.filter(t=>typeof t.openstation_last_login!="number"||!t.openstation_last_login):o}const Vo=new Set(["identity","email","role","last_login","actions"]),Ko={identity:"name",email:"email",registered:"registered_date"};function Yo(o){const e=o.openstation_user_stats;return[o.id,o.name,o.slug,o.email??"",(o.roles??[]).join(","),o.registered_date??"",o.openstation_last_login??"",o.openstation_presence??"",o.openstation_can_edit?1:0,e?`${e.posts}/${e.pages}/${e.comments}`:""].join("|")}function O(o,e,t,s){const i=`${e}::${t}`,n=o.get(i);if(n)return n;const a=s();return o.set(i,a),a}function At(o,e){for(const t of Array.from(o.keys()))t.startsWith(`${e}::`)&&o.delete(t)}const K="var( --os-ui-fg-muted, #50575e )",Xo="display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;background:var(--os-ui-badge-info-bg, rgba(34,113,177,0.10));color:var(--os-ui-info-fg, #0a4b78);white-space:nowrap;";function Go(o,e){const t=document.createElement("span");t.style.cssText="display:flex;align-items:center;gap:10px;min-width:0;";const s=document.createElement("os-avatar");s.setAttribute("size","32"),o.name&&s.setAttribute("name",o.name),s.setAttribute("presence",o.openstation_presence??"offline");const i=gt(o.avatar_urls);i&&bt(s,i),t.appendChild(s);const n=document.createElement("span");n.style.cssText="display:flex;flex-direction:column;min-width:0;line-height:1.25;";const a=document.createElement("button");if(a.type="button",a.textContent=o.name||`#${o.id}`,a.title=a.textContent,a.setAttribute("data-noclick",""),a.style.cssText="appearance:none;background:transparent;border:none;padding:0;font:inherit;font-weight:600;color:inherit;cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px;",a.addEventListener("mouseenter",()=>{a.style.textDecoration="underline"}),a.addEventListener("mouseleave",()=>{a.style.textDecoration="none"}),a.addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),Q(o.id,e)}),n.appendChild(a),o.slug){const r=document.createElement("span");r.textContent=`@${o.slug}`,r.style.cssText=`font-size:11px;color:${K};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px;`,n.appendChild(r)}return t.appendChild(n),t}function Q(o,e){$o(o,{source:"users-window/row-click",fallback:()=>{console.error("[openstation:desktop-mode-users] the User Edit window is not registered for this user."),e.toast(l("Profile window not registered — see console."))}})}function Zo(o,e){const t=document.createElement("button");t.type="button";const s=typeof o.email=="string"?o.email:"";return t.textContent=s||"—",t.disabled=s==="",t.title=s?l("Click to copy email"):"",t.style.cssText=["appearance:none","background:transparent","border:none","padding:2px 6px","font:inherit","color:inherit",`cursor:${s?"copy":"default"}`,"text-align:left","font-size:13px","border-radius:4px","max-width:100%","overflow:hidden","text-overflow:ellipsis","white-space:nowrap"].join(";"),t.addEventListener("click",i=>{i.stopPropagation(),s&&nt(s).then(n=>{if(!n){e.toast(l("Could not copy the email address."));return}t.textContent=l("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=s,t.style.color=""},1200)})}),t}function Jo(o,e){const t=document.createElement("span");t.style.cssText="display:inline-flex;flex-wrap:wrap;gap:4px;min-width:0;";const s=Array.isArray(o.roles)?o.roles:[];if(s.length===0){const n=document.createElement("span");return n.textContent=l("No role"),n.style.cssText=`color:${K};font-style:italic;`,t.appendChild(n),t}const i=e.allRoles??{};for(const n of s){const a=document.createElement("span");a.textContent=i[n]??n,a.style.cssText=Xo,t.appendChild(a)}return t}function Qo(o){const e=o.openstation_user_stats??{posts:0,pages:0,comments:0},t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:10px;font-size:12px;font-variant-numeric:tabular-nums;";const s=(i,n,a)=>{const r=document.createElement("span");r.style.cssText="display:inline-flex;align-items:center;gap:3px;",r.title=a;const c=document.createElement("os-icon");c.setAttribute("name",i),c.setAttribute("size","14"),c.style.color=K;const d=document.createElement("span");return d.textContent=String(n),n===0&&(d.style.color=K),r.append(c,d),r};return t.append(s("admin-post",e.posts,l("Posts")),s("admin-page",e.pages,l("Pages")),s("admin-comments",e.comments,l("Comments"))),t}function Ct(o,e){const t=document.createElement("span");t.style.cssText="font-size:13px;font-variant-numeric:tabular-nums;";const s=St(o);return Number.isFinite(s)?(t.appendChild(Oo(o)),t.title=it(s,"datetime"),t):(t.textContent=e,t.style.color=K,t)}function es(o,e,t){const s=document.createElement("span");if(s.style.cssText="display:inline-flex;gap:4px;align-items:center;",e.canEdit!==!0||o.openstation_can_edit!==!0)return s.textContent="—",s.style.color=K,s;const i=(n,a,r)=>{const c=document.createElement("os-icon");return c.setAttribute("name",a),c.setAttribute("size","18"),wo({label:n,glyph:c,onClick:r})};return s.append(i(l("Send password reset"),"email-alt",()=>t.onSendReset(o)),i(l("Resend welcome email"),"megaphone",()=>t.onResendWelcome(o))),s}function ts(o,e,t,s=_e()){const i=[{key:"identity",label:l("Name"),sortable:!0,sticky:!0,minWidth:"260px",render:(n,a)=>O(o,a.id,"identity",()=>Go(a,t))},{key:"email",label:l("Email"),sortable:!0,minWidth:"220px",render:(n,a)=>O(o,a.id,"email",()=>Zo(a,t))},{key:"role",label:l("Role"),width:"180px",render:(n,a)=>O(o,a.id,"role",()=>Jo(a,e))},{key:"stats",label:l("Content"),width:"160px",sortValue:n=>{const a=n.openstation_user_stats;return a?a.posts+a.pages+a.comments:0},render:(n,a)=>O(o,a.id,"stats",()=>Qo(a))},{key:"last_login",label:l("Last login"),width:"140px",sortable:!1,sortValue:n=>typeof n.openstation_last_login=="number"?n.openstation_last_login:0,render:(n,a)=>O(o,a.id,"last_login",()=>Ct(a.openstation_last_login,l("Never")))},{key:"registered",label:l("Registered"),width:"140px",sortable:!0,render:(n,a)=>O(o,a.id,"registered",()=>Ct(a.registered_date,"—"))}];return e.canEdit===!0&&i.push({key:"actions",label:l("Actions"),stack:"actions",width:"110px",sortable:!1,render:(n,a)=>O(o,a.id,"actions",()=>es(a,e,t))}),s?i.filter(n=>Vo.has(n.key)):i}const os=(o,e)=>e.allRoles?.[o]||o||l("No role");function U(o,e=48){return h`<os-avatar data-people-avatar=${gt(o.avatar_urls)||""} name=${o.name} size=${e} presence=${o.openstation_presence||""}></os-avatar>`}function ss(o){return o.openstation_presence==="online"?l("Online now"):o.openstation_presence==="inactive"?l("Away"):l("Offline")}function is(o){return o.openstation_last_login?h`<span>${l("Last sign-in")} <os-relative-time datetime=${new Date(o.openstation_last_login*1e3).toISOString()}></os-relative-time></span>`:l("No sign-in recorded")}function ns(o,e,t){return h`<os-action-menu text=${l("Actions")} label=${x(l("Actions for %s"),o.name)} @os-context-menu-pick=${s=>{const i=s.detail.id;i==="profile"&&Q(o.id,t),!(!e.canEdit||!o.openstation_can_edit)&&(i==="reset"&&t.onSendReset(o),i==="welcome"&&t.onResendWelcome(o))}}>
119 + >`}};ue.props=["datetime","compact"],ue.styles=[Io],ue.help=void 0;let je=ue;S("os-relative-time",je);function zt(o){if(typeof o=="number")return o>0?o*1e3:NaN;const e=String(o??"");if(!e||e.startsWith("0000-00-00"))return NaN;let t=e.includes(" ")?e.replace(" ","T"):e;!/Z$/.test(t)&&!/[+-]\d{2}:?\d{2}$/.test(t)&&(t+="Z");const s=Date.parse(t);return Number.isFinite(s)?s:NaN}function Bo(o){const e=zt(o);if(!Number.isFinite(e)){const s=document.createElement("span");return s.textContent="—",s}const t=document.createElement("os-relative-time");return t.setAttribute("datetime",new Date(e).toISOString()),t.title=rt(e,"datetime"),t}function Ko(o){at(o).catch(()=>!1)}const Vo=()=>[{value:"",label:l("All")},{value:"online",label:l("Online")},{value:"recent",label:l("Active 30d")},{value:"never",label:l("No sign-in recorded")}];function Yo(o,e){if(e==="online")return o.filter(t=>t.openstation_presence==="online");if(e==="recent"){const t=Math.floor(Date.now()/1e3);return o.filter(s=>{const i=s.openstation_last_login;return typeof i=="number"&&i>0&&t-i<2592e3})}return e==="never"?o.filter(t=>typeof t.openstation_last_login!="number"||!t.openstation_last_login):o}const Xo=new Set(["identity","email","role","last_login","actions"]),Go={identity:"name",email:"email",registered:"registered_date"};function Zo(o){const e=o.openstation_user_stats;return[o.id,o.name,o.slug,o.email??"",(o.roles??[]).join(","),o.registered_date??"",o.openstation_last_login??"",o.openstation_presence??"",o.openstation_can_edit?1:0,e?`${e.posts}/${e.pages}/${e.comments}`:""].join("|")}function O(o,e,t,s){const i=`${e}::${t}`,n=o.get(i);if(n)return n;const r=s();return o.set(i,r),r}function Et(o,e){for(const t of Array.from(o.keys()))t.startsWith(`${e}::`)&&o.delete(t)}const V="var( --os-ui-fg-muted, #50575e )",Jo="display:inline-flex;align-items:center;padding:2px 8px;border-radius:10px;font-size:11px;font-weight:600;background:var(--os-ui-badge-info-bg, rgba(34,113,177,0.10));color:var(--os-ui-info-fg, #0a4b78);white-space:nowrap;";function Qo(o,e){const t=document.createElement("span");t.style.cssText="display:flex;align-items:center;gap:10px;min-width:0;";const s=document.createElement("os-avatar");s.setAttribute("size","32"),o.name&&s.setAttribute("name",o.name),s.setAttribute("presence",o.openstation_presence??"offline");const i=vt(o.avatar_urls);i&&_t(s,i),t.appendChild(s);const n=document.createElement("span");n.style.cssText="display:flex;flex-direction:column;min-width:0;line-height:1.25;";const r=document.createElement("button");if(r.type="button",r.textContent=o.name||`#${o.id}`,r.title=r.textContent,r.setAttribute("data-noclick",""),r.style.cssText="appearance:none;background:transparent;border:none;padding:0;font:inherit;font-weight:600;color:inherit;cursor:pointer;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px;",r.addEventListener("mouseenter",()=>{r.style.textDecoration="underline"}),r.addEventListener("mouseleave",()=>{r.style.textDecoration="none"}),r.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),Q(o.id,e)}),n.appendChild(r),o.slug){const a=document.createElement("span");a.textContent=`@${o.slug}`,a.style.cssText=`font-size:11px;color:${V};white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px;`,n.appendChild(a)}return t.appendChild(n),t}function Q(o,e){Co(o,{source:"users-window/row-click",fallback:()=>{console.error("[openstation:desktop-mode-users] the User Edit window is not registered for this user."),e.toast(l("Profile window not registered — see console."))}})}function es(o,e){const t=document.createElement("button");t.type="button";const s=typeof o.email=="string"?o.email:"";return t.textContent=s||"—",t.disabled=s==="",t.title=s?l("Click to copy email"):"",t.style.cssText=["appearance:none","background:transparent","border:none","padding:2px 6px","font:inherit","color:inherit",`cursor:${s?"copy":"default"}`,"text-align:left","font-size:13px","border-radius:4px","max-width:100%","overflow:hidden","text-overflow:ellipsis","white-space:nowrap"].join(";"),t.addEventListener("click",i=>{i.stopPropagation(),s&&at(s).then(n=>{if(!n){e.toast(l("Could not copy the email address."));return}t.textContent=l("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=s,t.style.color=""},1200)})}),t}function ts(o,e){const t=document.createElement("span");t.style.cssText="display:inline-flex;flex-wrap:wrap;gap:4px;min-width:0;";const s=Array.isArray(o.roles)?o.roles:[];if(s.length===0){const n=document.createElement("span");return n.textContent=l("No role"),n.style.cssText=`color:${V};font-style:italic;`,t.appendChild(n),t}const i=e.allRoles??{};for(const n of s){const r=document.createElement("span");r.textContent=i[n]??n,r.style.cssText=Jo,t.appendChild(r)}return t}function os(o){const e=o.openstation_user_stats??{posts:0,pages:0,comments:0},t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:10px;font-size:12px;font-variant-numeric:tabular-nums;";const s=(i,n,r)=>{const a=document.createElement("span");a.style.cssText="display:inline-flex;align-items:center;gap:3px;",a.title=r;const c=document.createElement("os-icon");c.setAttribute("name",i),c.setAttribute("size","14"),c.style.color=V;const d=document.createElement("span");return d.textContent=String(n),n===0&&(d.style.color=V),a.append(c,d),a};return t.append(s("admin-post",e.posts,l("Posts")),s("admin-page",e.pages,l("Pages")),s("admin-comments",e.comments,l("Comments"))),t}function Rt(o,e){const t=document.createElement("span");t.style.cssText="font-size:13px;font-variant-numeric:tabular-nums;";const s=zt(o);return Number.isFinite(s)?(t.appendChild(Bo(o)),t.title=rt(s,"datetime"),t):(t.textContent=e,t.style.color=V,t)}function ss(o,e,t){const s=document.createElement("span");if(s.style.cssText="display:inline-flex;gap:4px;align-items:center;",e.canEdit!==!0||o.openstation_can_edit!==!0)return s.textContent="—",s.style.color=V,s;const i=(n,r,a)=>{const c=document.createElement("os-icon");return c.setAttribute("name",r),c.setAttribute("size","18"),Ao({label:n,glyph:c,onClick:a})};return s.append(i(l("Send password reset"),"email-alt",()=>t.onSendReset(o)),i(l("Resend welcome email"),"megaphone",()=>t.onResendWelcome(o))),s}function is(o,e,t,s=_e()){const i=[{key:"identity",label:l("Name"),sortable:!0,sticky:!0,minWidth:"260px",render:(n,r)=>O(o,r.id,"identity",()=>Qo(r,t))},{key:"email",label:l("Email"),sortable:!0,minWidth:"220px",render:(n,r)=>O(o,r.id,"email",()=>es(r,t))},{key:"role",label:l("Role"),width:"180px",render:(n,r)=>O(o,r.id,"role",()=>ts(r,e))},{key:"stats",label:l("Content"),width:"160px",sortValue:n=>{const r=n.openstation_user_stats;return r?r.posts+r.pages+r.comments:0},render:(n,r)=>O(o,r.id,"stats",()=>os(r))},{key:"last_login",label:l("Last login"),width:"140px",sortable:!1,sortValue:n=>typeof n.openstation_last_login=="number"?n.openstation_last_login:0,render:(n,r)=>O(o,r.id,"last_login",()=>Rt(r.openstation_last_login,l("Never")))},{key:"registered",label:l("Registered"),width:"140px",sortable:!0,render:(n,r)=>O(o,r.id,"registered",()=>Rt(r.registered_date,"—"))}];return e.canEdit===!0&&i.push({key:"actions",label:l("Actions"),stack:"actions",width:"110px",sortable:!1,render:(n,r)=>O(o,r.id,"actions",()=>ss(r,e,t))}),s?i.filter(n=>Xo.has(n.key)):i}const ns=(o,e)=>e.allRoles?.[o]||o||l("No role");function U(o,e=48){return h`<os-avatar data-people-avatar=${vt(o.avatar_urls)||""} name=${o.name} size=${e} presence=${o.openstation_presence||""}></os-avatar>`}function rs(o){return o.openstation_presence==="online"?l("Online now"):o.openstation_presence==="inactive"?l("Away"):l("Offline")}function as(o){return o.openstation_last_login?h`<span>${l("Last sign-in")} <os-relative-time datetime=${new Date(o.openstation_last_login*1e3).toISOString()}></os-relative-time></span>`:l("No sign-in recorded")}function ls(o,e,t){return h`<os-action-menu text=${l("Actions")} label=${x(l("Actions for %s"),o.name)} @os-context-menu-pick=${s=>{const i=s.detail.id;i==="profile"&&Q(o.id,t),!(!e.canEdit||!o.openstation_can_edit)&&(i==="reset"&&t.onSendReset(o),i==="welcome"&&t.onResendWelcome(o))}}>
119 120 <os-context-menu-option data-menu-item-id="profile" icon="dashicons-id">${l("View profile")}</os-context-menu-option>
120 121 ${e.canEdit&&o.openstation_can_edit?h`
121 122 <os-context-menu-option heading>${l("Account emails")}</os-context-menu-option>
122 123 <os-context-menu-option data-menu-item-id="reset" icon="dashicons-lock">${l("Send password reset")}</os-context-menu-option>
123 124 <os-context-menu-option data-menu-item-id="welcome" icon="dashicons-email-alt">${l("Resend welcome")}</os-context-menu-option>`:""}
124 - </os-action-menu>`}function as(o){const e=new Date(o.registered_date||"");return Number.isNaN(e.getTime())?"—":e.toLocaleDateString(void 0,{month:"short",year:"numeric"})}function rs(o,e,t,s){const{cfg:i,actions:n}=e,a=i.canEdit||i.canPromote||i.canDelete;return h`<div class="os-people__cards" aria-label=${l("People directory")}>
125 - ${o.length?o.map(r=>h`<article class="os-people__card ${e.selected.includes(r.id)?"is-selected":""}" data-person-id=${r.id}>
125 + </os-action-menu>`}function cs(o){const e=new Date(o.registered_date||"");return Number.isNaN(e.getTime())?"—":e.toLocaleDateString(void 0,{month:"short",year:"numeric"})}function ds(o,e,t,s){const{cfg:i,actions:n}=e,r=i.canEdit||i.canPromote||i.canDelete;return h`<div class="os-people__cards" aria-label=${l("People directory")}>
126 + ${o.length?o.map(a=>h`<article class="os-people__card ${e.selected.includes(a.id)?"is-selected":""}" data-person-id=${a.id}>
126 127 <header class="os-people__id-header"><span class="os-people__issuer"><span class="dashicons dashicons-id-alt" aria-hidden="true"></span> OPENSTATION <span>/ ${l("MEMBER")}</span></span>
127 - ${r.id===i.currentUserId?h`<span class="os-people__you">${l("You")}</span>`:""}
128 - ${a?h`<os-checkbox class="os-people__select" aria-label=${x(l("Select %s"),r.name)} ?checked=${e.selected.includes(r.id)} @os-checkbox-change=${c=>e.select(r.id,c.detail.checked)}></os-checkbox>`:""}
128 + ${a.id===i.currentUserId?h`<span class="os-people__you">${l("You")}</span>`:""}
129 + ${r?h`<os-checkbox class="os-people__select" aria-label=${x(l("Select %s"),a.name)} ?checked=${e.selected.includes(a.id)} @os-checkbox-change=${c=>e.select(a.id,c.detail.checked)}></os-checkbox>`:""}
129 130 </header>
130 131 <div class="os-people__identity">
131 - <div class="os-people__portrait">${U(r,64)}<span class="os-people__member-number" title=${l("WordPress user ID")}>#${String(r.id).padStart(5,"0")}</span></div>
132 - <div class="os-people__credentials"><h3><os-button variant="ghost" title=${r.name} @click=${()=>Q(r.id,n)}>${r.name||r.slug}</os-button></h3>
133 - <p class="os-people__handle">@${r.slug}</p>
134 - <div class="os-people__roles">${(r.roles.length?r.roles:[""]).map(c=>h`<span>${os(c,i)}</span>`)}</div>
135 - <p class="os-people__email" title=${r.email||""}>${r.email||l("No email available")}</p>
136 - <p class="os-people__joined">${l("Member since")} <time datetime=${r.registered_date||""}>${as(r)}</time></p>
132 + <div class="os-people__portrait">${U(a,64)}<span class="os-people__member-number" title=${l("WordPress user ID")}>#${String(a.id).padStart(5,"0")}</span></div>
133 + <div class="os-people__credentials"><h3><os-button variant="ghost" title=${a.name} @click=${()=>Q(a.id,n)}>${a.name||a.slug}</os-button></h3>
134 + <p class="os-people__handle">@${a.slug}</p>
135 + <div class="os-people__roles">${(a.roles.length?a.roles:[""]).map(c=>h`<span>${ns(c,i)}</span>`)}</div>
136 + <p class="os-people__email" title=${a.email||""}>${a.email||l("No email available")}</p>
137 + <p class="os-people__joined">${l("Member since")} <time datetime=${a.registered_date||""}>${cs(a)}</time></p>
137 138 </div>
138 139 </div>
139 140 <div class="os-people__stats" aria-label=${l("Published contributions")}>
140 - <os-stat value=${String(r.openstation_user_stats?.posts??"—")} label=${l("Posts")}></os-stat>
141 - <os-stat value=${String(r.openstation_user_stats?.pages??"—")} label=${l("Pages")}></os-stat>
142 - <os-stat value=${String(r.openstation_user_stats?.comments??"—")} label=${l("Comments")}></os-stat>
141 + <os-stat value=${String(a.openstation_user_stats?.posts??"—")} label=${l("Posts")}></os-stat>
142 + <os-stat value=${String(a.openstation_user_stats?.pages??"—")} label=${l("Pages")}></os-stat>
143 + <os-stat value=${String(a.openstation_user_stats?.comments??"—")} label=${l("Comments")}></os-stat>
143 144 <span class="os-people__seal" aria-hidden="true"><span class="dashicons dashicons-admin-users"></span></span>
144 145 </div>
145 - <footer><span class="os-people__presence" data-presence=${r.openstation_presence||"offline"} title=${l("Current presence")}>${ss(r)}</span><span class="os-people__last-login">${is(r)}</span>${ns(r,i,n)}</footer>
146 + <footer><span class="os-people__presence" data-presence=${a.openstation_presence||"offline"} title=${l("Current presence")}>${rs(a)}</span><span class="os-people__last-login">${as(a)}</span>${ls(a,i,n)}</footer>
146 147 </article>`):h`<div class="os-people__empty"><span class="dashicons dashicons-admin-users" aria-hidden="true"></span><h3>${l(s?"Meeting your people…":"No people match this view.")}</h3><p>${l("Try another search, presence or role filter.")}</p></div>`}
147 148 ${t}
148 - </div>`}function ls(o,e){return h`<div class="os-people__role-grid">${o.map(t=>h`<article class="os-people__room">
149 + </div>`}function us(o,e){return h`<div class="os-people__role-grid">${o.map(t=>h`<article class="os-people__room">
149 150 <div class="os-people__orbit"><div class="os-people__orbit-center"><strong>${t.total}</strong><span>${t.label}</span></div>
150 151 ${t.members.slice(0,8).map((s,i)=>{const n=i/Math.min(t.members.length,8)*Math.PI*2-Math.PI/2;return h`<span class="os-people__satellite" style=${`inset-inline-start:${50+Math.cos(n)*42}%;inset-block-start:${50+Math.sin(n)*42}%`} title=${s.name}>${U(s,36)}</span>`})}</div>
151 152 <p>${t.members.slice(0,3).map(s=>s.name).join(", ")}${t.total>3?"…":""}</p>
152 153 <os-button variant="secondary" ?disabled=${t.total===0} @click=${()=>e(t.role)}>${l("Meet this group")} ↗</os-button>
@@ -151,9 +152,9 @@
151 152 <p>${t.members.slice(0,3).map(s=>s.name).join(", ")}${t.total>3?"…":""}</p>
152 153 <os-button variant="secondary" ?disabled=${t.total===0} @click=${()=>e(t.role)}>${l("Meet this group")} ↗</os-button>
153 154 </article>`)}
154 155 ${o.length?"":h`<p class="os-people__empty">${l("No role groups found.")}</p>`}
155 - </div>`}function cs(o){queueMicrotask(()=>{o.querySelectorAll("[data-people-avatar]").forEach(e=>{const t=e.getAttribute("data-people-avatar")||"";e.dataset.avatarResolved!==t&&(e.dataset.avatarResolved=t,bt(e,t))}),o.querySelectorAll(".os-people__select, [data-os-users-search]").forEach(e=>e.shadowRoot?.querySelector("input")?.setAttribute("aria-label",e.getAttribute("aria-label")||""))})}const ds=b` ${I} ${ht}:host{display:block;--_track-bg:var( --os-ui-progress-track-bg,var( --os-ui-surface-sunken,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-progress-fill,var( --wp-admin-theme-color,#2271b1 ) );--_height:var( --os-ui-progress-height,6px );--_radius:var( --os-ui-progress-radius,999px );--_label-color:var( --os-ui-progress-label-color,inherit );--_label-size:var( --os-ui-progress-label-size,12px );--_label-gap:var( --os-ui-progress-label-gap,4px );width:100%;font:inherit;color:var( --_label-color )}:host( [ hidden ] ){display:none}.header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:var( --_label-gap );font-size:var( --_label-size );line-height:1.3}.label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.percent{font-variant-numeric:tabular-nums;opacity:0.75;flex-shrink:0}.track{position:relative;width:100%;height:var( --_height );background:var( --_track-bg );border-radius:var( --_radius );overflow:hidden}.fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;background:var( --_fill );border-radius:inherit;transition:width 0.18s ease-out}:host( [ tone='success' ] ){--os-ui-progress-fill:var( --os-ui-success-fg,#3a8a3a )}:host( [ tone='warning' ] ){--os-ui-progress-fill:var( --os-ui-warning-fg,#dba617 )}:host( [ tone='danger' ] ){--os-ui-progress-fill:var( --os-ui-danger,#d63638 )}:host( [ indeterminate ] ) .fill{width:100%;transition:none;background-image:var( --_fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}:host( [ indeterminate ][ tone ] ) .fill{width:33%;background-image:none;animation:os-progress-sweep 1.1s linear infinite}@keyframes os-progress-sweep{0%{transform:translateX( -120% )}100%{transform:translateX( 320% )}}@media ( prefers-reduced-motion:reduce ){.fill{transition:none}:host( [ indeterminate ] ) .fill,:host( [ indeterminate ][ tone ] ) .fill{animation:none;width:100%;opacity:0.6}}`,pe=class pe extends w{constructor(){super(...arguments),this._ownedAriaLabel=null}render(){return h`<div class="root" part="root">
156 + </div>`}function ps(o){queueMicrotask(()=>{o.querySelectorAll("[data-people-avatar]").forEach(e=>{const t=e.getAttribute("data-people-avatar")||"";e.dataset.avatarResolved!==t&&(e.dataset.avatarResolved=t,_t(e,t))}),o.querySelectorAll(".os-people__select, [data-os-users-search]").forEach(e=>e.shadowRoot?.querySelector("input")?.setAttribute("aria-label",e.getAttribute("aria-label")||""))})}const hs=b` ${I} ${ft}:host{display:block;--_track-bg:var( --os-ui-progress-track-bg,var( --os-ui-surface-sunken,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-progress-fill,var( --wp-admin-theme-color,#2271b1 ) );--_height:var( --os-ui-progress-height,6px );--_radius:var( --os-ui-progress-radius,999px );--_label-color:var( --os-ui-progress-label-color,inherit );--_label-size:var( --os-ui-progress-label-size,12px );--_label-gap:var( --os-ui-progress-label-gap,4px );width:100%;font:inherit;color:var( --_label-color )}:host( [ hidden ] ){display:none}.header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:var( --_label-gap );font-size:var( --_label-size );line-height:1.3}.label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.percent{font-variant-numeric:tabular-nums;opacity:0.75;flex-shrink:0}.track{position:relative;width:100%;height:var( --_height );background:var( --_track-bg );border-radius:var( --_radius );overflow:hidden}.fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;background:var( --_fill );border-radius:inherit;transition:width 0.18s ease-out}:host( [ tone='success' ] ){--os-ui-progress-fill:var( --os-ui-success-fg,#3a8a3a )}:host( [ tone='warning' ] ){--os-ui-progress-fill:var( --os-ui-warning-fg,#dba617 )}:host( [ tone='danger' ] ){--os-ui-progress-fill:var( --os-ui-danger,#d63638 )}:host( [ indeterminate ] ) .fill{width:100%;transition:none;background-image:var( --_fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}:host( [ indeterminate ][ tone ] ) .fill{width:33%;background-image:none;animation:os-progress-sweep 1.1s linear infinite}@keyframes os-progress-sweep{0%{transform:translateX( -120% )}100%{transform:translateX( 320% )}}@media ( prefers-reduced-motion:reduce ){.fill{transition:none}:host( [ indeterminate ] ) .fill,:host( [ indeterminate ][ tone ] ) .fill{animation:none;width:100%;opacity:0.6}}`,pe=class pe extends w{constructor(){super(...arguments),this._ownedAriaLabel=null}render(){return h`<div class="root" part="root">
156 157 <div class="header" part="header" hidden>
157 158 <span class="label" part="label"></span>
158 159 <span class="percent" part="percent"></span>
159 160 </div>
@@ -159,13 +160,13 @@
159 160 </div>
160 161 <div class="track" part="track">
161 162 <div class="fill" part="fill"></div>
162 163 </div>
163 - </div>`}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this._paint())}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._paint())}_paint(){const e=this.shadowRoot;if(!e)return;const t=this._readMax(),s=this.hasAttribute("indeterminate")||t<=0,i=s?0:this._readValue(t),n=s?0:i/t,a=Math.round(n*100),r=this.getAttribute("label")??"",c=this.hasAttribute("show-percent"),d=e.querySelector(".fill");d&&!s?d.style.width=`${(n*100).toFixed(2)}%`:d&&s&&d.style.removeProperty("width");const p=e.querySelector(".header"),u=e.querySelector(".label"),m=e.querySelector(".percent");if(p&&u&&m){const g=r||c&&!s;p.hidden=!g,u.textContent=r,m.hidden=!(c&&!s),m.textContent=`${a}%`}this._syncAria(t,i,s,r);const f=e.querySelector(".track");f&&(f.setAttribute("role","progressbar"),f.setAttribute("aria-valuemin","0"),s?(f.removeAttribute("aria-valuenow"),f.removeAttribute("aria-valuemax")):(f.setAttribute("aria-valuemax",String(t)),f.setAttribute("aria-valuenow",String(i))),r?f.setAttribute("aria-label",r):f.removeAttribute("aria-label"))}_syncAria(e,t,s,i){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),s?(this.removeAttribute("aria-valuenow"),this.removeAttribute("aria-valuemax")):(this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(t)));const n=this.getAttribute("aria-label");i?(n===null||n===this._ownedAriaLabel)&&(this.setAttribute("aria-label",i),this._ownedAriaLabel=i):n!==null&&n===this._ownedAriaLabel&&(this.removeAttribute("aria-label"),this._ownedAriaLabel=null)}_readMax(){const e=this.getAttribute("max");if(e===null)return 100;const t=parseFloat(e);return Number.isFinite(t)?t:100}_readValue(e){const t=parseFloat(this.getAttribute("value")??"0");return!Number.isFinite(t)||t<0?0:t>e?e:t}};pe.props=["value","max","indeterminate","tone","label","showPercent"],pe.styles=[ds],pe.help=void 0;let Ue=pe;S("os-progress-bar",Ue);const us=b`:host{display:block;position:relative;color:var( --os-ui-fg,#1d2327 );font-family:var( --os-ui-font,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif );font-size:12px}.head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-block-end:6px}:host(:not( [legend] ):not( [heading] ) ) .head{display:none}.heading{margin:0;font-size:13px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.heading[hidden]{display:none}.legend{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-inline-start:auto}:host(:not( [legend] ) ) .legend{display:none}.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:999px;background:transparent;color:var( --os-ui-fg-muted,#646970 );font:inherit;cursor:pointer;transition:opacity 0.12s ease,border-color 0.12s ease}.chip[aria-pressed='false']{opacity:0.45}.chip:hover{border-color:var( --os-ui-border-strong,#8c8f94 );color:var( --os-ui-fg,#1d2327 )}.chip:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:1px}.count{font-variant-numeric:tabular-nums;color:var( --os-ui-fg,#1d2327 )}.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;flex:none}.swatch,.seg{background:var( --_tone );fill:var( --_tone )}[data-tone='danger']{--_tone:var( --os-ui-danger,#d63638 )}[data-tone='warning']{--_tone:var( --os-ui-warning,#dba617 )}[data-tone='info']{--_tone:var( --os-ui-info-fg,#72aee6 )}[data-tone='success']{--_tone:var( --os-ui-success,#00a32a )}[data-tone='accent']{--_tone:var( --os-ui-accent,#2271b1 )}[data-tone='neutral']{--_tone:var( --os-ui-fg-muted,#646970 )}.chart{position:relative}svg{display:block;inline-size:100%}.grid{stroke:var( --os-ui-border,#dcdcde );stroke-width:1}.tick{fill:var( --os-ui-fg-muted,#646970 );font-size:10px;font-variant-numeric:tabular-nums}.hit{fill:transparent;cursor:crosshair}.hover{fill:var( --os-ui-surface-raised,rgba( 0,0,0,0.04 ) );pointer-events:none}.empty{padding:40px 0;text-align:center;font-size:13px;color:var( --os-ui-fg-muted,#646970 )}.tooltip{position:absolute;inset-block-start:4px;transform:translateX( -50% );min-inline-size:150px;padding:8px 10px;border-radius:6px;border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-elevated,#fff );box-shadow:var( --os-ui-shadow,0 2px 8px rgba( 0,0,0,0.15 ) );pointer-events:none;z-index:2}.tooltip[hidden]{display:none}.tooltip-head{margin-block-end:6px;color:var( --os-ui-fg-muted,#646970 );font-size:11px}.tooltip-row{display:flex;align-items:center;gap:6px;line-height:1.6}.tooltip-label{flex:1}.tooltip-value{font-variant-numeric:tabular-nums;font-weight:600}`,ps="http://www.w3.org/2000/svg",ee=8,hs=20,z=8,ms=40,fs=24,je=2,gs=150,bs=new Set(["danger","warning","info","success","accent","neutral"]);function zt(o,e){if(!o)return e;try{return JSON.parse(o)}catch{return e}}function vs(o){if(o<=5)return Math.max(1,o);const e=Math.pow(10,Math.floor(Math.log10(o)));for(const t of[1,2,5,10])if(t*e>=o)return t*e;return 10*e}function q(o,e){const t=document.createElementNS(ps,o);for(const[s,i]of Object.entries(e))t.setAttribute(s,i);return t}function _s(o,e,t,s){const i=Math.min(3,s/2,t/2);return`M ${o} ${e+s} L ${o} ${e+i} Q ${o} ${e} ${o+i} ${e} L ${o+t-i} ${e} Q ${o+t} ${e} ${o+t} ${e+i} L ${o+t} ${e+s} Z`}const he=class he extends w{constructor(){super(...arguments),this._resize=null,this._tooltip=null}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<"u"&&(this._resize=new ResizeObserver(()=>this.paint()),this._resize.observe(this))}disconnectedCallback(){this._resize?.disconnect(),this._resize=null}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this.paint())}get seriesList(){const e=zt(this.getAttribute("series"),[]);return Array.isArray(e)?e.filter(t=>!!t&&typeof t=="object"&&typeof t.key=="string").map(t=>({key:t.key,label:typeof t.label=="string"?t.label:t.key,tone:t.tone&&bs.has(t.tone)?t.tone:"neutral"})):[]}get columnList(){const e=zt(this.getAttribute("columns"),[]);return Array.isArray(e)?e.map(t=>Array.isArray(t)?t.map(s=>Number.isFinite(Number(s))?Math.max(0,Number(s)):0):[]):[]}get hiddenSet(){return new Set((this.getAttribute("hidden-series")??"").split(",").map(e=>e.trim()).filter(e=>e!==""))}totals(){const e=this.seriesList,t=e.map(()=>0);for(const s of this.columnList)e.forEach((i,n)=>{t[n]+=s[n]??0});return t}toggleSeries(e){const t=this.hiddenSet;t.has(e)?t.delete(e):t.add(e);const s=Array.from(t);s.length>0?this.setAttribute("hidden-series",s.join(",")):this.removeAttribute("hidden-series"),this.emit("os-series-toggle",{key:e,hidden:s})}render(){const e=this.seriesList,t=this.totals(),s=this.hiddenSet,i=this.getAttribute("heading")??"";return h`
164 + </div>`}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this._paint())}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._paint())}_paint(){const e=this.shadowRoot;if(!e)return;const t=this._readMax(),s=this.hasAttribute("indeterminate")||t<=0,i=s?0:this._readValue(t),n=s?0:i/t,r=Math.round(n*100),a=this.getAttribute("label")??"",c=this.hasAttribute("show-percent"),d=e.querySelector(".fill");d&&!s?d.style.width=`${(n*100).toFixed(2)}%`:d&&s&&d.style.removeProperty("width");const p=e.querySelector(".header"),u=e.querySelector(".label"),m=e.querySelector(".percent");if(p&&u&&m){const g=a||c&&!s;p.hidden=!g,u.textContent=a,m.hidden=!(c&&!s),m.textContent=`${r}%`}this._syncAria(t,i,s,a);const f=e.querySelector(".track");f&&(f.setAttribute("role","progressbar"),f.setAttribute("aria-valuemin","0"),s?(f.removeAttribute("aria-valuenow"),f.removeAttribute("aria-valuemax")):(f.setAttribute("aria-valuemax",String(t)),f.setAttribute("aria-valuenow",String(i))),a?f.setAttribute("aria-label",a):f.removeAttribute("aria-label"))}_syncAria(e,t,s,i){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),s?(this.removeAttribute("aria-valuenow"),this.removeAttribute("aria-valuemax")):(this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(t)));const n=this.getAttribute("aria-label");i?(n===null||n===this._ownedAriaLabel)&&(this.setAttribute("aria-label",i),this._ownedAriaLabel=i):n!==null&&n===this._ownedAriaLabel&&(this.removeAttribute("aria-label"),this._ownedAriaLabel=null)}_readMax(){const e=this.getAttribute("max");if(e===null)return 100;const t=parseFloat(e);return Number.isFinite(t)?t:100}_readValue(e){const t=parseFloat(this.getAttribute("value")??"0");return!Number.isFinite(t)||t<0?0:t>e?e:t}};pe.props=["value","max","indeterminate","tone","label","showPercent"],pe.styles=[hs],pe.help=void 0;let Be=pe;S("os-progress-bar",Be);const ms=b`:host{display:block;position:relative;color:var( --os-ui-fg,#1d2327 );font-family:var( --os-ui-font,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif );font-size:12px}.head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-block-end:6px}:host(:not( [legend] ):not( [heading] ) ) .head{display:none}.heading{margin:0;font-size:13px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.heading[hidden]{display:none}.legend{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-inline-start:auto}:host(:not( [legend] ) ) .legend{display:none}.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:999px;background:transparent;color:var( --os-ui-fg-muted,#646970 );font:inherit;cursor:pointer;transition:opacity 0.12s ease,border-color 0.12s ease}.chip[aria-pressed='false']{opacity:0.45}.chip:hover{border-color:var( --os-ui-border-strong,#8c8f94 );color:var( --os-ui-fg,#1d2327 )}.chip:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:1px}.count{font-variant-numeric:tabular-nums;color:var( --os-ui-fg,#1d2327 )}.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;flex:none}.swatch,.seg{background:var( --_tone );fill:var( --_tone )}[data-tone='danger']{--_tone:var( --os-ui-danger,#d63638 )}[data-tone='warning']{--_tone:var( --os-ui-warning,#dba617 )}[data-tone='info']{--_tone:var( --os-ui-info-fg,#72aee6 )}[data-tone='success']{--_tone:var( --os-ui-success,#00a32a )}[data-tone='accent']{--_tone:var( --os-ui-accent,#2271b1 )}[data-tone='neutral']{--_tone:var( --os-ui-fg-muted,#646970 )}.chart{position:relative}svg{display:block;inline-size:100%}.grid{stroke:var( --os-ui-border,#dcdcde );stroke-width:1}.tick{fill:var( --os-ui-fg-muted,#646970 );font-size:10px;font-variant-numeric:tabular-nums}.hit{fill:transparent;cursor:crosshair}.hover{fill:var( --os-ui-surface-raised,rgba( 0,0,0,0.04 ) );pointer-events:none}.empty{padding:40px 0;text-align:center;font-size:13px;color:var( --os-ui-fg-muted,#646970 )}.tooltip{position:absolute;inset-block-start:4px;transform:translateX( -50% );min-inline-size:150px;padding:8px 10px;border-radius:6px;border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-elevated,#fff );box-shadow:var( --os-ui-shadow,0 2px 8px rgba( 0,0,0,0.15 ) );pointer-events:none;z-index:2}.tooltip[hidden]{display:none}.tooltip-head{margin-block-end:6px;color:var( --os-ui-fg-muted,#646970 );font-size:11px}.tooltip-row{display:flex;align-items:center;gap:6px;line-height:1.6}.tooltip-label{flex:1}.tooltip-value{font-variant-numeric:tabular-nums;font-weight:600}`,fs="http://www.w3.org/2000/svg",ee=8,gs=20,z=8,bs=40,vs=24,Ke=2,_s=150,ys=new Set(["danger","warning","info","success","accent","neutral"]);function Lt(o,e){if(!o)return e;try{return JSON.parse(o)}catch{return e}}function xs(o){if(o<=5)return Math.max(1,o);const e=Math.pow(10,Math.floor(Math.log10(o)));for(const t of[1,2,5,10])if(t*e>=o)return t*e;return 10*e}function q(o,e){const t=document.createElementNS(fs,o);for(const[s,i]of Object.entries(e))t.setAttribute(s,i);return t}function ks(o,e,t,s){const i=Math.min(3,s/2,t/2);return`M ${o} ${e+s} L ${o} ${e+i} Q ${o} ${e} ${o+i} ${e} L ${o+t-i} ${e} Q ${o+t} ${e} ${o+t} ${e+i} L ${o+t} ${e+s} Z`}const he=class he extends w{constructor(){super(...arguments),this._resize=null,this._tooltip=null}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<"u"&&(this._resize=new ResizeObserver(()=>this.paint()),this._resize.observe(this))}disconnectedCallback(){this._resize?.disconnect(),this._resize=null}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this.paint())}get seriesList(){const e=Lt(this.getAttribute("series"),[]);return Array.isArray(e)?e.filter(t=>!!t&&typeof t=="object"&&typeof t.key=="string").map(t=>({key:t.key,label:typeof t.label=="string"?t.label:t.key,tone:t.tone&&ys.has(t.tone)?t.tone:"neutral"})):[]}get columnList(){const e=Lt(this.getAttribute("columns"),[]);return Array.isArray(e)?e.map(t=>Array.isArray(t)?t.map(s=>Number.isFinite(Number(s))?Math.max(0,Number(s)):0):[]):[]}get hiddenSet(){return new Set((this.getAttribute("hidden-series")??"").split(",").map(e=>e.trim()).filter(e=>e!==""))}totals(){const e=this.seriesList,t=e.map(()=>0);for(const s of this.columnList)e.forEach((i,n)=>{t[n]+=s[n]??0});return t}toggleSeries(e){const t=this.hiddenSet;t.has(e)?t.delete(e):t.add(e);const s=Array.from(t);s.length>0?this.setAttribute("hidden-series",s.join(",")):this.removeAttribute("hidden-series"),this.emit("os-series-toggle",{key:e,hidden:s})}render(){const e=this.seriesList,t=this.totals(),s=this.hiddenSet,i=this.getAttribute("heading")??"";return h`
164 165 <div class="head" part="head">
165 166 <h2 class="heading" part="heading" ?hidden=${i===""}>${i}</h2>
166 167 <div class="legend" part="legend" role="group">
167 - ${e.map((n,a)=>h`
168 + ${e.map((n,r)=>h`
168 169 <button
169 170 type="button"
170 171 class="chip"
171 172 data-tone=${n.tone??"neutral"}
@@ -173,9 +174,9 @@
173 174 @click=${()=>this.toggleSeries(n.key)}
174 175 >
175 176 <span class="swatch"></span>
176 177 <span class="label">${n.label}</span>
177 - <span class="count">${t[a].toLocaleString()}</span>
178 + <span class="count">${t[r].toLocaleString()}</span>
178 179 </button>
179 180 `)}
180 181 </div>
181 182 </div>
@@ -180,9 +181,9 @@
180 181 </div>
181 182 </div>
182 183 <div class="chart" part="chart"></div>
183 184 <div class="tooltip" part="tooltip" hidden></div>
184 - `}paint(){const e=this.shadowRoot,t=e?.querySelector(".chart"),s=e?.querySelector(".tooltip");if(!t||!s)return;this._tooltip=s,s.hidden=!0,t.textContent="";const i=this.columnList,n=i.some(_=>_.some(k=>k>0));if(i.length===0||!n){const _=document.createElement("div");_.className="empty",_.textContent=this.getAttribute("empty")??"",t.appendChild(_);return}const a=this.seriesList,r=this.hiddenSet,c=a.map((_,k)=>r.has(_.key)?-1:k).filter(_=>_>=0),d=parseInt(this.getAttribute("height")??"",10),p=Number.isFinite(d)&&d>40?d:gs,u=Math.max(280,this.clientWidth||640),m=u-z-ms,f=p-ee-hs,g=i.length,v=m/g,y=Math.max(2,Math.min(fs,v-je)),L=i.reduce((_,k)=>{const N=c.reduce((P,Ae)=>P+(k[Ae]??0),0);return Math.max(_,N)},0),A=vs(L),T=f/A,C=q("svg",{width:String(u),height:String(p),viewBox:`0 0 ${u} ${p}`,role:"img"});for(const _ of[0,.5,1]){const k=A*_,N=ee+f-k*T;C.appendChild(q("line",{class:"grid",x1:String(z),y1:String(N),x2:String(z+m),y2:String(N)}));const P=q("text",{class:"tick",x:String(z+m+6),y:String(N+3.5)});P.textContent=Number.isInteger(k)?k.toLocaleString():String(k),C.appendChild(P)}const H=Number(this.getAttribute("start"))||0,$e=Number(this.getAttribute("end"))||H+g,qt=Math.max(1,($e-H)/g),Fs=$e-H>36*3600,Dt=_=>new Date(_*1e3).toLocaleString([],Fs?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"}),Ws=_=>new Date(_*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Hs=[[H,z,"start"],[H+($e-H)/2,z+m/2,"middle"],[$e,z+m,"end"]];for(const[_,k,N]of Hs){const P=q("text",{class:"tick",x:String(k),y:String(p-5),"text-anchor":N});P.textContent=Dt(_),C.appendChild(P)}const Se=q("rect",{class:"hover",y:String(ee),width:String(v),height:String(f),visibility:"hidden"});C.appendChild(Se),i.forEach((_,k)=>{const N=z+k*v+(v-y)/2;let P=ee+f;const Ae=c.filter(ge=>(_[ge]??0)>0),Os=Ae[Ae.length-1];for(const ge of c){const Ft=_[ge]??0;if(Ft===0)continue;const Wt=a[ge].tone??"neutral",Ze=Ft*T,Je=P-Ze;ge===Os?C.appendChild(q("path",{class:"seg","data-tone":Wt,d:_s(N,Je,y,Math.max(1.5,Ze))})):C.appendChild(q("rect",{class:"seg","data-tone":Wt,x:String(N),y:String(Je+je),width:String(y),height:String(Math.max(1.5,Ze-je))})),P=Je}const Ge=q("rect",{class:"hit",x:String(z+k*v),y:String(ee),width:String(v),height:String(f)});Ge.addEventListener("pointerenter",()=>{Se.setAttribute("x",String(z+k*v)),Se.setAttribute("visibility","visible"),this.showTooltip(k,_,v,u,{head:`${Ws(H+k*qt)} – ${Dt(H+(k+1)*qt)}`,series:a,visibleIndexes:c})}),Ge.addEventListener("pointerleave",()=>{Se.setAttribute("visibility","hidden"),s.hidden=!0}),C.appendChild(Ge)}),t.appendChild(C)}showTooltip(e,t,s,i,n){const a=this._tooltip;if(!a)return;a.textContent="";const r=document.createElement("div");r.className="tooltip-head",r.textContent=n.head,a.appendChild(r);let c=0;for(const p of[...n.visibleIndexes].reverse()){const u=t[p]??0;if(u===0)continue;c++;const m=document.createElement("div");m.className="tooltip-row";const f=document.createElement("span");f.className="swatch",f.dataset.tone=n.series[p].tone??"neutral";const g=document.createElement("span");g.className="tooltip-label",g.textContent=n.series[p].label;const v=document.createElement("span");v.className="tooltip-value",v.textContent=u.toLocaleString(),m.append(f,g,v),a.appendChild(m)}if(c===0){const p=document.createElement("div");p.className="tooltip-row",p.textContent="—",a.appendChild(p)}a.hidden=!1;const d=z+e*s+s/2;a.style.left=`${Math.max(60,Math.min(d,i-60))}px`}};he.props=["heading","series","columns","start","end","hidden-series","legend","empty","height"],he.styles=[us],he.help=void 0;let Be=he;S("os-histogram",Be);const ys=b` ${I}:host{display:inline-flex;position:relative;padding:3px;background:var( --os-ui-segmented-bg,var( --os-ui-hover,rgba( 0,0,0,0.05 ) ) );border-radius:8px;gap:2px}.os-segmented__thumb{position:absolute;top:3px;bottom:3px;left:0;width:var( --_thumb-w,0px );border-radius:6px;background-color:var( --os-ui-segmented-selected-bg,var( --os-ui-accent,#2271b1 ) );background-image:var( --os-ui-segmented-selected-image,none );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;transform:translateX( var( --_thumb-x,0px ) );pointer-events:none;opacity:0}:host( [ data-thumb ] ) .os-segmented__thumb{opacity:1}:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition:transform var( --_holo-t-slow ) var( --_holo-spring ),width var( --_holo-t-slow ) var( --_holo-ease ),opacity var( --_holo-t-fast ) linear}@media ( prefers-reduced-motion:reduce ){:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition-duration:1ms}}`,xs=b` ${I} ${Re}:host{flex:1 1 auto;min-width:0}button{appearance:none;display:block;width:100%;padding:6px 13px;background:transparent;border:0;font:inherit;font-size:13px;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:6px;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,background-position var( --_holo-t ) ease;white-space:nowrap}button:hover{color:var( --os-ui-fg,#1d2327 )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}:host( [ aria-checked='true' ] ) button{color:var( --os-ui-segmented-selected-fg,var( --os-ui-fg-on-accent,#fff ) );transition-duration:var( --_holo-t-fast )}:host( [ aria-checked='true' ] ) button::before{display:none}`,me=class me extends w{render(){return this.setAttribute("role","radio"),h`
185 + `}paint(){const e=this.shadowRoot,t=e?.querySelector(".chart"),s=e?.querySelector(".tooltip");if(!t||!s)return;this._tooltip=s,s.hidden=!0,t.textContent="";const i=this.columnList,n=i.some(y=>y.some(k=>k>0));if(i.length===0||!n){const y=document.createElement("div");y.className="empty",y.textContent=this.getAttribute("empty")??"",t.appendChild(y);return}const r=this.seriesList,a=this.hiddenSet,c=r.map((y,k)=>a.has(y.key)?-1:k).filter(y=>y>=0),d=parseInt(this.getAttribute("height")??"",10),p=Number.isFinite(d)&&d>40?d:_s,u=Math.max(280,this.clientWidth||640),m=u-z-bs,f=p-ee-gs,g=i.length,_=m/g,v=Math.max(2,Math.min(vs,_-Ke)),L=i.reduce((y,k)=>{const N=c.reduce((P,Ce)=>P+(k[Ce]??0),0);return Math.max(y,N)},0),A=xs(L),T=f/A,C=q("svg",{width:String(u),height:String(p),viewBox:`0 0 ${u} ${p}`,role:"img"});for(const y of[0,.5,1]){const k=A*y,N=ee+f-k*T;C.appendChild(q("line",{class:"grid",x1:String(z),y1:String(N),x2:String(z+m),y2:String(N)}));const P=q("text",{class:"tick",x:String(z+m+6),y:String(N+3.5)});P.textContent=Number.isInteger(k)?k.toLocaleString():String(k),C.appendChild(P)}const H=Number(this.getAttribute("start"))||0,Se=Number(this.getAttribute("end"))||H+g,Wt=Math.max(1,(Se-H)/g),Us=Se-H>36*3600,Ht=y=>new Date(y*1e3).toLocaleString([],Us?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"}),js=y=>new Date(y*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Bs=[[H,z,"start"],[H+(Se-H)/2,z+m/2,"middle"],[Se,z+m,"end"]];for(const[y,k,N]of Bs){const P=q("text",{class:"tick",x:String(k),y:String(p-5),"text-anchor":N});P.textContent=Ht(y),C.appendChild(P)}const Ae=q("rect",{class:"hover",y:String(ee),width:String(_),height:String(f),visibility:"hidden"});C.appendChild(Ae),i.forEach((y,k)=>{const N=z+k*_+(_-v)/2;let P=ee+f;const Ce=c.filter(ge=>(y[ge]??0)>0),Ks=Ce[Ce.length-1];for(const ge of c){const Ot=y[ge]??0;if(Ot===0)continue;const Ut=r[ge].tone??"neutral",Qe=Ot*T,et=P-Qe;ge===Ks?C.appendChild(q("path",{class:"seg","data-tone":Ut,d:ks(N,et,v,Math.max(1.5,Qe))})):C.appendChild(q("rect",{class:"seg","data-tone":Ut,x:String(N),y:String(et+Ke),width:String(v),height:String(Math.max(1.5,Qe-Ke))})),P=et}const Je=q("rect",{class:"hit",x:String(z+k*_),y:String(ee),width:String(_),height:String(f)});Je.addEventListener("pointerenter",()=>{Ae.setAttribute("x",String(z+k*_)),Ae.setAttribute("visibility","visible"),this.showTooltip(k,y,_,u,{head:`${js(H+k*Wt)} – ${Ht(H+(k+1)*Wt)}`,series:r,visibleIndexes:c})}),Je.addEventListener("pointerleave",()=>{Ae.setAttribute("visibility","hidden"),s.hidden=!0}),C.appendChild(Je)}),t.appendChild(C)}showTooltip(e,t,s,i,n){const r=this._tooltip;if(!r)return;r.textContent="";const a=document.createElement("div");a.className="tooltip-head",a.textContent=n.head,r.appendChild(a);let c=0;for(const p of[...n.visibleIndexes].reverse()){const u=t[p]??0;if(u===0)continue;c++;const m=document.createElement("div");m.className="tooltip-row";const f=document.createElement("span");f.className="swatch",f.dataset.tone=n.series[p].tone??"neutral";const g=document.createElement("span");g.className="tooltip-label",g.textContent=n.series[p].label;const _=document.createElement("span");_.className="tooltip-value",_.textContent=u.toLocaleString(),m.append(f,g,_),r.appendChild(m)}if(c===0){const p=document.createElement("div");p.className="tooltip-row",p.textContent="—",r.appendChild(p)}r.hidden=!1;const d=z+e*s+s/2;r.style.left=`${Math.max(60,Math.min(d,i-60))}px`}};he.props=["heading","series","columns","start","end","hidden-series","legend","empty","height"],he.styles=[ms],he.help=void 0;let Ve=he;S("os-histogram",Ve);const ws=b` ${I}:host{display:inline-flex;position:relative;padding:3px;background:var( --os-ui-segmented-bg,var( --os-ui-hover,rgba( 0,0,0,0.05 ) ) );border-radius:8px;gap:2px;box-shadow:var( --os-ui-segmented-edge,none )}.os-segmented__thumb{position:absolute;top:3px;bottom:3px;left:0;width:var( --_thumb-w,0px );border-radius:6px;background-color:var( --os-ui-segmented-selected-bg,color-mix( in srgb,var( --os-ui-accent,#2271b1 ) var( --os-ui-segmented-selected-accent,100% ),var( --os-ui-segmented-selected-base,var( --os-ui-surface,#fff ) ) ) );background-image:var( --os-ui-segmented-selected-image,none );box-shadow:var( --os-ui-segmented-selected-shadow,none );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;transform:translateX( var( --_thumb-x,0px ) );pointer-events:none;opacity:0}:host( [ data-thumb ] ) .os-segmented__thumb{opacity:1}:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition:transform var( --_holo-t-slow ) var( --_holo-spring ),width var( --_holo-t-slow ) var( --_holo-ease ),opacity var( --_holo-t-fast ) linear}@media ( prefers-reduced-motion:reduce ){:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition-duration:1ms}}`,$s=b` ${I} ${Le}:host{flex:1 1 auto;min-width:0;--_holo-sheen:var( --os-ui-segmented-hover-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% ) ) )}button{appearance:none;display:block;width:100%;padding:6px 13px;background:transparent;border:0;font:inherit;font-size:13px;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:6px;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,background-position var( --_holo-t ) ease;white-space:nowrap}button:hover{color:var( --os-ui-fg,#1d2327 )}:host(:not( [ aria-checked='true' ] ) ) button:hover{background-color:var( --os-ui-segmented-hover-bg,transparent )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}:host( [ aria-checked='true' ] ) button{color:var( --os-ui-segmented-selected-fg,color-mix( in srgb,var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) ) var( --os-ui-segmented-selected-accent,100% ),var( --os-ui-fg,#1d2327 ) ) );transition-duration:var( --_holo-t-fast )}:host( [ aria-checked='true' ] ) button::before{display:none}`,me=class me extends w{render(){return this.setAttribute("role","radio"),h`
185 186 <button
186 187 type="button"
187 188 class="os-holo-sheen"
188 189 @click=${()=>this._onPick()}
@@ -188,29 +189,29 @@
188 189 @click=${()=>this._onPick()}
189 190 >
190 191 <slot></slot>
191 192 </button>
192 - `}_onPick(){this.emit("os-segment-pick",{value:this.value})}};me.props=["value"],me.styles=[xs],me.help=void 0;let Ve=me;S("os-segment",Ve);const fe=class fe extends w{constructor(){super(...arguments),this._resizeObserver=null}connectedCallback(){super.connectedCallback(),this.addEventListener("os-segment-pick",e=>{const t=e.detail;e.stopPropagation(),this.value=t.value,this.emit("os-pick",{value:t.value})}),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._placeThumb()),this._resizeObserver.observe(this))}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null}_placeThumb(){if(!this.shadowRoot?.querySelector(".os-segmented__thumb"))return;const t=this.value,s=Array.from(this.querySelectorAll(":scope > os-segment")).find(d=>d.getAttribute("value")===t);if(!s||this.offsetWidth===0){this.removeAttribute("data-thumb");return}const i=this.getBoundingClientRect(),n=i.width/this.offsetWidth,a=Math.abs(n-1)<.02?1:n;if(!(a>0))return;const r=s.getBoundingClientRect(),c=d=>`${Math.round(d*100)/100}px`;this.style.setProperty("--_thumb-x",c((r.left-i.left)/a)),this.style.setProperty("--_thumb-w",c(r.width/a)),this.setAttribute("data-thumb",""),this.hasAttribute("data-thumb-ready")||requestAnimationFrame(()=>this.setAttribute("data-thumb-ready",""))}set items(e){const t=this.querySelectorAll(":scope > os-segment");for(const n of Array.from(t))n.remove();for(const n of e){const a=document.createElement("os-segment");a.setAttribute("value",n.value),a.textContent=n.label,this.appendChild(a)}const s=this.value;!(s!==null&&e.some(n=>n.value===s))&&e.length>0?this.value=e[0].value:this.requestUpdate()}render(){const e=this.label||"";e&&this.setAttribute("aria-label",e),this.setAttribute("role","radiogroup");const t=this.value;return queueMicrotask(()=>{const s=this.querySelectorAll("os-segment");for(const i of Array.from(s)){const n=i.getAttribute("value");i.setAttribute("aria-checked",n===t?"true":"false")}this._placeThumb()}),h`<span class="os-segmented__thumb" aria-hidden="true"></span
193 - ><slot></slot>`}};fe.props=["value","label"],fe.styles=[ys],fe.help={title:"Segmented",summary:"iOS-style segmented radio group. Pill-shaped bar of equal-width <os-segment> children where exactly one is active.",status:"stable",props:[{name:"value",type:"string",description:"Currently selected segment value. Mirrored onto child aria-checked."},{name:"label",type:"string",description:"aria-label for the radiogroup."}],slots:[{name:"(default)",description:'<os-segment value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the selected segment changes.",detail:"{ value: string }"}],cssProps:[{name:"--os-window-bg",description:"Pill background."},{name:"--os-ui-fg",description:"Active label colour."},{name:"--os-ui-fg-muted",description:"Inactive label colour."}],example:h`
193 + `}_onPick(){this.emit("os-segment-pick",{value:this.value})}};me.props=["value"],me.styles=[$s],me.help=void 0;let Ye=me;S("os-segment",Ye);const fe=class fe extends w{constructor(){super(...arguments),this._resizeObserver=null}connectedCallback(){super.connectedCallback(),this.addEventListener("os-segment-pick",e=>{const t=e.detail;e.stopPropagation(),this.value=t.value,this.emit("os-pick",{value:t.value})}),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._placeThumb()),this._resizeObserver.observe(this))}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null}_placeThumb(){if(!this.shadowRoot?.querySelector(".os-segmented__thumb"))return;const t=this.value,s=Array.from(this.querySelectorAll(":scope > os-segment")).find(d=>d.getAttribute("value")===t);if(!s||this.offsetWidth===0){this.removeAttribute("data-thumb");return}const i=this.getBoundingClientRect(),n=i.width/this.offsetWidth,r=Math.abs(n-1)<.02?1:n;if(!(r>0))return;const a=s.getBoundingClientRect(),c=d=>`${Math.round(d*100)/100}px`;this.style.setProperty("--_thumb-x",c((a.left-i.left)/r)),this.style.setProperty("--_thumb-w",c(a.width/r)),this.setAttribute("data-thumb",""),this.hasAttribute("data-thumb-ready")||requestAnimationFrame(()=>this.setAttribute("data-thumb-ready",""))}set items(e){const t=this.querySelectorAll(":scope > os-segment");for(const n of Array.from(t))n.remove();for(const n of e){const r=document.createElement("os-segment");r.setAttribute("value",n.value),r.textContent=n.label,this.appendChild(r)}const s=this.value;!(s!==null&&e.some(n=>n.value===s))&&e.length>0?this.value=e[0].value:this.requestUpdate()}render(){const e=this.label||"";e&&this.setAttribute("aria-label",e),this.setAttribute("role","radiogroup");const t=this.value;return queueMicrotask(()=>{const s=this.querySelectorAll("os-segment");for(const i of Array.from(s)){const n=i.getAttribute("value");i.setAttribute("aria-checked",n===t?"true":"false")}this._placeThumb()}),h`<span class="os-segmented__thumb" aria-hidden="true"></span
194 + ><slot></slot>`}};fe.props=["value","label"],fe.styles=[ws],fe.help={title:"Segmented",summary:"iOS-style segmented radio group. Pill-shaped bar of equal-width <os-segment> children where exactly one is active.",status:"stable",props:[{name:"value",type:"string",description:"Currently selected segment value. Mirrored onto child aria-checked."},{name:"label",type:"string",description:"aria-label for the radiogroup."}],slots:[{name:"(default)",description:'<os-segment value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the selected segment changes.",detail:"{ value: string }"}],cssProps:[{name:"--os-window-bg",description:"Pill background."},{name:"--os-ui-fg",description:"Active label colour."},{name:"--os-ui-fg-muted",description:"Inactive label colour."}],example:h`
194 195 <os-segmented value="md" label="Dock size">
195 196 <os-segment value="sm">Small</os-segment>
196 197 <os-segment value="md">Medium</os-segment>
197 198 <os-segment value="lg">Large</os-segment>
198 199 </os-segmented>
199 - `};let Ke=fe;S("os-segmented",Ke);const j=864e5;function Y(o){const e=o.registered_date;return e?Date.parse(/(?:Z|[+-]\d\d:\d\d)$/i.test(e)?e:`${e}Z`):NaN}function E(o,e){const t=o.openstation_user_stats?.[e];return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function ks(o,e){return o.filter(t=>E(t,e)>0).sort((t,s)=>E(s,e)-E(t,e)||t.name.localeCompare(s.name)||t.id-s.id)}function ws(o,e=Date.now()){const t=o.filter(d=>d.openstation_user_stats),s={posts:0,pages:0,comments:0};for(const d of t)for(const p of["posts","pages","comments"])s[p]+=E(d,p);const i=o.filter(d=>Y(d)>0&&Y(d)<=e).sort((d,p)=>Y(p)-Y(d)),n=o.filter(d=>typeof d.openstation_last_login=="number"&&d.openstation_last_login>0&&d.openstation_last_login*1e3<=e).sort((d,p)=>p.openstation_last_login-d.openstation_last_login),a=Math.floor(e/j)*j+j,r=a-56*j,c=Array.from({length:8},()=>[0]);for(const d of i){const p=Math.floor((Y(d)-r)/(7*j));p>=0&&p<8&&c[p][0]++}return{totals:s,known:t.length,contributors:t.filter(d=>E(d,"posts")+E(d,"pages")+E(d,"comments")>0).length,online:o.filter(d=>d.openstation_presence==="online"),away:o.filter(d=>d.openstation_presence==="inactive"),unknownPresence:o.filter(d=>!["online","inactive","offline"].includes(d.openstation_presence||"")).length,recent:i.filter(d=>Y(d)>=e-30*j).length,registered:i,logins:n,active30:n.filter(d=>d.openstation_last_login*1e3>=e-30*j).length,unrecorded:o.length-n.length,start:r/1e3,end:a/1e3,weeks:c}}const R=o=>o.toLocaleString(),Et=o=>({posts:l("Posts"),pages:l("Pages"),comments:l("Comments")})[o];function te(o,e){return h`<os-button variant="ghost" class="os-community__person" @click=${()=>Q(o.id,e)}>${o.name||o.slug}</os-button>`}function ke(o,e,t,s){return h`<article class="os-community__metric"><span class="dashicons ${s}" aria-hidden="true"></span><strong>${o}</strong><div><h3>${e}</h3><p>${t}</p></div></article>`}function $s(o,e,t,s,i){const n=Array.isArray(o)?{...ws(o),total:o.length,onlineCount:o.filter(u=>u.openstation_presence==="online").length,awayCount:o.filter(u=>u.openstation_presence==="inactive").length}:o,a=Array.isArray(o)?ks(o,s):o.leaders[s],r=a[0],c=[...n.online,...n.away],d=r?E(r,s):1,p=n.totals.posts+n.totals.pages;return h`<div class="os-community">
200 + `};let Xe=fe;S("os-segmented",Xe);const j=864e5;function Y(o){const e=o.registered_date;return e?Date.parse(/(?:Z|[+-]\d\d:\d\d)$/i.test(e)?e:`${e}Z`):NaN}function E(o,e){const t=o.openstation_user_stats?.[e];return typeof t=="number"&&Number.isFinite(t)&&t>0?t:0}function Ss(o,e){return o.filter(t=>E(t,e)>0).sort((t,s)=>E(s,e)-E(t,e)||t.name.localeCompare(s.name)||t.id-s.id)}function As(o,e=Date.now()){const t=o.filter(d=>d.openstation_user_stats),s={posts:0,pages:0,comments:0};for(const d of t)for(const p of["posts","pages","comments"])s[p]+=E(d,p);const i=o.filter(d=>Y(d)>0&&Y(d)<=e).sort((d,p)=>Y(p)-Y(d)),n=o.filter(d=>typeof d.openstation_last_login=="number"&&d.openstation_last_login>0&&d.openstation_last_login*1e3<=e).sort((d,p)=>p.openstation_last_login-d.openstation_last_login),r=Math.floor(e/j)*j+j,a=r-56*j,c=Array.from({length:8},()=>[0]);for(const d of i){const p=Math.floor((Y(d)-a)/(7*j));p>=0&&p<8&&c[p][0]++}return{totals:s,known:t.length,contributors:t.filter(d=>E(d,"posts")+E(d,"pages")+E(d,"comments")>0).length,online:o.filter(d=>d.openstation_presence==="online"),away:o.filter(d=>d.openstation_presence==="inactive"),unknownPresence:o.filter(d=>!["online","inactive","offline"].includes(d.openstation_presence||"")).length,recent:i.filter(d=>Y(d)>=e-30*j).length,registered:i,logins:n,active30:n.filter(d=>d.openstation_last_login*1e3>=e-30*j).length,unrecorded:o.length-n.length,start:a/1e3,end:r/1e3,weeks:c}}const R=o=>o.toLocaleString(),Tt=o=>({posts:l("Posts"),pages:l("Pages"),comments:l("Comments")})[o];function te(o,e){return h`<os-button variant="ghost" class="os-community__person" @click=${()=>Q(o.id,e)}>${o.name||o.slug}</os-button>`}function we(o,e,t,s){return h`<article class="os-community__metric"><span class="dashicons ${s}" aria-hidden="true"></span><strong>${o}</strong><div><h3>${e}</h3><p>${t}</p></div></article>`}function Cs(o,e,t,s,i){const n=Array.isArray(o)?{...As(o),total:o.length,onlineCount:o.filter(u=>u.openstation_presence==="online").length,awayCount:o.filter(u=>u.openstation_presence==="inactive").length}:o,r=Array.isArray(o)?Ss(o,s):o.leaders[s],a=r[0],c=[...n.online,...n.away],d=a?E(a,s):1,p=n.totals.posts+n.totals.pages;return h`<div class="os-community">
200 201 <div class="os-community__metrics" aria-label=${l("Community overview")}>
201 - ${ke(R(n.onlineCount),l("Online now"),x(l("%d away at last refresh"),n.awayCount),"dashicons-admin-users")}
202 - ${ke(R(n.recent),l("New accounts"),l("Registered in the last 30 days"),"dashicons-welcome-add-page")}
203 - ${ke(R(n.active30),l("Checked in"),l("Latest sign-in within 30 days"),"dashicons-clock")}
204 - ${ke(n.known?R(n.contributors):"—",l("Contributors"),l("Published work or approved comments"),"dashicons-edit")}
202 + ${we(R(n.onlineCount),l("Online now"),x(l("%d away at last refresh"),n.awayCount),"dashicons-admin-users")}
203 + ${we(R(n.recent),l("New accounts"),l("Registered in the last 30 days"),"dashicons-welcome-add-page")}
204 + ${we(R(n.active30),l("Checked in"),l("Latest sign-in within 30 days"),"dashicons-clock")}
205 + ${we(n.known?R(n.contributors):"—",l("Contributors"),l("Published work or approved comments"),"dashicons-edit")}
205 206 </div>
206 207 <div class="os-community__grid">
207 208 <section class="os-community__panel os-community__work">
208 209 <header><div><span class="os-community__eyebrow">${l("MADE BY YOUR PEOPLE")}</span><h3>${l("The work we share")}</h3></div><span class="os-community__stamp" aria-hidden="true">↗</span></header>
209 210 <div class="os-community__totals"><div><strong>${n.known?R(p):"—"}</strong><span>${l("published pieces")}</span></div><p>${x(l("%1$s posts · %2$s pages · %3$s approved comments"),n.known?R(n.totals.posts):"—",n.known?R(n.totals.pages):"—",n.known?R(n.totals.comments):"—")}</p></div>
210 - <os-segmented label=${l("Rank contributions by")} value=${s} @os-pick=${u=>{const m=u.detail.value;["posts","pages","comments"].includes(m)&&i(m)}}>${["posts","pages","comments"].map(u=>h`<os-segment value=${u}>${Et(u)}</os-segment>`)}</os-segmented>
211 - ${r?h`<div class="os-community__spotlight">${U(r,58)}<div><span class="os-community__eyebrow">${l("LEADING THIS COMMUNITY")}</span>${te(r,e)}<p>${r.roles.map(u=>t.allRoles?.[u]||u).join(" · ")}</p></div><strong>${R(E(r,s))}<small>${Et(s)}</small></strong></div>`:h`<p class="os-community__empty">${l("No contributions of this kind yet.")}</p>`}
212 - <ol class="os-community__leaders" start="2">${a.slice(1,6).map((u,m)=>h`<li><span class="os-community__rank">${m+2}</span>${U(u,30)}<div>${te(u,e)}<div class="os-community__track" aria-hidden="true"><i style=${`inline-size:${E(u,s)/d*100}%`}></i></div></div><strong>${R(E(u,s))}</strong></li>`)}</ol>
211 + <os-segmented label=${l("Rank contributions by")} value=${s} @os-pick=${u=>{const m=u.detail.value;["posts","pages","comments"].includes(m)&&i(m)}}>${["posts","pages","comments"].map(u=>h`<os-segment value=${u}>${Tt(u)}</os-segment>`)}</os-segmented>
212 + ${a?h`<div class="os-community__spotlight">${U(a,58)}<div><span class="os-community__eyebrow">${l("LEADING THIS COMMUNITY")}</span>${te(a,e)}<p>${a.roles.map(u=>t.allRoles?.[u]||u).join(" · ")}</p></div><strong>${R(E(a,s))}<small>${Tt(s)}</small></strong></div>`:h`<p class="os-community__empty">${l("No contributions of this kind yet.")}</p>`}
213 + <ol class="os-community__leaders" start="2">${r.slice(1,6).map((u,m)=>h`<li><span class="os-community__rank">${m+2}</span>${U(u,30)}<div>${te(u,e)}<div class="os-community__track" aria-hidden="true"><i style=${`inline-size:${E(u,s)/d*100}%`}></i></div></div><strong>${R(E(u,s))}</strong></li>`)}</ol>
213 214 <p class="os-community__footnote">${l("All-time published work and approved comments.")}${n.known<n.total?` ${x(l("Content counts are unavailable for %d profiles."),n.total-n.known)}`:""}</p>
214 215 </section>
215 216 <section class="os-community__panel os-community__presence-panel">
216 217 <header><div><span class="os-community__eyebrow">${l("AT LAST REFRESH")}</span><h3>${l("Around the station")}</h3></div><span class="os-community__status-dot" data-online=${n.onlineCount>0} aria-hidden="true"></span></header>
@@ -233,9 +234,9 @@
233 234 ${n.logins.length?"":h`<p class="os-community__empty">${l("No sign-ins recorded across this site yet.")}</p>`}
234 235 <p class="os-community__footnote">${x(l("%d profiles have no recorded sign-in. This is not a complete login history."),n.unrecorded)}</p>
235 236 </section>
236 237 </div>
237 - </div>`}const Ss=b` .os-community__loading{max-inline-size:520px;padding:48px 24px;margin:40px auto;text-align:center;color:var( --os-ui-fg,#1d2327 )}.os-community__loading>.dashicons{font-size:40px;inline-size:40px;block-size:40px;color:var( --os-ui-fg-muted,#646970 )}.os-community__loading h3{font-size:24px;font-weight:500;color:inherit}.os-community__loading p{font-size:12px;line-height:1.7;color:var( --os-ui-fg-muted,#646970 )}.os-community__loading os-progress-bar{display:block;margin-block:24px 12px}.os-community{padding:22px 24px 8px;max-inline-size:1440px;margin-inline:auto}.os-community__metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-block-end:20px}.os-community__metric{display:grid;grid-template-columns:auto 1fr;column-gap:14px;row-gap:8px;padding:18px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:14px;background:var( --os-ui-surface,#fff )}.os-community__metric>.dashicons{grid-column:1 / -1;color:var( --os-ui-fg-muted,#646970 );font-size:18px}.os-community__metric strong{font-size:38px;font-weight:500;line-height:1;letter-spacing:-.05em;font-variant-numeric:tabular-nums;align-self:center}.os-community__metric h3{margin:0 0 3px;font-size:12px;color:inherit}.os-community__metric p{margin:0;font-size:10px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-community__grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:20px;align-items:start}.os-community__panel{min-inline-size:0;padding:24px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:18px;background:var( --os-ui-surface,#fff )}.os-community__panel>header{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-block-end:16px}.os-community__panel h3{margin:5px 0 0;font-size:22px;font-weight:500;letter-spacing:-.035em;line-height:1.15;color:inherit}.os-community__eyebrow{font-size:9px;letter-spacing:.13em;color:var( --os-ui-fg-muted,#646970 )}.os-community__stamp{font-size:32px;font-weight:300;color:var( --os-ui-accent,#2271b1 )}.os-community__totals{margin-block:6px 18px}.os-community__totals>div{display:flex;align-items:baseline;gap:10px}.os-community__totals strong{font-size:clamp(40px,4.8cqi,60px);line-height:1;font-weight:500;letter-spacing:-.06em;font-variant-numeric:tabular-nums}.os-community__totals span{font-size:13px}.os-community__totals p,.os-community__description{font-size:11px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 );margin:9px 0 0}.os-community__work os-segmented{display:flex;margin-block-end:18px}.os-community__work os-segment{flex:1}.os-community__spotlight{display:flex;gap:14px;align-items:center;padding:18px;border-radius:12px;background:var( --os-ui-surface-sunken,#f6f7f7 );border-inline-start:3px solid var( --os-ui-accent,#2271b1 )}.os-community__spotlight>div{flex:1;min-inline-size:0}.os-community__person{display:block;max-inline-size:100%;--os-ui-button-padding:0}.os-community__person::part(button){padding:0;min-block-size:0;border:0;background:transparent;color:var( --os-ui-fg,#1d2327 );font-size:13px;font-weight:600;line-height:1.3;text-align:start;white-space:normal;overflow-wrap:anywhere}.os-community__spotlight .os-community__person{margin-block:4px}.os-community__spotlight .os-community__person::part(button){font-size:19px;letter-spacing:-.025em}.os-community__spotlight p{font-size:10px;color:var( --os-ui-fg-muted,#646970 );margin:0}.os-community__spotlight>strong{text-align:end;font-size:30px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums}.os-community__spotlight small{display:block;font-size:9px;font-weight:400;margin-block-start:6px;color:var( --os-ui-fg-muted,#646970 )}.os-community__leaders{list-style:none;padding:0;margin:12px 0}.os-community__leaders li{display:flex;gap:12px;align-items:center;padding-block:9px}.os-community__rank{inline-size:12px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );font-variant-numeric:tabular-nums}.os-community__leaders li>div{flex:1;min-inline-size:0}.os-community__leaders li>strong{font-size:15px;font-weight:500;font-variant-numeric:tabular-nums}.os-community__track{margin-block-start:6px;block-size:4px;border-radius:4px;overflow:hidden;background:var( --os-ui-surface-subtle,#f0f0f1 )}.os-community__track i{display:block;block-size:100%;border-radius:inherit;background:var( --os-ui-accent,#2271b1 )}.os-community__footnote{border-block-start:1px solid var( --os-ui-surface-subtle,#f0f0f1 );padding-block-start:12px;margin:16px 0 0;font-size:10px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-community__presence-panel{background:radial-gradient(ellipse at 100% 0,var( --os-ui-surface-subtle,#f0f0f1 ),transparent 70%),var( --os-ui-surface,#fff )}.os-community__status-dot{color:var( --os-ui-fg-muted,#646970 );inline-size:8px;block-size:8px;border-radius:50%;background:currentColor}.os-community__status-dot[data-online="true"]{color:var( --os-ui-success-fg,#008a20 )}.os-community__presence-summary{display:flex;gap:15px;align-items:center;margin-block:20px}.os-community__presence-summary>strong{display:grid;place-items:center;inline-size:90px;block-size:90px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%;box-shadow:inset 0 0 0 8px var( --os-ui-surface,#fff );background:var( --os-ui-surface-sunken,#f6f7f7 );font-size:40px;font-weight:500}.os-community__presence-summary p{font-size:16px;margin:0}.os-community__presence-summary span{display:block;font-size:11px;color:var( --os-ui-fg-muted,#646970 );margin-block-start:6px}.os-community__present{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.os-community__present>div,.os-community__newcomers>div{display:flex;align-items:center;gap:10px;min-inline-size:0}.os-community__present>div>div,.os-community__newcomers>div>div{min-inline-size:0}.os-community__present p,.os-community__newcomers p,.os-community__timeline p{font-size:10px;color:var( --os-ui-fg-muted,#646970 );margin:4px 0 0}.os-community__arrivals h4{margin:20px 0 12px;font-size:11px;font-weight:600;color:inherit}.os-community__arrivals os-histogram{display:block;margin-block-start:16px}.os-community__newcomers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.os-community__timeline{padding:0;margin:20px 0 0;list-style:none}.os-community__timeline li{position:relative;display:flex;gap:12px;align-items:center;padding-block-end:19px}.os-community__timeline li:not(:last-child)::before{content:'';position:absolute;inline-size:1px;inset-inline-start:16px;inset-block:34px 0;background:var( --os-ui-border,#dcdcde )}.os-community__timeline li>div{flex:1;min-inline-size:0}.os-community__login-mark{color:var( --os-ui-fg-muted,#646970 )}.os-community__empty{margin:24px 0;padding:16px;border:1px dashed var( --os-ui-border,#dcdcde );border-radius:10px;font-size:12px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}@container people (min-width:900px){.os-community__work{grid-column:1;grid-row:1 / 3}.os-community__presence-panel{grid-column:2;grid-row:1}.os-community__checkins{grid-column:2;grid-row:2 / 4}.os-community__arrivals{grid-column:1;grid-row:3}}@container people (max-width:899px){.os-community{padding:16px}.os-community__metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.os-community__grid{grid-template-columns:1fr;gap:14px}.os-community__presence-panel{grid-row:1}.os-community__present{grid-template-columns:repeat(3,minmax(0,1fr))}}@container people (max-width:480px){.os-community{padding:10px 12px}.os-community__metrics{gap:8px;margin-block-end:12px}.os-community__metric{gap:6px 10px;padding:12px}.os-community__metric>.dashicons{display:none}.os-community__metric strong{font-size:29px}.os-community__metric h3{font-size:11px}.os-community__metric p{font-size:9px}.os-community__panel{padding:17px;border-radius:14px}.os-community__panel h3{font-size:20px}.os-community__present,.os-community__newcomers{grid-template-columns:repeat(2,minmax(0,1fr))}.os-community__spotlight{gap:10px;padding:12px;flex-wrap:wrap}.os-community__spotlight .os-community__eyebrow{font-size:8px}.os-community__spotlight .os-community__person::part(button){font-size:16px}}`,As=b` .desktop-mode-users{container:people / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-users [hidden]{display:none !important}.os-people__hero{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:25px;background:var( --os-ui-surface,#fff )}.os-people__hero h2{color:inherit;margin:4px 0 8px;font-size:clamp(24px,3.4cqi,37px);font-weight:500;letter-spacing:-.045em;line-height:1.12}.os-people__eyebrow{font-size:10px;letter-spacing:.15em;color:var( --os-ui-fg-muted,#646970 )}.os-people__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-people__tools{display:flex;gap:9px;padding:10px 24px;align-items:center;flex-wrap:wrap;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-people__tools os-text-field{flex:1;min-inline-size:150px}.os-people__tools os-select{inline-size:140px}.os-people__options{display:none}.os-people__cards{flex:1;min-block-size:0;min-inline-size:0;overflow:auto;padding:20px 24px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,350px),1fr));gap:18px;align-content:start;overscroll-behavior:contain}.os-people__card{position:relative;isolation:isolate;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:10px;aspect-ratio:1.586;min-inline-size:0;border:1px solid var( --os-ui-border,#dcdcde );border-radius:15px;padding:14px 16px 8px;background:var( --os-ui-surface,#fff );box-shadow:0 2px 4px var( --os-ui-surface-subtle,#f0f0f1 )}.os-people__card::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:0;border-radius:inherit;background:repeating-radial-gradient(ellipse at 105% 15%,transparent 0 8px,var( --os-ui-surface-subtle,#f0f0f1 ) 9px 10px,transparent 11px 16px);opacity:.55;mask-image:linear-gradient(to left,#000,transparent 70%)}.os-people__card::after{content:'';position:absolute;pointer-events:none;inset-block:28px;inset-inline-start:0;inline-size:3px;background:var( --os-ui-accent,#2271b1 );border-start-end-radius:3px;border-end-end-radius:3px;opacity:.65}.os-people__card.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-2px}.os-people__id-header{display:flex;align-items:center;gap:8px;min-block-size:18px}.os-people__issuer{display:inline-flex;align-items:center;gap:5px;font-size:9px;font-weight:600;letter-spacing:.12em;color:var( --os-ui-fg,#1d2327 )}.os-people__issuer>span:last-child{font-weight:400;color:var( --os-ui-fg-muted,#646970 )}.os-people__issuer .dashicons{font-size:17px;inline-size:17px;block-size:17px}.os-people__you{font-size:10px;color:var( --os-ui-accent,#2271b1 )}.os-people__select{margin-inline-start:auto;inline-size:18px;block-size:18px;flex:0 0 18px}.os-people__identity{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:center;gap:16px}.os-people__portrait{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:10px 4px 7px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-people__member-number{font:9px/1.2 ui-monospace,monospace;letter-spacing:.13em;color:var( --os-ui-fg-muted,#646970 )}.os-people__credentials{min-inline-size:0}.os-people__identity h3{margin:0;font-size:20px;line-height:1.15;color:inherit}.os-people__identity h3 os-button{font:inherit;--os-ui-button-padding:0}.os-people__identity h3 os-button::part(button){font:inherit;text-align:start;border:0;background:transparent;padding:0;white-space:normal;overflow-wrap:anywhere}.os-people__identity p{margin:4px 0 0;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-people__handle{overflow-wrap:anywhere}.os-people__email{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-people__joined time{color:var( --os-ui-fg,#1d2327 )}.os-people__roles{display:flex;flex-wrap:wrap;gap:4px;margin-block:6px}.os-people__roles span{border:1px solid var( --os-ui-border,#dcdcde );border-radius:4px;padding:2px 6px;font-size:9px;color:var( --os-ui-fg-muted,#646970 );background:var( --os-ui-surface,#fff )}.os-people__stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) 28px;gap:8px;align-items:center;padding-block:7px 0;border-block-start:1px solid var( --os-ui-border,#dcdcde );--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:21px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-people__stats os-stat::part(label){font-size:8px}.os-people__seal{display:grid;place-items:center;inline-size:26px;block-size:26px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%;color:var( --os-ui-fg-muted,#646970 );opacity:.5}.os-people__seal .dashicons{font-size:16px;inline-size:16px;block-size:16px}.os-people__card>footer{display:flex;align-items:center;gap:8px;min-inline-size:0}.os-people__last-login{flex:1;min-inline-size:0;font-size:9px;color:var( --os-ui-fg-muted,#646970 )}.os-people__card os-action-menu{margin-inline-start:auto;flex:0 0 auto}.os-people__presence{display:inline-flex;align-items:center;gap:4px;font-size:9px;color:var( --os-ui-fg-muted,#646970 );white-space:nowrap}.os-people__presence::before{content:'';inline-size:5px;block-size:5px;border-radius:50%;background:currentColor}.os-people__presence[data-presence="online"]{color:var( --os-ui-success-fg,#008a20 )}.os-people__presence[data-presence="inactive"]{color:var( --os-ui-warning-fg,#996800 )}.os-people__continuation{grid-column:1 / -1;flex:0 0 auto;padding:14px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-people__empty{grid-column:1 / -1;padding:50px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-people__scope{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:8px 24px;font-size:11px;color:var( --os-ui-fg-muted,#646970 );border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-people__role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:20px;padding:24px}.os-people__room{border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );border-radius:18px;padding:24px;text-align:center;min-inline-size:0}.os-people__orbit{position:relative;inline-size:210px;block-size:210px;margin:12px auto 20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%}.os-people__orbit::before{content:'';position:absolute;inset:25px;border:1px dashed var( --os-ui-border,#dcdcde );border-radius:50%}.os-people__orbit-center{position:absolute;inset:45px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50%;background:var( --os-ui-surface-sunken,#f6f7f7 );gap:6px}.os-people__orbit-center strong{font-size:36px;font-weight:500;line-height:1}.os-people__orbit-center span{font-size:11px;max-inline-size:95px;overflow-wrap:anywhere;color:var( --os-ui-fg-muted,#646970 )}.os-people__satellite{position:absolute;transform:translate(-50%,-50%);background:var( --os-ui-surface,#fff );padding:3px;border-radius:50%}.os-people__room>p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );min-block-size:28px}.os-people__insights{flex:1;min-block-size:0;overflow:auto}.desktop-mode-users .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;max-block-size:38%;overflow:auto;align-content:start}.desktop-mode-users .os-app-list__bulk--footer .os-app-list__count{flex:0 0 auto}.desktop-mode-users .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:1}@container people (max-width:640px){.os-people__hero{padding:10px 12px;gap:10px}.os-people__hero h2{font-size:20px;margin:0}.os-people__hero p,.os-people__eyebrow{display:none}.os-people__tools{padding:7px 12px;gap:7px}.os-people__options{display:block}.os-people__tools:not(.is-expanded) .os-people__extra{display:none}.os-people__cards{display:block;padding:9px 12px}.os-people__card{aspect-ratio:auto;gap:7px;padding:10px 12px 5px;margin-block-end:10px}.os-people__identity{grid-template-columns:72px minmax(0,1fr);gap:12px}.os-people__portrait{padding:5px 2px;gap:4px}.os-people__identity h3{font-size:17px}.os-people__identity p{font-size:9px;margin-block-start:3px}.os-people__roles{margin-block:4px}.os-people__stats{--os-ui-stat-value-size:18px;padding-block-start:5px}.os-people__last-login{font-size:8px}.os-people__scope{padding:7px 12px}.os-people__role-grid{padding:12px}}`;function Cs(o){const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789!@#$%^&*-_=+",t=new Uint32Array(o);crypto.getRandomValues(t);let s="";for(let i=0;i<o;i+=1)s+=e[t[i]%e.length];return s}function Rt(o){return Object.entries(o).map(([e,t])=>h`<os-option value=${e}>${t}</os-option>`)}function zs(o,e){const t=o.defaultRole??"subscriber",s=o.assignableRoles&&Object.keys(o.assignableRoles).length>0?o.assignableRoles:{[t]:t},i=o.locales??{"":l("Site default")},n=a=>{a.preventDefault(),a.stopPropagation();const c=a.currentTarget.closest("os-form")?.querySelector('os-text-field[name="password"]'),d=Cs(18);c&&(c.value=d,c.setAttribute("value",d)),Uo(d),e(l("Generated password copied to clipboard."))};return h`<os-form
238 + </div>`}const zs=b` .os-community__loading{max-inline-size:520px;padding:48px 24px;margin:40px auto;text-align:center;color:var( --os-ui-fg,#1d2327 )}.os-community__loading>.dashicons{font-size:40px;inline-size:40px;block-size:40px;color:var( --os-ui-fg-muted,#646970 )}.os-community__loading h3{font-size:24px;font-weight:500;color:inherit}.os-community__loading p{font-size:12px;line-height:1.7;color:var( --os-ui-fg-muted,#646970 )}.os-community__loading os-progress-bar{display:block;margin-block:24px 12px}.os-community{padding:22px 24px 8px;max-inline-size:1440px;margin-inline:auto}.os-community__metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-block-end:20px}.os-community__metric{display:grid;grid-template-columns:auto 1fr;column-gap:14px;row-gap:8px;padding:18px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:14px;background:var( --os-ui-surface,#fff )}.os-community__metric>.dashicons{grid-column:1 / -1;color:var( --os-ui-fg-muted,#646970 );font-size:18px}.os-community__metric strong{font-size:38px;font-weight:500;line-height:1;letter-spacing:-.05em;font-variant-numeric:tabular-nums;align-self:center}.os-community__metric h3{margin:0 0 3px;font-size:12px;color:inherit}.os-community__metric p{margin:0;font-size:10px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-community__grid{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:20px;align-items:start}.os-community__panel{min-inline-size:0;padding:24px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:18px;background:var( --os-ui-surface,#fff )}.os-community__panel>header{display:flex;gap:12px;align-items:center;justify-content:space-between;margin-block-end:16px}.os-community__panel h3{margin:5px 0 0;font-size:22px;font-weight:500;letter-spacing:-.035em;line-height:1.15;color:inherit}.os-community__eyebrow{font-size:9px;letter-spacing:.13em;color:var( --os-ui-fg-muted,#646970 )}.os-community__stamp{font-size:32px;font-weight:300;color:var( --os-ui-accent,#2271b1 )}.os-community__totals{margin-block:6px 18px}.os-community__totals>div{display:flex;align-items:baseline;gap:10px}.os-community__totals strong{font-size:clamp(40px,4.8cqi,60px);line-height:1;font-weight:500;letter-spacing:-.06em;font-variant-numeric:tabular-nums}.os-community__totals span{font-size:13px}.os-community__totals p,.os-community__description{font-size:11px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 );margin:9px 0 0}.os-community__work os-segmented{display:flex;margin-block-end:18px}.os-community__work os-segment{flex:1}.os-community__spotlight{display:flex;gap:14px;align-items:center;padding:18px;border-radius:12px;background:var( --os-ui-surface-sunken,#f6f7f7 );border-inline-start:3px solid var( --os-ui-accent,#2271b1 )}.os-community__spotlight>div{flex:1;min-inline-size:0}.os-community__person{display:block;max-inline-size:100%;--os-ui-button-padding:0}.os-community__person::part(button){padding:0;min-block-size:0;border:0;background:transparent;color:var( --os-ui-fg,#1d2327 );font-size:13px;font-weight:600;line-height:1.3;text-align:start;white-space:normal;overflow-wrap:anywhere}.os-community__spotlight .os-community__person{margin-block:4px}.os-community__spotlight .os-community__person::part(button){font-size:19px;letter-spacing:-.025em}.os-community__spotlight p{font-size:10px;color:var( --os-ui-fg-muted,#646970 );margin:0}.os-community__spotlight>strong{text-align:end;font-size:30px;font-weight:500;line-height:1;font-variant-numeric:tabular-nums}.os-community__spotlight small{display:block;font-size:9px;font-weight:400;margin-block-start:6px;color:var( --os-ui-fg-muted,#646970 )}.os-community__leaders{list-style:none;padding:0;margin:12px 0}.os-community__leaders li{display:flex;gap:12px;align-items:center;padding-block:9px}.os-community__rank{inline-size:12px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );font-variant-numeric:tabular-nums}.os-community__leaders li>div{flex:1;min-inline-size:0}.os-community__leaders li>strong{font-size:15px;font-weight:500;font-variant-numeric:tabular-nums}.os-community__track{margin-block-start:6px;block-size:4px;border-radius:4px;overflow:hidden;background:var( --os-ui-surface-subtle,#f0f0f1 )}.os-community__track i{display:block;block-size:100%;border-radius:inherit;background:var( --os-ui-accent,#2271b1 )}.os-community__footnote{border-block-start:1px solid var( --os-ui-surface-subtle,#f0f0f1 );padding-block-start:12px;margin:16px 0 0;font-size:10px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-community__presence-panel{background:radial-gradient(ellipse at 100% 0,var( --os-ui-surface-subtle,#f0f0f1 ),transparent 70%),var( --os-ui-surface,#fff )}.os-community__status-dot{color:var( --os-ui-fg-muted,#646970 );inline-size:8px;block-size:8px;border-radius:50%;background:currentColor}.os-community__status-dot[data-online="true"]{color:var( --os-ui-success-fg,#008a20 )}.os-community__presence-summary{display:flex;gap:15px;align-items:center;margin-block:20px}.os-community__presence-summary>strong{display:grid;place-items:center;inline-size:90px;block-size:90px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%;box-shadow:inset 0 0 0 8px var( --os-ui-surface,#fff );background:var( --os-ui-surface-sunken,#f6f7f7 );font-size:40px;font-weight:500}.os-community__presence-summary p{font-size:16px;margin:0}.os-community__presence-summary span{display:block;font-size:11px;color:var( --os-ui-fg-muted,#646970 );margin-block-start:6px}.os-community__present{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.os-community__present>div,.os-community__newcomers>div{display:flex;align-items:center;gap:10px;min-inline-size:0}.os-community__present>div>div,.os-community__newcomers>div>div{min-inline-size:0}.os-community__present p,.os-community__newcomers p,.os-community__timeline p{font-size:10px;color:var( --os-ui-fg-muted,#646970 );margin:4px 0 0}.os-community__arrivals h4{margin:20px 0 12px;font-size:11px;font-weight:600;color:inherit}.os-community__arrivals os-histogram{display:block;margin-block-start:16px}.os-community__newcomers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.os-community__timeline{padding:0;margin:20px 0 0;list-style:none}.os-community__timeline li{position:relative;display:flex;gap:12px;align-items:center;padding-block-end:19px}.os-community__timeline li:not(:last-child)::before{content:'';position:absolute;inline-size:1px;inset-inline-start:16px;inset-block:34px 0;background:var( --os-ui-border,#dcdcde )}.os-community__timeline li>div{flex:1;min-inline-size:0}.os-community__login-mark{color:var( --os-ui-fg-muted,#646970 )}.os-community__empty{margin:24px 0;padding:16px;border:1px dashed var( --os-ui-border,#dcdcde );border-radius:10px;font-size:12px;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}@container people (min-width:900px){.os-community__work{grid-column:1;grid-row:1 / 3}.os-community__presence-panel{grid-column:2;grid-row:1}.os-community__checkins{grid-column:2;grid-row:2 / 4}.os-community__arrivals{grid-column:1;grid-row:3}}@container people (max-width:899px){.os-community{padding:16px}.os-community__metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.os-community__grid{grid-template-columns:1fr;gap:14px}.os-community__presence-panel{grid-row:1}.os-community__present{grid-template-columns:repeat(3,minmax(0,1fr))}}@container people (max-width:480px){.os-community{padding:10px 12px}.os-community__metrics{gap:8px;margin-block-end:12px}.os-community__metric{gap:6px 10px;padding:12px}.os-community__metric>.dashicons{display:none}.os-community__metric strong{font-size:29px}.os-community__metric h3{font-size:11px}.os-community__metric p{font-size:9px}.os-community__panel{padding:17px;border-radius:14px}.os-community__panel h3{font-size:20px}.os-community__present,.os-community__newcomers{grid-template-columns:repeat(2,minmax(0,1fr))}.os-community__spotlight{gap:10px;padding:12px;flex-wrap:wrap}.os-community__spotlight .os-community__eyebrow{font-size:8px}.os-community__spotlight .os-community__person::part(button){font-size:16px}}`,Es=b` .desktop-mode-users{container:people / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-users [hidden]{display:none !important}.os-people__hero{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:25px;background:var( --os-ui-surface,#fff )}.os-people__hero h2{color:inherit;margin:4px 0 8px;font-size:clamp(24px,3.4cqi,37px);font-weight:500;letter-spacing:-.045em;line-height:1.12}.os-people__eyebrow{font-size:10px;letter-spacing:.15em;color:var( --os-ui-fg-muted,#646970 )}.os-people__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-people__tools{display:flex;gap:9px;padding:10px 24px;align-items:center;flex-wrap:wrap;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-people__tools os-text-field{flex:1;min-inline-size:150px}.os-people__tools os-select{inline-size:140px}.os-people__options{display:none}.os-people__cards{flex:1;min-block-size:0;min-inline-size:0;overflow:auto;padding:20px 24px;display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,350px),1fr));gap:18px;align-content:start;overscroll-behavior:contain}.os-people__card{position:relative;isolation:isolate;box-sizing:border-box;display:grid;grid-template-rows:auto 1fr auto auto;gap:10px;aspect-ratio:1.586;min-inline-size:0;border:1px solid var( --os-ui-border,#dcdcde );border-radius:15px;padding:14px 16px 8px;background:var( --os-ui-surface,#fff );box-shadow:0 2px 4px var( --os-ui-surface-subtle,#f0f0f1 )}.os-people__card::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:0;border-radius:inherit;background:repeating-radial-gradient(ellipse at 105% 15%,transparent 0 8px,var( --os-ui-surface-subtle,#f0f0f1 ) 9px 10px,transparent 11px 16px);opacity:.55;mask-image:linear-gradient(to left,#000,transparent 70%)}.os-people__card::after{content:'';position:absolute;pointer-events:none;inset-block:28px;inset-inline-start:0;inline-size:3px;background:var( --os-ui-accent,#2271b1 );border-start-end-radius:3px;border-end-end-radius:3px;opacity:.65}.os-people__card.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-2px}.os-people__id-header{display:flex;align-items:center;gap:8px;min-block-size:18px}.os-people__issuer{display:inline-flex;align-items:center;gap:5px;font-size:9px;font-weight:600;letter-spacing:.12em;color:var( --os-ui-fg,#1d2327 )}.os-people__issuer>span:last-child{font-weight:400;color:var( --os-ui-fg-muted,#646970 )}.os-people__issuer .dashicons{font-size:17px;inline-size:17px;block-size:17px}.os-people__you{font-size:10px;color:var( --os-ui-accent,#2271b1 )}.os-people__select{margin-inline-start:auto;inline-size:18px;block-size:18px;flex:0 0 18px}.os-people__identity{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:center;gap:16px}.os-people__portrait{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:10px 4px 7px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-people__member-number{font:9px/1.2 ui-monospace,monospace;letter-spacing:.13em;color:var( --os-ui-fg-muted,#646970 )}.os-people__credentials{min-inline-size:0}.os-people__identity h3{margin:0;font-size:20px;line-height:1.15;color:inherit}.os-people__identity h3 os-button{font:inherit;--os-ui-button-padding:0}.os-people__identity h3 os-button::part(button){font:inherit;text-align:start;border:0;background:transparent;padding:0;white-space:normal;overflow-wrap:anywhere}.os-people__identity p{margin:4px 0 0;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-people__handle{overflow-wrap:anywhere}.os-people__email{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-people__joined time{color:var( --os-ui-fg,#1d2327 )}.os-people__roles{display:flex;flex-wrap:wrap;gap:4px;margin-block:6px}.os-people__roles span{border:1px solid var( --os-ui-border,#dcdcde );border-radius:4px;padding:2px 6px;font-size:9px;color:var( --os-ui-fg-muted,#646970 );background:var( --os-ui-surface,#fff )}.os-people__stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) 28px;gap:8px;align-items:center;padding-block:7px 0;border-block-start:1px solid var( --os-ui-border,#dcdcde );--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:21px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-people__stats os-stat::part(label){font-size:8px}.os-people__seal{display:grid;place-items:center;inline-size:26px;block-size:26px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%;color:var( --os-ui-fg-muted,#646970 );opacity:.5}.os-people__seal .dashicons{font-size:16px;inline-size:16px;block-size:16px}.os-people__card>footer{display:flex;align-items:center;gap:8px;min-inline-size:0}.os-people__last-login{flex:1;min-inline-size:0;font-size:9px;color:var( --os-ui-fg-muted,#646970 )}.os-people__card os-action-menu{margin-inline-start:auto;flex:0 0 auto}.os-people__presence{display:inline-flex;align-items:center;gap:4px;font-size:9px;color:var( --os-ui-fg-muted,#646970 );white-space:nowrap}.os-people__presence::before{content:'';inline-size:5px;block-size:5px;border-radius:50%;background:currentColor}.os-people__presence[data-presence="online"]{color:var( --os-ui-success-fg,#008a20 )}.os-people__presence[data-presence="inactive"]{color:var( --os-ui-warning-fg,#996800 )}.os-people__continuation{grid-column:1 / -1;flex:0 0 auto;padding:14px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-people__empty{grid-column:1 / -1;padding:50px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-people__scope{display:flex;align-items:center;gap:12px;justify-content:space-between;padding:8px 24px;font-size:11px;color:var( --os-ui-fg-muted,#646970 );border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-people__role-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:20px;padding:24px}.os-people__room{border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );border-radius:18px;padding:24px;text-align:center;min-inline-size:0}.os-people__orbit{position:relative;inline-size:210px;block-size:210px;margin:12px auto 20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:50%}.os-people__orbit::before{content:'';position:absolute;inset:25px;border:1px dashed var( --os-ui-border,#dcdcde );border-radius:50%}.os-people__orbit-center{position:absolute;inset:45px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-radius:50%;background:var( --os-ui-surface-sunken,#f6f7f7 );gap:6px}.os-people__orbit-center strong{font-size:36px;font-weight:500;line-height:1}.os-people__orbit-center span{font-size:11px;max-inline-size:95px;overflow-wrap:anywhere;color:var( --os-ui-fg-muted,#646970 )}.os-people__satellite{position:absolute;transform:translate(-50%,-50%);background:var( --os-ui-surface,#fff );padding:3px;border-radius:50%}.os-people__room>p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );min-block-size:28px}.os-people__insights{flex:1;min-block-size:0;overflow:auto}.desktop-mode-users .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;max-block-size:38%;overflow:auto;align-content:start}.desktop-mode-users .os-app-list__bulk--footer .os-app-list__count{flex:0 0 auto}.desktop-mode-users .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:1}@container people (max-width:640px){.os-people__hero{padding:10px 12px;gap:10px}.os-people__hero h2{font-size:20px;margin:0}.os-people__hero p,.os-people__eyebrow{display:none}.os-people__tools{padding:7px 12px;gap:7px}.os-people__options{display:block}.os-people__tools:not(.is-expanded) .os-people__extra{display:none}.os-people__cards{display:block;padding:9px 12px}.os-people__card{aspect-ratio:auto;gap:7px;padding:10px 12px 5px;margin-block-end:10px}.os-people__identity{grid-template-columns:72px minmax(0,1fr);gap:12px}.os-people__portrait{padding:5px 2px;gap:4px}.os-people__identity h3{font-size:17px}.os-people__identity p{font-size:9px;margin-block-start:3px}.os-people__roles{margin-block:4px}.os-people__stats{--os-ui-stat-value-size:18px;padding-block-start:5px}.os-people__last-login{font-size:8px}.os-people__scope{padding:7px 12px}.os-people__role-grid{padding:12px}}`;function Rs(o){const e="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789!@#$%^&*-_=+",t=new Uint32Array(o);crypto.getRandomValues(t);let s="";for(let i=0;i<o;i+=1)s+=e[t[i]%e.length];return s}function Nt(o){return Object.entries(o).map(([e,t])=>h`<os-option value=${e}>${t}</os-option>`)}function Ls(o,e){const t=o.defaultRole??"subscriber",s=o.assignableRoles&&Object.keys(o.assignableRoles).length>0?o.assignableRoles:{[t]:t},i=o.locales??{"":l("Site default")},n=r=>{r.preventDefault(),r.stopPropagation();const c=r.currentTarget.closest("os-form")?.querySelector('os-text-field[name="password"]'),d=Rs(18);c&&(c.value=d,c.setAttribute("value",d)),Ko(d),e(l("Generated password copied to clipboard."))};return h`<os-form
238 239 data-os-users-add-form
239 240 os-action="create"
240 241 submit-label=${l("Add user")}
241 242 reset-label=${l("Reset")}
@@ -250,10 +251,10 @@
250 251 <os-text-field name="email" type="email" label=${l("Email (required)")} placeholder=${l("[email protected]")} autocomplete="off" required></os-text-field>
251 252 <os-text-field name="first_name" label=${l("First name")} autocomplete="off"></os-text-field>
252 253 <os-text-field name="last_name" label=${l("Last name")} autocomplete="off"></os-text-field>
253 254 <os-text-field name="url" type="url" label=${l("Website")} placeholder="https://example.com" autocomplete="off" full-width></os-text-field>
254 - <os-select name="role" label=${l("Role")} value=${s[t]!==void 0?t:""}>${Rt(s)}</os-select>
255 - <os-select name="locale" label=${l("Language")}>${Rt(i)}</os-select>
255 + <os-select name="role" label=${l("Role")} value=${s[t]!==void 0?t:""}>${Nt(s)}</os-select>
256 + <os-select name="locale" label=${l("Language")}>${Nt(i)}</os-select>
256 257 <os-text-field
257 258 name="password"
258 259 type="password"
259 260 reveal
@@ -269,9 +270,9 @@
269 270 </os-button>
270 271 <p class="os-users__form-hint">${l("Leave blank to let WordPress generate one and email it to the user.")}</p>
271 272 </div>
272 273 <os-checkbox-label name="send_notification" label=${l("Send the new user an email about their account")} checked full-width></os-checkbox-label>
273 - </os-form>`}function Es(o,e,t){const s=o.querySelector("[data-os-users-add-form]");if(!s)return t;const i={created:e.created,error:e.createError,field:e.createField};return e.created!==t.created?(s.reset(),s.clearErrors(),i):e.createError===t.error&&e.createField===t.field?t:(s.clearErrors(),e.createError&&(s.setError(e.createError),e.createField&&s.setFieldInvalid(e.createField)),i)}const Rs="desktop-mode-users",Ls={success:5e3,error:8e3,info:void 0},D=()=>({feed:new ro,roles:new ao,activity:new no,view:"people",contribution:"posts",options:!1,cache:new Map,sync:so(),selected:[],rows:new Map,bulkRole:"",reassign:null,addForm:{created:0,error:"",field:""},profileWired:!1}),X=o=>o.root.querySelector("[data-os-users-table]"),F=o=>o.extra,we=(o,e,t)=>{o.host.toast?.(t?{message:e,duration:t}:{message:e})};function Ye(o){return Array.from(X(o)?.selection??[]).map(e=>Number(e)).filter(e=>e>0)}function Xe(o){X(o)?.clearSelection(),o.ui(D).selected=[]}async function Ts(o){const t=o.ui(D).bulkRole,s=Ye(o);if(!t||s.length===0)return;await o.dispatch("bulk-role",{ids:s,role:t},{confirm:{title:l("Change role for selected users?"),message:x(l("Set %1$d user(s)' role to %2$s?"),s.length,F(o).assignableRoles?.[t]??t),label:l("Set role")}})&&Xe(o)}async function Ns(o){const e=Ye(o);if(e.length===0)return;const t=F(o),s=o.ui(D),i=t.isMultisite===!0,n=i?null:s.reassign??Lt(t);let a;i?a=x(l("Remove %d user(s) from this site? Their network account stays."),e.length):n?a=x(l("Permanently delete %1$d user(s)? Their content is attributed to %2$s. This cannot be undone."),e.length,n.name):a=x(l("Permanently delete %d user(s)? Their content is deleted too. This cannot be undone."),e.length),await o.dispatch("bulk-delete",{ids:e,reassign:n?.id??0},{confirm:{title:l(i?"Remove selected users from this site?":"Delete selected users?"),message:a,label:l(i?"Remove":"Delete"),danger:!0}})&&Xe(o)}function Lt(o){return o.currentUserId?{id:o.currentUserId,name:l("you")}:null}function Tt(o,e){o.dispatch("send-reset",{id:e.id},{confirm:{title:l("Send password reset email?"),message:x(l("WordPress will email %s a password-reset link."),e.name),label:l("Send reset email")}})}function Nt(o,e){o.dispatch("resend-welcome",{id:e.id},{confirm:{title:l("Resend welcome email?"),message:x(l("WordPress will resend the original welcome email to %s."),e.name),label:l("Resend")}})}function Ps(o,e,t){const s=e.reassign??Lt(F(o));return h`<span class="os-users__reassign">
274 + </os-form>`}function Ts(o,e,t){const s=o.querySelector("[data-os-users-add-form]");if(!s)return t;const i={created:e.created,error:e.createError,field:e.createField};return e.created!==t.created?(s.reset(),s.clearErrors(),i):e.createError===t.error&&e.createField===t.field?t:(s.clearErrors(),e.createError&&(s.setError(e.createError),e.createField&&s.setFieldInvalid(e.createField)),i)}const Ns="desktop-mode-users",Ps={success:5e3,error:8e3,info:void 0},D=()=>({feed:new uo,roles:new co,activity:new lo,view:"people",contribution:"posts",options:!1,cache:new Map,sync:ro(),selected:[],rows:new Map,bulkRole:"",reassign:null,addForm:{created:0,error:"",field:""},profileWired:!1}),X=o=>o.root.querySelector("[data-os-users-table]"),F=o=>o.extra,Ms=o=>o.extra.menuTabs??[],$e=(o,e,t)=>{o.host.toast?.(t?{message:e,duration:t}:{message:e})};function Ge(o){return Array.from(X(o)?.selection??[]).map(e=>Number(e)).filter(e=>e>0)}function Ze(o){X(o)?.clearSelection(),o.ui(D).selected=[]}async function Is(o){const t=o.ui(D).bulkRole,s=Ge(o);if(!t||s.length===0)return;await o.dispatch("bulk-role",{ids:s,role:t},{confirm:{title:l("Change role for selected users?"),message:x(l("Set %1$d user(s)' role to %2$s?"),s.length,F(o).assignableRoles?.[t]??t),label:l("Set role")}})&&Ze(o)}async function qs(o){const e=Ge(o);if(e.length===0)return;const t=F(o),s=o.ui(D),i=t.isMultisite===!0,n=i?null:s.reassign??Pt(t);let r;i?r=x(l("Remove %d user(s) from this site? Their network account stays."),e.length):n?r=x(l("Permanently delete %1$d user(s)? Their content is attributed to %2$s. This cannot be undone."),e.length,n.name):r=x(l("Permanently delete %d user(s)? Their content is deleted too. This cannot be undone."),e.length),await o.dispatch("bulk-delete",{ids:e,reassign:n?.id??0},{confirm:{title:l(i?"Remove selected users from this site?":"Delete selected users?"),message:r,label:l(i?"Remove":"Delete"),danger:!0}})&&Ze(o)}function Pt(o){return o.currentUserId?{id:o.currentUserId,name:l("you")}:null}function Mt(o,e){o.dispatch("send-reset",{id:e.id},{confirm:{title:l("Send password reset email?"),message:x(l("WordPress will email %s a password-reset link."),e.name),label:l("Send reset email")}})}function It(o,e){o.dispatch("resend-welcome",{id:e.id},{confirm:{title:l("Resend welcome email?"),message:x(l("WordPress will resend the original welcome email to %s."),e.name),label:l("Resend")}})}function Ds(o,e,t){const s=e.reassign??Pt(F(o));return h`<span class="os-users__reassign">
274 275 <span class="os-users__reassign-label">${l("Attribute content to")}</span>
275 276 <strong class="os-users__reassign-name">${s?s.name:"—"}</strong>
276 277 <os-user-search
277 278 class="os-users__reassign-search"
@@ -278,15 +279,15 @@
278 279 placeholder=${l("Change…")}
279 280 exclude=${t.join(",")}
280 281 @os-user-pick=${i=>{const n=i.detail?.user;n&&(e.reassign={id:n.id,name:n.name},o.repaint())}}
281 282 ></os-user-search>
282 - </span>`}function Ms(o,e,t){const s=F(o),i=s.assignableRoles??{},n=e.selected.length>0;return h`<div
283 + </span>`}function Fs(o,e,t){const s=F(o),i=s.assignableRoles??{},n=e.selected.length>0;return h`<div
283 284 class="os-app-list__toolbar-right ${"os-app-list__bulk--footer"}"
284 285 data-os-users-bulk
285 286 ?hidden=${!n}
286 287 >
287 288 <span class="os-app-list__count" data-os-users-count>${x(l("%d selected"),e.selected.length)}</span>
288 - <os-button variant="ghost" @click=${()=>{Xe(o),o.repaint()}}>${l("Clear selection")}</os-button>
289 + <os-button variant="ghost" @click=${()=>{Ze(o),o.repaint()}}>${l("Clear selection")}</os-button>
289 290 <span class="os-app-list__bulk-actions" data-os-users-bulk-actions>
290 291 ${s.canPromote&&Object.keys(i).length>0?h`<span class="os-users__bulk-group">
291 292 <os-select
292 293 class="os-users__bulk-role"
@@ -292,60 +293,61 @@
292 293 class="os-users__bulk-role"
293 294 aria-label=${l("Set role to…")}
294 295 .value=${e.bulkRole}
295 296 placeholder=${l("Set role to…")}
296 - @os-pick=${a=>{e.bulkRole=String(a.detail?.value??"")}}
297 + @os-pick=${r=>{e.bulkRole=String(r.detail?.value??"")}}
297 298 >
298 299 <os-option .value=${""}>${l("Set role to…")}</os-option>
299 - ${Object.entries(i).map(([a,r])=>h`<os-option value=${a}>${r}</os-option>`)}
300 + ${Object.entries(i).map(([r,a])=>h`<os-option value=${r}>${a}</os-option>`)}
300 301 </os-select>
301 - <os-button variant="primary" @click=${()=>void Ts(o)}>${l("Apply")}</os-button>
302 + <os-button variant="primary" @click=${()=>void Is(o)}>${l("Apply")}</os-button>
302 303 </span>`:""}
303 304 ${s.canDelete?h`<span class="os-users__bulk-group">
304 - ${s.isMultisite?"":Ps(o,e,e.selected)}
305 - <os-button variant="danger" @click=${()=>void Ns(o)}>
305 + ${s.isMultisite?"":Ds(o,e,e.selected)}
306 + <os-button variant="danger" @click=${()=>void qs(o)}>
306 307 <span class="dashicons dashicons-trash" aria-hidden="true"></span>
307 308 ${s.isMultisite?l("Remove from site"):l("Delete")}
308 309 </os-button>
309 310 </span>`:""}
310 311 </span>
311 - </div>`}function Pt(o){return{onSendReset:e=>Tt(o,e),onResendWelcome:e=>Nt(o,e),toast:e=>we(o,e)}}function Mt(o,e){return Bo(e.feed.items,o.state.status)}function Is(o,e){o.state.role=e===""?"none":e,o.dispatch("filter",{})}function qs(o,e,t,s){const{state:i,data:n}=o,a=F(o),r=a.canEdit===!0||a.canPromote===!0||a.canDelete===!0;return h`<os-tabpanel for="all" class="os-app-list__panel" ?hidden=${i.tab!=="all"}>
312 + </div>`}function qt(o){return{onSendReset:e=>Mt(o,e),onResendWelcome:e=>It(o,e),toast:e=>$e(o,e)}}function Dt(o,e){return Yo(e.feed.items,o.state.status)}function Ws(o,e){o.state.role=e===""?"none":e,o.dispatch("filter",{})}function Hs(o,e,t,s){const{state:i,data:n}=o,r=F(o),a=r.canEdit===!0||r.canPromote===!0||r.canDelete===!0;return h`<os-tabpanel for="all" class="os-app-list__panel" ?hidden=${i.tab!=="all"}>
312 313 <header class="os-people__hero"><div><span class="os-people__eyebrow">${l("YOUR COMMUNITY")}</span><h2>${l("The people behind it.")}</h2><p>${l("Get to know the names. See what everyone brings.")}</p></div>
313 - ${a.canCreate?h`<os-button variant="holo" data-os-users-new os-action="tab" os-arg-value="add-new">+ ${l("Add person")}</os-button>`:""}</header>
314 + ${r.canCreate?h`<os-button variant="holo" data-os-users-new os-action="tab" os-arg-value="add-new">+ ${l("Add person")}</os-button>`:""}</header>
314 315 <div class="os-people__tools ${e.options?"is-expanded":""}" data-os-users-toolbar>
315 316 <os-text-field id=${`${o.windowId}-people-search`} class="os-app-list__search" data-os-users-search type="search" os-bind="search" os-action="filter" os-debounce="250" value=${i.search} aria-label=${l("Search people")} placeholder=${l("Search name, username, email…")}></os-text-field>
316 317 <os-button class="os-people__options" variant="secondary" @click=${()=>{e.options=!e.options,o.repaint()}}>${l("Options")}</os-button>
317 318 <os-select class="os-people__extra" aria-label=${l("Filter by role")} os-bind="role" os-action="filter" .value=${i.role} data-os-users-role>
318 - <os-option .value=${""}>${l("Every role")}</os-option><os-option value="none">${l("No role")}</os-option>${Object.entries(a.allRoles||{}).map(([c,d])=>h`<os-option value=${c}>${d}</os-option>`)}
319 + <os-option .value=${""}>${l("Every role")}</os-option><os-option value="none">${l("No role")}</os-option>${Object.entries(r.allRoles||{}).map(([c,d])=>h`<os-option value=${c}>${d}</os-option>`)}
319 320 </os-select>
320 321 <os-select class="os-people__extra" aria-label=${l("Directory view")} value=${e.view} @os-pick=${c=>{e.view=String(c.detail.value),o.repaint()}}><os-option value="people">${l("People cards")}</os-option><os-option value="table">${l("Details table")}</os-option></os-select>
321 322 <os-select class="os-people__extra" aria-label=${l("Sort people")} value=${`${i.orderby}:${i.order}`} @os-pick=${c=>{const[d,p]=String(c.detail.value).split(":");o.dispatch("sort",{orderby:d,order:p})}}><os-option value="name:asc">${l("Name A–Z")}</os-option><os-option value="name:desc">${l("Name Z–A")}</os-option><os-option value="registered_date:desc">${l("Newest members")}</os-option><os-option value="registered_date:asc">${l("Longest standing")}</os-option><os-option value="email:asc">${l("Email A–Z")}</os-option></os-select>
322 - <span class="os-people__extra">${to({segments:jo(),value:i.status,bind:"status",action:"filter",label:l("Filter users"),phone:t})}</span>
323 + <span class="os-people__extra">${io({segments:Vo(),value:i.status,bind:"status",action:"filter",label:l("Filter users"),phone:t})}</span>
323 324 <os-button class="os-people__extra" variant="ghost" os-action="refresh" data-os-users-refresh>${l("Refresh")}</os-button>
324 325 </div>
325 326 ${n.list.error?h`<os-notice tone="danger">${l("Could not load users. Try Refresh.")} ${n.list.error}</os-notice>`:""}
326 327 <div class="os-people__scope"><span>${x(l("%1$d of %2$d people loaded"),e.feed.items.length,n.list.total)}${i.status||i.role?` · ${s.length} ${l("match filters")}`:""}</span>${i.role?h`<os-button variant="ghost" data-os-users-clear-role @click=${()=>{o.state.role="",o.dispatch("filter",{})}}>${l("Clear role")}</os-button>`:""}</div>
327 - <div class="os-people__card-host" ?hidden=${e.view!=="people"} style="display:flex;flex:1;min-height:0;">${rs(i.tab==="all"?s:[],{cfg:a,actions:Pt(o),selected:e.selected,select:(c,d)=>{d?X(o)?.select(c):X(o)?.deselect(c)}},e.feed.tail(),o.loading)}</div>
328 - <div class="os-app-list__body" data-os-users-body ?hidden=${e.view!=="table"}><os-table data-os-users-table os-preserve selectable=${r?"multi":""} sticky-header sticky-columns="1" hover striped bordered><div slot="empty" class="os-app-list__empty"><p>${l("No users found.")}</p></div></os-table></div>
328 + <div class="os-people__card-host" ?hidden=${e.view!=="people"} style="display:flex;flex:1;min-height:0;">${ds(i.tab==="all"?s:[],{cfg:r,actions:qt(o),selected:e.selected,select:(c,d)=>{d?X(o)?.select(c):X(o)?.deselect(c)}},e.feed.tail(),o.loading)}</div>
329 + <div class="os-app-list__body" data-os-users-body ?hidden=${e.view!=="table"}><os-table data-os-users-table os-preserve selectable=${a?"multi":""} sticky-header sticky-columns="1" hover striped bordered><div slot="empty" class="os-app-list__empty"><p>${l("No users found.")}</p></div></os-table></div>
329 330 ${e.view==="table"?e.feed.tail():""}
330 - ${Ms(o,e)}
331 - </os-tabpanel>`}function It(o,e,t){const s=e.roles,i=t==="roles";let n,a;if(i)n=s.data?x(l("%d people across this site. Up to 8 faces per role; people can belong to more than one group."),s.data.total):l("Gathering your role groups…"),a=s.data?ls(s.data.groups,r=>{o.local("tab",{value:"all"}),Is(o,r)}):h`<p class="os-people__empty" role="status">${s.error?l("Role groups are unavailable."):l("Loading all roles…")}</p>`;else{const r=e.activity.data;n=r?x(l("%d people across this site."),r.total):l("Gathering the complete community overview"),a=r?$s(r,Pt(o),F(o),e.contribution,c=>{e.contribution=c,o.repaint()}):h`<section class="os-community__loading" role="status"><h3>${e.activity.error?l("The overview could not load. Use Refresh to retry."):l("Bringing everyone together…")}</h3></section>`}return h`<os-tabpanel for=${t} class="os-app-list__panel" ?hidden=${o.state.tab!==t}>
331 + ${Fs(o,e)}
332 + </os-tabpanel>`}function Ft(o,e,t){const s=e.roles,i=t==="roles";let n,r;if(i)n=s.data?x(l("%d people across this site. Up to 8 faces per role; people can belong to more than one group."),s.data.total):l("Gathering your role groups…"),r=s.data?us(s.data.groups,a=>{o.local("tab",{value:"all"}),Ws(o,a)}):h`<p class="os-people__empty" role="status">${s.error?l("Role groups are unavailable."):l("Loading all roles…")}</p>`;else{const a=e.activity.data;n=a?x(l("%d people across this site."),a.total):l("Gathering the complete community overview"),r=a?Cs(a,qt(o),F(o),e.contribution,c=>{e.contribution=c,o.repaint()}):h`<section class="os-community__loading" role="status"><h3>${e.activity.error?l("The overview could not load. Use Refresh to retry."):l("Bringing everyone together…")}</h3></section>`}return h`<os-tabpanel for=${t} class="os-app-list__panel" ?hidden=${o.state.tab!==t}>
332 333 <header class="os-people__hero"><div><span class="os-people__eyebrow">${l(i?"A PLACE FOR EVERYONE":"THE HUMAN SIDE OF YOUR SITE")}</span><h2>${l(i?"Different roles. One community.":"A community, in motion.")}</h2><p>${l(i?"Explore the groups that make your site work.":"The people showing up, joining in, and making things happen.")}</p></div></header>
333 334 <div class="os-people__scope"><span>${n}</span>
334 335 ${i?h`<os-button variant="ghost" ?disabled=${s.loading} @click=${()=>void s.load(o)}>${s.loading?l("Refreshing…"):l("Refresh")}</os-button>`:h`<os-button variant="ghost" ?disabled=${e.activity.loading} @click=${()=>void e.activity.load(o)}>${l("Refresh")}</os-button>`}</div>
335 336 ${(i?s.error:e.activity.error)?h`<os-notice tone="danger">${l("Could not refresh this overview. Try Refresh.")}</os-notice>`:""}
336 - <div class="os-people__insights">${a}</div>
337 - </os-tabpanel>`}const Ds=io(Rs,{local:{tab:(o,e)=>{o.tab=String(e.value??"all")}},placeholder:o=>({list:{items:[],total:0,pages:0,page:o.page,perPage:o.perPage}}),view:o=>{const{state:e}=o,t=F(o),s=o.ui(D),i=_e();s.feed.reconcile(o);const n=Mt(o,s);return h`<div class="os-app-list desktop-mode-users" data-os-users-root><style>${As.cssText}${Ss.cssText}</style>
337 + <div class="os-people__insights">${r}</div>
338 + </os-tabpanel>`}const Os=ao(Ns,{local:{tab:(o,e)=>{o.tab=String(e.value??"all")}},placeholder:o=>({list:{items:[],total:0,pages:0,page:o.page,perPage:o.perPage}}),view:o=>{const{state:e}=o,t=F(o),s=o.ui(D),i=_e();s.feed.reconcile(o);const n=Dt(o,s);return h`<div class="os-app-list desktop-mode-users" data-os-users-root><style>${Es.cssText}${zs.cssText}</style>
338 339 <os-tabs value=${e.tab} os-bind="tab" class="os-app-list__tabs os-users__tabs" label=${l("Users")} data-os-users-tabs>
339 - <os-tab value="all">${l("People")}</os-tab><os-tab value="roles">${l("Roles")}</os-tab><os-tab value="activity">${l("Activity")}</os-tab>
340 - ${t.canCreate?h`<os-tab value="add-new">${l("Add new")}</os-tab>`:""}
341 - <os-tab value="edit" data-os-users-edit-tab>${l("Profile")}</os-tab>
340 + ${Ms(o).map(r=>h`<os-tab
341 + value=${r.id}
342 + data-os-users-tab=${r.id}
343 + >${r.label}</os-tab>`)}
342 344 </os-tabs>
343 - ${qs(o,s,i,n)}
344 - ${It(o,s,"roles")}
345 - ${It(o,s,"activity")}
345 + ${Hs(o,s,i,n)}
346 + ${Ft(o,s,"roles")}
347 + ${Ft(o,s,"activity")}
346 348 ${t.canCreate?h`<os-tabpanel for="add-new" class="os-users__add-panel" ?hidden=${e.tab!=="add-new"}>
347 - ${zs(t,a=>we(o,a))}
349 + ${Ls(t,r=>$e(o,r))}
348 350 </os-tabpanel>`:""}
349 351 <os-tabpanel for="edit" class="os-users__edit-panel" ?hidden=${e.tab!=="edit"}>
350 352 <os-user-profile
351 353 os-preserve
@@ -352,6 +354,6 @@
352 354 data-os-user-profile-self
353 355 user-id=${e.tab==="edit"&&t.currentUserId?String(t.currentUserId):""}
354 356 ></os-user-profile>
355 357 </os-tabpanel>
356 - </div>`},mounted:o=>{const e=()=>o.repaint();return document.addEventListener("os-mode-changed",e),()=>{document.removeEventListener("os-mode-changed",e),o.ui(D).feed.dispose(),o.ui(D).roles.dispose(),o.ui(D).activity.dispose()}},updated:o=>{const e=o.ui(D),{state:t}=o,s=F(o);e.addForm=Es(o.root,t,e.addForm);const i=o.root.querySelector("os-user-profile");if(i&&!e.profileWired&&(e.profileWired=!0,i.config=s,i.fetch=o.fetch,i.toast=(c,d)=>we(o,c,Ls[d??"info"])),cs(o.root),e.roles.update(o),e.feed.observe(o.root),e.activity.update(o),t.tab!=="all")return;const n=Mt(o,e),a=new Map(n.map(c=>[c.id,Yo(c)]));for(const[c,d]of a)e.rows.get(c)!==d&&At(e.cache,c);for(const c of e.rows.keys())a.has(c)||At(e.cache,c);e.rows=a;const r={onSendReset:c=>Tt(o,c),onResendWelcome:c=>Nt(o,c),toast:c=>we(o,c)};X(o)?.toggleAttribute("loading",o.loading),e.sync.sync({table:X(o),rows:n,listKey:`${t.perPage}|${t.search}|${t.role}|${t.status}|${t.orderby}|${t.order}`,fingerprint:Array.from(a.values()).join(`
357 -`),columns:c=>ts(e.cache,s,r,c),wire:c=>{const d=c;d.getRowId=p=>p.id,d.sort={key:"identity",direction:t.order==="desc"?"desc":"asc"},d.addEventListener("os-table-selection-change",()=>{e.selected=Ye(o),o.repaint()}),d.addEventListener("os-table-sort-change",p=>{const u=p.detail?.sort;o.dispatch("sort",{orderby:u?Ko[u.key]??"name":"name",order:u?.direction??"asc"})}),d.addEventListener("os-table-row-click",p=>{const u=p.detail?.row?.id;typeof u=="number"&&u>0&&Q(u,r)})},onSelection:c=>{e.selected=c.map(Number),queueMicrotask(()=>o.repaint())}})}});return Ce.default=Ds,Object.defineProperties(Ce,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Ce}({});
358 + </div>`},mounted:o=>{const e=()=>o.repaint();return document.addEventListener("os-mode-changed",e),()=>{document.removeEventListener("os-mode-changed",e),o.ui(D).feed.dispose(),o.ui(D).roles.dispose(),o.ui(D).activity.dispose()}},updated:o=>{const e=o.ui(D),{state:t}=o,s=F(o);e.addForm=Ts(o.root,t,e.addForm);const i=o.root.querySelector("os-user-profile");if(i&&!e.profileWired&&(e.profileWired=!0,i.config=s,i.fetch=o.fetch,i.toast=(c,d)=>$e(o,c,Ps[d??"info"])),ps(o.root),e.roles.update(o),e.feed.observe(o.root),e.activity.update(o),t.tab!=="all")return;const n=Dt(o,e),r=new Map(n.map(c=>[c.id,Zo(c)]));for(const[c,d]of r)e.rows.get(c)!==d&&Et(e.cache,c);for(const c of e.rows.keys())r.has(c)||Et(e.cache,c);e.rows=r;const a={onSendReset:c=>Mt(o,c),onResendWelcome:c=>It(o,c),toast:c=>$e(o,c)};X(o)?.toggleAttribute("loading",o.loading),e.sync.sync({table:X(o),rows:n,listKey:`${t.perPage}|${t.search}|${t.role}|${t.status}|${t.orderby}|${t.order}`,fingerprint:Array.from(r.values()).join(`
359 +`),columns:c=>is(e.cache,s,a,c),wire:c=>{const d=c;d.getRowId=p=>p.id,d.sort={key:"identity",direction:t.order==="desc"?"desc":"asc"},d.addEventListener("os-table-selection-change",()=>{e.selected=Ge(o),o.repaint()}),d.addEventListener("os-table-sort-change",p=>{const u=p.detail?.sort;o.dispatch("sort",{orderby:u?Go[u.key]??"name":"name",order:u?.direction??"asc"})}),d.addEventListener("os-table-row-click",p=>{const u=p.detail?.row?.id;typeof u=="number"&&u>0&&Q(u,a)})},onSelection:c=>{e.selected=c.map(Number),queueMicrotask(()=>o.repaint())}})}});return ze.default=Os,Object.defineProperties(ze,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),ze}({});