| @@ -1,5 +1,5 @@ | ||
| 1 | -var openStationApp_pages=function(De){"use strict";const vt="desktop-mode";function He(){return window.wp?.i18n}function u(s,e=vt){return He()?.__(s,e)??s}function Fe(s,e,t,o=vt){return He()?._n(s,e,t,o)??(t===1?s:e)}function H(s,...e){const t=He()?.sprintf;if(t)return t(s,...e);let o=0;return s.replace(/%(?:(\d+)\$)?[sd]/g,(i,a)=>{const n=a?Number.parseInt(a,10)-1:o++;return String(e[n]??"")})}function b(s,...e){return{__wpdHtml:!0,strings:s,values:e}}function ws(s){return!!s&&s.__wpdHtml===!0}const $s="$$wpd$$",F=/\$\$wpd\$\$(\d+)\$\$/g,Cs="$$wpd-node$$",Ss=/^\$\$wpd-node\$\$(\d+)\$\$$/,As=new Set(["style","script","textarea","title"]);function Es(s){let e="",t=!1,o=null,i=!1,a=null,n="",r=!1;for(let l=0;l<s.length;l++){const c=s[l];e+=c;for(let d=0;d<c.length;d++){const p=c[d];if(i){c.startsWith("-->",d)&&(i=!1,d+=2);continue}if(a!==null){p==="<"&&c[d+1]==="/"&&c.slice(d+2,d+2+a.length).toLowerCase()===a&&(d+=1+a.length,a=null,t=!0,r=!1,n="");continue}if(o!==null){p===o&&(o=null);continue}if(t){p==='"'||p==="'"?(o=p,r=!1):p===">"?(t=!1,r=!1,As.has(n)&&(a=n),n=""):r&&(/[a-zA-Z0-9-]/.test(p)?n+=p.toLowerCase():r=!1);continue}if(c.startsWith("<!--",d)){i=!0,d+=3;continue}const g=c[d+1]??"";p==="<"&&/[a-zA-Z/!]/.test(g)&&(t=!0,n="",r=/[a-zA-Z]/.test(g))}l<s.length-1&&(e+=t||i||a!==null?`${$s}${l}$$`:`<!--${Cs}${l}$$-->`)}return e}const xt=new WeakMap;function yt(s){const e=xt.get(s);if(e)return e;const t=document.createElement("template");t.innerHTML=Es(s);const o=[],i=(r,l)=>{if(r.nodeType===Node.ELEMENT_NODE){const p=r;for(const g of Array.from(p.attributes)){const v=g.name,_=g.value,x=v[0];if(F.test(_))if(F.lastIndex=0,x==="@"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"event",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="."){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"prop",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="?"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"bool",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else{const h=[],f=[];let m=0,y;for(F.lastIndex=0;(y=F.exec(_))!==null;)h.push(_.slice(m,y.index)),f.push(Number(y[1])),m=y.index+y[0].length;h.push(_.slice(m)),o.push({path:l,kind:"attr",name:v,template:h,valueIndices:f}),p.setAttribute(v,"")}}}const c=Array.from(r.childNodes);let d=0;for(let p=0;p<c.length;p++){const g=c[p],v=p+d;if(g.nodeType===Node.COMMENT_NODE){const _=Ss.exec(g.data);if(_){const x=document.createTextNode("");g.parentNode.replaceChild(x,g),o.push({path:[...l,v],kind:"node",valueIndex:Number(_[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const _=g.textContent||"";if(!F.test(_)){F.lastIndex=0;continue}F.lastIndex=0;const x=g.parentNode;let h=0,f;const m=[],y=[];for(F.lastIndex=0;(f=F.exec(_))!==null;){f.index>h&&m.push(document.createTextNode(_.slice(h,f.index)));const w=document.createTextNode("");m.push(w),y.push({path:[...l,v+m.length-1],kind:"node",valueIndex:Number(f[1])}),h=f.index+f[0].length}h<_.length&&m.push(document.createTextNode(_.slice(h)));for(const w of m)x.insertBefore(w,g);x.removeChild(g),d+=m.length-1,o.push(...y)}else i(g,[...l,v])}};i(t.content,[]);const n={template:t,buildParts:r=>{const l=[];for(const c of o){let d=r;for(const p of c.path)d=d.childNodes[p];c.kind==="node"?l.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:d,state:null}}):c.kind==="attr"?l.push({kind:"attr",element:d,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?l.push({kind:"event",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="prop"?l.push({kind:"prop",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="bool"&&l.push({kind:"bool",valueIndex:c.valueIndex,element:d,name:c.name})}return l}};return xt.set(s,n),n}const kt=new WeakMap;function zs(s,e){for(const t of s.nodes)if(t.parentNode!==e)return!1;return!0}function Z(s,e){const t=kt.get(e);if(t&&t.strings===s.strings&&zs(t,e)){Ae(t.parts,s.values);return}const o=yt(s.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),Ae(a,s.values),kt.set(e,{strings:s.strings,parts:a,nodes:n})}function Ae(s,e){for(const t of s)if(t.kind==="node")Ee(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let o=t.template[0];for(let i=0;i<t.valueIndices.length;i++)o+=wt(e[t.valueIndices[i]]),o+=t.template[i+1];o!==t.last&&(t.last=o,o===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,o))}else if(t.kind==="event"){const o=e[t.valueIndex];o!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),o&&t.element.addEventListener(t.name,o),t.current=o)}else if(t.kind==="prop"){const o=e[t.valueIndex];o!==t.last&&(t.last=o,t.element[t.name]=o)}else if(t.kind==="bool"){const o=!!e[t.valueIndex];o!==t.last&&(t.last=o,o?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function Ee(s,e){if(e==null||e===!1){s.state&&(se(s.state),s.state=null);return}if(Array.isArray(e)){Ls(s,e);return}if(ws(e)){Ms(s,e);return}if(e instanceof Node){Ts(s,e);return}Ps(s,wt(e))}function Ts(s,e){const t=s.state;t?.shape==="node"&&t.node===e||(t&&se(t),pe(s,[e]),s.state={shape:"node",node:e})}function Ps(s,e){const t=s.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&se(t);const o=document.createTextNode(e);pe(s,[o]),s.state={shape:"text",node:o,text:e}}function Ms(s,e){const t=s.state;if(t?.shape==="template"&&t.strings===e.strings){Ae(t.parts,e.values);return}t&&se(t);const o=yt(e.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);pe(s,[i]),Ae(a,e.values),s.state={shape:"template",strings:e.strings,parts:a,nodes:n}}function Ls(s,e){const t=s.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let a=0;a<i;a++)Ee(t.entries[a],e[a]);if(e.length<t.entries.length){for(let a=e.length;a<t.entries.length;a++){const n=t.entries[a];n.state&&se(n.state),n.anchor.remove()}t.entries.length=e.length}else for(let a=t.entries.length;a<e.length;a++){const n=document.createTextNode("");pe(s,[n]);const r={anchor:n,state:null};Ee(r,e[a]),t.entries.push(r)}return}t&&se(t);const o=[];for(const i of e){const a=document.createTextNode("");pe(s,[a]);const n={anchor:a,state:null};Ee(n,i),o.push(n)}s.state={shape:"array",entries:o}}function pe(s,e){const t=s.anchor.parentNode;if(t)for(const o of e)t.insertBefore(o,s.anchor)}function se(s){if(s.shape==="text"){s.node.remove();return}if(s.shape==="template"){for(const e of s.parts)e.kind==="node"&&e.child.state&&(se(e.child.state),e.child.state=null);for(const e of s.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(s.shape==="node"){s.node.parentNode&&s.node.parentNode.removeChild(s.node);return}for(const e of s.entries)e.state&&se(e.state),e.anchor.remove()}function wt(s){return s==null||s===!1?"":String(s)}async function $t(s){if(s==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(s),!0}catch{}return Rs(s)}function Rs(s){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=s,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 o=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),o?.focus?.(),i}const Is="data-os-mode";function Ue(s=typeof document<"u"?document.documentElement:null){return!!s&&s.getAttribute(Is)==="mobile"}function Ns(s){return s.phone??Ue()?b`<os-select | |
| 1 | +var openStationApp_pages=function(De){"use strict";const vt="desktop-mode";function He(){return window.wp?.i18n}function u(s,e=vt){return He()?.__(s,e)??s}function Fe(s,e,t,o=vt){return He()?._n(s,e,t,o)??(t===1?s:e)}function H(s,...e){const t=He()?.sprintf;if(t)return t(s,...e);let o=0;return s.replace(/%(?:(\d+)\$)?[sd]/g,(i,a)=>{const n=a?Number.parseInt(a,10)-1:o++;return String(e[n]??"")})}function b(s,...e){return{__wpdHtml:!0,strings:s,values:e}}function ws(s){return!!s&&s.__wpdHtml===!0}const $s="$$wpd$$",F=/\$\$wpd\$\$(\d+)\$\$/g,Cs="$$wpd-node$$",Ss=/^\$\$wpd-node\$\$(\d+)\$\$$/,As=new Set(["style","script","textarea","title"]);function Es(s){let e="",t=!1,o=null,i=!1,a=null,n="",r=!1;for(let l=0;l<s.length;l++){const c=s[l];e+=c;for(let d=0;d<c.length;d++){const p=c[d];if(i){c.startsWith("-->",d)&&(i=!1,d+=2);continue}if(a!==null){p==="<"&&c[d+1]==="/"&&c.slice(d+2,d+2+a.length).toLowerCase()===a&&(d+=1+a.length,a=null,t=!0,r=!1,n="");continue}if(o!==null){p===o&&(o=null);continue}if(t){p==='"'||p==="'"?(o=p,r=!1):p===">"?(t=!1,r=!1,As.has(n)&&(a=n),n=""):r&&(/[a-zA-Z0-9-]/.test(p)?n+=p.toLowerCase():r=!1);continue}if(c.startsWith("<!--",d)){i=!0,d+=3;continue}const g=c[d+1]??"";p==="<"&&/[a-zA-Z/!]/.test(g)&&(t=!0,n="",r=/[a-zA-Z]/.test(g))}l<s.length-1&&(e+=t||i||a!==null?`${$s}${l}$$`:`<!--${Cs}${l}$$-->`)}return e}const xt=new WeakMap;function yt(s){const e=xt.get(s);if(e)return e;const t=document.createElement("template");t.innerHTML=Es(s);const o=[],i=(r,l)=>{if(r.nodeType===Node.ELEMENT_NODE){const p=r;for(const g of Array.from(p.attributes)){const v=g.name,_=g.value,x=v[0];if(F.test(_))if(F.lastIndex=0,x==="@"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"event",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="."){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"prop",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else if(x==="?"){const h=F.exec(_);F.lastIndex=0,o.push({path:l,kind:"bool",name:v.slice(1),valueIndex:h?Number(h[1]):0}),p.removeAttribute(v)}else{const h=[],f=[];let m=0,y;for(F.lastIndex=0;(y=F.exec(_))!==null;)h.push(_.slice(m,y.index)),f.push(Number(y[1])),m=y.index+y[0].length;h.push(_.slice(m)),o.push({path:l,kind:"attr",name:v,template:h,valueIndices:f}),p.setAttribute(v,"")}}}const c=Array.from(r.childNodes);let d=0;for(let p=0;p<c.length;p++){const g=c[p],v=p+d;if(g.nodeType===Node.COMMENT_NODE){const _=Ss.exec(g.data);if(_){const x=document.createTextNode("");g.parentNode.replaceChild(x,g),o.push({path:[...l,v],kind:"node",valueIndex:Number(_[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const _=g.textContent||"";if(!F.test(_)){F.lastIndex=0;continue}F.lastIndex=0;const x=g.parentNode;let h=0,f;const m=[],y=[];for(F.lastIndex=0;(f=F.exec(_))!==null;){f.index>h&&m.push(document.createTextNode(_.slice(h,f.index)));const w=document.createTextNode("");m.push(w),y.push({path:[...l,v+m.length-1],kind:"node",valueIndex:Number(f[1])}),h=f.index+f[0].length}h<_.length&&m.push(document.createTextNode(_.slice(h)));for(const w of m)x.insertBefore(w,g);x.removeChild(g),d+=m.length-1,o.push(...y)}else i(g,[...l,v])}};i(t.content,[]);const n={template:t,buildParts:r=>{const l=[];for(const c of o){let d=r;for(const p of c.path)d=d.childNodes[p];c.kind==="node"?l.push({kind:"node",valueIndex:c.valueIndex,child:{anchor:d,state:null}}):c.kind==="attr"?l.push({kind:"attr",element:d,name:c.name,template:c.template,valueIndices:c.valueIndices}):c.kind==="event"?l.push({kind:"event",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="prop"?l.push({kind:"prop",valueIndex:c.valueIndex,element:d,name:c.name}):c.kind==="bool"&&l.push({kind:"bool",valueIndex:c.valueIndex,element:d,name:c.name})}return l}};return xt.set(s,n),n}const kt=new WeakMap;function zs(s,e){for(const t of s.nodes)if(t.parentNode!==e)return!1;return!0}function Z(s,e){const t=kt.get(e);if(t&&t.strings===s.strings&&zs(t,e)){Ae(t.parts,s.values);return}const o=yt(s.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),Ae(a,s.values),kt.set(e,{strings:s.strings,parts:a,nodes:n})}function Ae(s,e){for(const t of s)if(t.kind==="node")Ee(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let o=t.template[0];for(let i=0;i<t.valueIndices.length;i++)o+=wt(e[t.valueIndices[i]]),o+=t.template[i+1];o!==t.last&&(t.last=o,o===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,o))}else if(t.kind==="event"){const o=e[t.valueIndex];o!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),o&&t.element.addEventListener(t.name,o),t.current=o)}else if(t.kind==="prop"){const o=e[t.valueIndex];o!==t.last&&(t.last=o,t.element[t.name]=o)}else if(t.kind==="bool"){const o=!!e[t.valueIndex];o!==t.last&&(t.last=o,o?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function Ee(s,e){if(e==null||e===!1){s.state&&(se(s.state),s.state=null);return}if(Array.isArray(e)){Ls(s,e);return}if(ws(e)){Ms(s,e);return}if(e instanceof Node){Ts(s,e);return}Ps(s,wt(e))}function Ts(s,e){const t=s.state;t?.shape==="node"&&t.node===e||(t&&se(t),ue(s,[e]),s.state={shape:"node",node:e})}function Ps(s,e){const t=s.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&se(t);const o=document.createTextNode(e);ue(s,[o]),s.state={shape:"text",node:o,text:e}}function Ms(s,e){const t=s.state;if(t?.shape==="template"&&t.strings===e.strings){Ae(t.parts,e.values);return}t&&se(t);const o=yt(e.strings),i=o.template.content.cloneNode(!0),a=o.buildParts(i),n=Array.from(i.childNodes);ue(s,[i]),Ae(a,e.values),s.state={shape:"template",strings:e.strings,parts:a,nodes:n}}function Ls(s,e){const t=s.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let a=0;a<i;a++)Ee(t.entries[a],e[a]);if(e.length<t.entries.length){for(let a=e.length;a<t.entries.length;a++){const n=t.entries[a];n.state&&se(n.state),n.anchor.remove()}t.entries.length=e.length}else for(let a=t.entries.length;a<e.length;a++){const n=document.createTextNode("");ue(s,[n]);const r={anchor:n,state:null};Ee(r,e[a]),t.entries.push(r)}return}t&&se(t);const o=[];for(const i of e){const a=document.createTextNode("");ue(s,[a]);const n={anchor:a,state:null};Ee(n,i),o.push(n)}s.state={shape:"array",entries:o}}function ue(s,e){const t=s.anchor.parentNode;if(t)for(const o of e)t.insertBefore(o,s.anchor)}function se(s){if(s.shape==="text"){s.node.remove();return}if(s.shape==="template"){for(const e of s.parts)e.kind==="node"&&e.child.state&&(se(e.child.state),e.child.state=null);for(const e of s.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(s.shape==="node"){s.node.parentNode&&s.node.parentNode.removeChild(s.node);return}for(const e of s.entries)e.state&&se(e.state),e.anchor.remove()}function wt(s){return s==null||s===!1?"":String(s)}async function $t(s){if(s==="")return!1;const e=globalThis.navigator?.clipboard;if(e?.writeText)try{return await e.writeText(s),!0}catch{}return Rs(s)}function Rs(s){const e=globalThis.document;if(!e?.body||typeof e.execCommand!="function")return!1;const t=e.createElement("textarea");t.value=s,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 o=e.activeElement;t.select();let i=!1;try{i=e.execCommand("copy")}catch{i=!1}return t.remove(),o?.focus?.(),i}const Is="data-os-mode";function Ue(s=typeof document<"u"?document.documentElement:null){return!!s&&s.getAttribute(Is)==="mobile"}function Ns(s){return s.phone??Ue()?b`<os-select | |
| 2 | 2 | class="os-app-list__status" |
| 3 | 3 | os-bind=${s.bind} |
| 4 | 4 | os-action=${s.action} |
| 5 | 5 | .value=${s.value} |
| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | os-bind=${s.bind} |
| 10 | 10 | os-action=${s.action} |
| 11 | 11 | value=${s.value} |
| 12 | 12 | label=${s.label} |
| 13 | - >${s.segments.map(t=>b`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function Os(s,e){const o=s.closest(".os-window")?.querySelector(".os-window__menu-panel")??null;if(!o||e.items.length===0)return null;const i=`${e.prefix}:`,a="data-os-app-menu-section";o.querySelectorAll(`[${a}="${e.prefix}"]`).forEach(d=>d.remove());const n=document.createElement("div");n.className="os-app__menu-section",n.setAttribute("role","presentation"),n.setAttribute(a,e.prefix),n.textContent=e.section,o.appendChild(n);const r=new Map;for(const d of e.items){const p=document.createElement("os-menu-item");p.setAttribute("role","menuitemcheckbox"),p.setAttribute("value",i+d.key),p.setAttribute(a,e.prefix),p.classList.add("os-window__menu-item","os-app__menu-item"),p.textContent=d.label||d.key,o.appendChild(p),r.set(d.key,p)}const l=()=>{for(const[d,p]of r)e.isChecked(d)?p.setAttribute("checked",""):p.removeAttribute("checked")};l();const c=d=>{const p=d.detail?.value;if(typeof p!="string"||!p.startsWith(i))return;const g=p.slice(i.length);r.has(g)&&(e.onToggle(g),l())};return o.addEventListener("os-menu-item-click",c),{refresh:l,dispose:()=>{o.removeEventListener("os-menu-item-click",c),n.remove();for(const d of r.values())d.remove();r.clear()}}}function qs(s,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&Ue(t)){s.hasAttribute("stacked")||s.setAttribute("stacked","");const a=s.getAttribute("sticky-columns");return a!==null&&(s.setAttribute("data-os-sticky-columns",a),s.removeAttribute("sticky-columns")),!0}s.hasAttribute("stacked")&&s.removeAttribute("stacked");const i=s.getAttribute("data-os-sticky-columns");return i!==null&&(s.setAttribute("sticky-columns",i),s.removeAttribute("data-os-sticky-columns")),!1}function Ct(s){return Array.from(s.selection??[],String)}function Ds(){let s=null,e=!1,t=null,o=null;return{invalidateColumns(){s=null},invalidateData(){o=null},sync(i){const a={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},n=i.table;if(!n)return a;const r=i.rowId??(c=>c.id),l=qs(n);if(a.phone=l,l!==s&&(s=l,n.columns=i.columns(l),a.columnsChanged=!0),e||(e=!0,i.wire?.(n)),i.listKey!==t&&(t=i.listKey,Ct(n).length>0&&(n.clearSelection(),a.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==o){o=i.fingerprint,n.data=i.rows,a.dataChanged=!0;const c=new Set(i.rows.map(g=>String(r(g)))),d=Ct(n),p=d.filter(g=>c.has(g));p.length!==d.length&&(n.selection=p,a.selectionChanged=!0,i.onSelection?.(p))}return a}}}function Hs(s,e){const t=e.local??{},o={id:s,hasLocal:n=>Object.prototype.hasOwnProperty.call(t,n),runLocal:(n,r,l,c)=>{const d=t[n];if(!d)return r;const p={...r},g=d(p,l,c);return g===void 0?p:g},render:n=>{Z(e.view(n),n.root),e.updated?.(n)},mounted:n=>e.mounted?.(n)},{placeholder:i}=e;i&&(o.placeholder=n=>i(n));const a=window;return(a.openStationApps??(a.openStationApps={}))[s]=o,o}const Fs=250,St=window.location.origin;let At=0;function Us(s,{timeoutMs:e=Fs}={}){const t=s?.contentWindow;if(!t)return Promise.resolve(!1);At+=1;const o=`os-unsaved-guard-${Date.now()}-${At}`;return new Promise(i=>{let a=null,n=!1;const r=c=>{n||(n=!0,window.removeEventListener("message",l),a!==null&&window.clearTimeout(a),i(c))},l=c=>{if(c.origin!==St)return;const d=c?.data;!d||typeof d!="object"||d.type!=="os-bridge-beforeunload-response"||d.requestId!==o||r(d.prevent===!0)};window.addEventListener("message",l),a=window.setTimeout(()=>r(!1),e);try{t.postMessage({type:"os-bridge-beforeunload-query",requestId:o},St)}catch{r(!1)}})}class Vs extends Error{constructor(e,t){super(e||t.serverMessage||`HTTP ${t.status}`),this.name="RestError",this.status=t.status,this.code=t.code,this.data=t.data,this.serverMessage=t.serverMessage??""}}function Et(s){return s instanceof Vs}const Ws="rest_cookie_invalid_nonce",zt=()=>u("Could not reach the site. Check your connection and try again.","desktop-mode");function Tt(s){return typeof navigator<"u"&&navigator.onLine===!1?!0:s instanceof TypeError}function js(s){return Et(s)?s.code===Ws||s.status===401?"session":s.status>=200&&s.status<300?"unreadable":s.status===404?"gone":s.status>=500?"server":s.status>=400?"refused":"unknown":Tt(s)?"offline":"unknown"}function Ks(s){return Et(s)?s.serverMessage:Tt(s)?zt():s instanceof Error?s.message:""}function Bs(s,e){const{fallback:t,lead:o}=e,i=js(s),a=i==="offline"||i==="unreadable"?"warning":"error";let n="",r=!0;switch(i){case"offline":n=zt();break;case"session":n=u("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":n=u("The site sent an unreadable reply. Reload the page to check whether the change went through.","desktop-mode");break;case"gone":case"refused":case"server":{const c=s;c.serverMessage?n=c.serverMessage:i==="gone"?(n=u("It no longer exists. Reload the page to catch up.","desktop-mode"),r=!1):i==="server"?(n=H(u("The server answered with error %d.","desktop-mode"),c.status),r=!1):(n=H(u("The server refused the request (HTTP %d).","desktop-mode"),c.status),r=!1);break}case"unknown":default:n=Ks(s);break}let l;return o?l=n?`${o}: ${n}`:t:n?r?l=n:l=`${t} ${n}`:l=t,{message:l,reason:n,kind:i,type:a}}function Gs(s,e,t){if(!s)return;const{duration:o,...i}=t,a=Bs(e,i),n={message:a.message,type:a.type};o&&(n.duration=o),s(n)}const Ve=new Map;async function Zs(s){if(!s)return null;let e;try{e=new URL(s,window.location.href)}catch{return s}if(!/gravatar\.com$/i.test(e.hostname))return s;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),o=Ve.get(t);if(o!==void 0)return o instanceof Promise,o;const i=new URL(s,window.location.href);i.searchParams.set("d","blank");const a=new Promise(n=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d",{willReadFrequently:!0});if(!c){n(s);return}c.drawImage(r,0,0,1,1);const d=c.getImageData(0,0,1,1).data;n(d[3]===0?null:s)}catch{n(s)}},r.onerror=()=>n(null),r.src=i.toString()}).then(n=>(Ve.set(t,n),n));return Ve.set(t,a),a}function Xs(s){return s?.["48"]??s?.["96"]??s?.["24"]??""}function Ys(s,e){e&&Zs(e).then(t=>{s.isConnected&&(t?s.setAttribute("src",t):s.removeAttribute("src"))})}function ue(s){const e=document.createElement("textarea");return e.innerHTML=s,e.value}const ne=class ne 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(Pt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,o){if(t===o)return;const i=Js(e);this._propValues[i]=o,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const o=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=o.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 o=Pt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(o),set:i=>{let a;i==null||i===!1?a=null:i===!0?a="":a=String(i),this._propValues[t]=a,a===null?this.removeAttribute(o):this.setAttribute(o,a),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Z(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(o=>o.sheet).filter(o=>o!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const o of e.styles)if(!o.sheet){const i=document.createElement("style");i.textContent=o.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!ne._lightStylesAdopted.has(e)){ne._lightStylesAdopted.add(e);for(const t of e.styles){const o=document.createElement("style");o.dataset.osUi=this.tagName.toLowerCase(),o.textContent=t.cssText,document.head.appendChild(o)}}}};ne.props=[],ne.styles=[],ne.shadow=!0,ne._lightStylesAdopted=new WeakSet;let U=ne;function W(s,e){customElements.get(s)||customElements.define(s,e)}function Pt(s){return s.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Js(s){return s.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Qs=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function R(s,...e){let t=s[0];for(let o=1;o<s.length;o++){const i=e[o-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+=s[o]}if(Qs){const o=new CSSStyleSheet;return o.replaceSync(t),{__wpdCss:!0,sheet:o,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function eo(s){const e=[],t=[];let o=null,i=s.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const n=i.id||"";if(n.startsWith("wp-window-")){o=n.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const r=i.getAttribute("for");r&&t.unshift(r)}i=i.parentElement}o&&e.push(We(o));for(const n of t)e.push("tab-"+We(n));const a=s.getAttribute("label");return a&&e.push(We(a)),e.length===0?"os-unnamed":"os-"+e.filter(n=>n!=="").join("-")}function We(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Mt(s){if(s.id)return s.id;const e=eo(s);return s.id=e,e}function to(s){if(!s)return 214;let e=5381;for(let t=0;t<s.length;t++)e=Math.imul(e,33)+s.charCodeAt(t);return(e%360+360)%360}const so=R`: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},Rt=new Set(["online","inactive","offline"]),me=class me extends U{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,o){super.attributeChangedCallback(e,t,o),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",o=this._attr("alt"),i=o!==null?o:t,a=this._attr("size"),n=this._resolveSize(a),r=this._presenceForRender(),l=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${n}px`);const c=e&&!this._imgFailed?"":this._initialsBg(t),d=e&&!this._imgFailed?b`<img | |
| 13 | + >${s.segments.map(t=>b`<os-segment value=${t.value}>${t.label}</os-segment>`)}</os-segmented>`}function Os(s,e){const o=s.closest(".os-window")?.querySelector(".os-window__menu-panel")??null;if(!o||e.items.length===0)return null;const i=`${e.prefix}:`,a="data-os-app-menu-section";o.querySelectorAll(`[${a}="${e.prefix}"]`).forEach(d=>d.remove());const n=document.createElement("div");n.className="os-app__menu-section",n.setAttribute("role","presentation"),n.setAttribute(a,e.prefix),n.textContent=e.section,o.appendChild(n);const r=new Map;for(const d of e.items){const p=document.createElement("os-menu-item");p.setAttribute("role","menuitemcheckbox"),p.setAttribute("value",i+d.key),p.setAttribute(a,e.prefix),p.classList.add("os-window__menu-item","os-app__menu-item"),p.textContent=d.label||d.key,o.appendChild(p),r.set(d.key,p)}const l=()=>{for(const[d,p]of r)e.isChecked(d)?p.setAttribute("checked",""):p.removeAttribute("checked")};l();const c=d=>{const p=d.detail?.value;if(typeof p!="string"||!p.startsWith(i))return;const g=p.slice(i.length);r.has(g)&&(e.onToggle(g),l())};return o.addEventListener("os-menu-item-click",c),{refresh:l,dispose:()=>{o.removeEventListener("os-menu-item-click",c),n.remove();for(const d of r.values())d.remove();r.clear()}}}function qs(s,e=null){const t=e??(typeof document<"u"?document.documentElement:null);if(!!t&&Ue(t)){s.hasAttribute("stacked")||s.setAttribute("stacked","");const a=s.getAttribute("sticky-columns");return a!==null&&(s.setAttribute("data-os-sticky-columns",a),s.removeAttribute("sticky-columns")),!0}s.hasAttribute("stacked")&&s.removeAttribute("stacked");const i=s.getAttribute("data-os-sticky-columns");return i!==null&&(s.setAttribute("sticky-columns",i),s.removeAttribute("data-os-sticky-columns")),!1}function Ct(s){return Array.from(s.selection??[],String)}function Ds(){let s=null,e=!1,t=null,o=null;return{invalidateColumns(){s=null},invalidateData(){o=null},sync(i){const a={phone:!1,columnsChanged:!1,dataChanged:!1,selectionChanged:!1},n=i.table;if(!n)return a;const r=i.rowId??(c=>c.id),l=qs(n);if(a.phone=l,l!==s&&(s=l,n.columns=i.columns(l),a.columnsChanged=!0),e||(e=!0,i.wire?.(n)),i.listKey!==t&&(t=i.listKey,Ct(n).length>0&&(n.clearSelection(),a.selectionChanged=!0,i.onSelection?.([]))),i.fingerprint!==o){o=i.fingerprint,n.data=i.rows,a.dataChanged=!0;const c=new Set(i.rows.map(g=>String(r(g)))),d=Ct(n),p=d.filter(g=>c.has(g));p.length!==d.length&&(n.selection=p,a.selectionChanged=!0,i.onSelection?.(p))}return a}}}function Hs(s,e){const t=e.local??{},o={id:s,hasLocal:n=>Object.prototype.hasOwnProperty.call(t,n),runLocal:(n,r,l,c)=>{const d=t[n];if(!d)return r;const p={...r},g=d(p,l,c);return g===void 0?p:g},render:n=>{Z(e.view(n),n.root),e.updated?.(n)},mounted:n=>e.mounted?.(n)},{placeholder:i}=e;i&&(o.placeholder=n=>i(n));const a=window;return(a.openStationApps??(a.openStationApps={}))[s]=o,o}const Fs=250,St=window.location.origin;let At=0;function Us(s,{timeoutMs:e=Fs}={}){const t=s?.contentWindow;if(!t)return Promise.resolve(!1);At+=1;const o=`os-unsaved-guard-${Date.now()}-${At}`;return new Promise(i=>{let a=null,n=!1;const r=c=>{n||(n=!0,window.removeEventListener("message",l),a!==null&&window.clearTimeout(a),i(c))},l=c=>{if(c.origin!==St)return;const d=c?.data;!d||typeof d!="object"||d.type!=="os-bridge-beforeunload-response"||d.requestId!==o||r(d.prevent===!0)};window.addEventListener("message",l),a=window.setTimeout(()=>r(!1),e);try{t.postMessage({type:"os-bridge-beforeunload-query",requestId:o},St)}catch{r(!1)}})}class Vs extends Error{constructor(e,t){super(e||t.serverMessage||`HTTP ${t.status}`),this.name="RestError",this.status=t.status,this.code=t.code,this.data=t.data,this.serverMessage=t.serverMessage??""}}function Et(s){return s instanceof Vs}const Ws="rest_cookie_invalid_nonce",zt=()=>u("Could not reach the site. Check your connection and try again.","desktop-mode");function Tt(s){return typeof navigator<"u"&&navigator.onLine===!1?!0:s instanceof TypeError}function js(s){return Et(s)?s.code===Ws||s.status===401?"session":s.status>=200&&s.status<300?"unreadable":s.status===404?"gone":s.status>=500?"server":s.status>=400?"refused":"unknown":Tt(s)?"offline":"unknown"}function Ks(s){return Et(s)?s.serverMessage:Tt(s)?zt():s instanceof Error?s.message:""}function Bs(s,e){const{fallback:t,lead:o}=e,i=js(s),a=i==="offline"||i==="unreadable"?"warning":"error";let n="",r=!0;switch(i){case"offline":n=zt();break;case"session":n=u("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":n=u("The site sent an unreadable reply. Reload the page to check whether the change went through.","desktop-mode");break;case"gone":case"refused":case"server":{const c=s;c.serverMessage?n=c.serverMessage:i==="gone"?(n=u("It no longer exists. Reload the page to catch up.","desktop-mode"),r=!1):i==="server"?(n=H(u("The server answered with error %d.","desktop-mode"),c.status),r=!1):(n=H(u("The server refused the request (HTTP %d).","desktop-mode"),c.status),r=!1);break}case"unknown":default:n=Ks(s);break}let l;return o?l=n?`${o}: ${n}`:t:n?r?l=n:l=`${t} ${n}`:l=t,{message:l,reason:n,kind:i,type:a}}function Gs(s,e,t){if(!s)return;const{duration:o,...i}=t,a=Bs(e,i),n={message:a.message,type:a.type};o&&(n.duration=o),s(n)}const Ve=new Map;async function Zs(s){if(!s)return null;let e;try{e=new URL(s,window.location.href)}catch{return s}if(!/gravatar\.com$/i.test(e.hostname))return s;e.searchParams.delete("d"),e.searchParams.delete("s");const t=e.toString(),o=Ve.get(t);if(o!==void 0)return o instanceof Promise,o;const i=new URL(s,window.location.href);i.searchParams.set("d","blank");const a=new Promise(n=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{try{const l=document.createElement("canvas");l.width=1,l.height=1;const c=l.getContext("2d",{willReadFrequently:!0});if(!c){n(s);return}c.drawImage(r,0,0,1,1);const d=c.getImageData(0,0,1,1).data;n(d[3]===0?null:s)}catch{n(s)}},r.onerror=()=>n(null),r.src=i.toString()}).then(n=>(Ve.set(t,n),n));return Ve.set(t,a),a}function Xs(s){return s?.["48"]??s?.["96"]??s?.["24"]??""}function Ys(s,e){e&&Zs(e).then(t=>{s.isConnected&&(t?s.setAttribute("src",t):s.removeAttribute("src"))})}function ae(s){const e=document.createElement("textarea");return e.innerHTML=s,e.value}const ne=class ne 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(Pt)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,o){if(t===o)return;const i=Js(e);this._propValues[i]=o,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const o=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=o.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 o=Pt(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(o),set:i=>{let a;i==null||i===!1?a=null:i===!0?a="":a=String(i),this._propValues[t]=a,a===null?this.removeAttribute(o):this.setAttribute(o,a),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Z(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(o=>o.sheet).filter(o=>o!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const o of e.styles)if(!o.sheet){const i=document.createElement("style");i.textContent=o.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!ne._lightStylesAdopted.has(e)){ne._lightStylesAdopted.add(e);for(const t of e.styles){const o=document.createElement("style");o.dataset.osUi=this.tagName.toLowerCase(),o.textContent=t.cssText,document.head.appendChild(o)}}}};ne.props=[],ne.styles=[],ne.shadow=!0,ne._lightStylesAdopted=new WeakSet;let U=ne;function W(s,e){customElements.get(s)||customElements.define(s,e)}function Pt(s){return s.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function Js(s){return s.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const Qs=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function R(s,...e){let t=s[0];for(let o=1;o<s.length;o++){const i=e[o-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+=s[o]}if(Qs){const o=new CSSStyleSheet;return o.replaceSync(t),{__wpdCss:!0,sheet:o,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function eo(s){const e=[],t=[];let o=null,i=s.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const n=i.id||"";if(n.startsWith("wp-window-")){o=n.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const r=i.getAttribute("for");r&&t.unshift(r)}i=i.parentElement}o&&e.push(We(o));for(const n of t)e.push("tab-"+We(n));const a=s.getAttribute("label");return a&&e.push(We(a)),e.length===0?"os-unnamed":"os-"+e.filter(n=>n!=="").join("-")}function We(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Mt(s){if(s.id)return s.id;const e=eo(s);return s.id=e,e}function to(s){if(!s)return 214;let e=5381;for(let t=0;t<s.length;t++)e=Math.imul(e,33)+s.charCodeAt(t);return(e%360+360)%360}const so=R`: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},Rt=new Set(["online","inactive","offline"]),me=class me extends U{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,o){super.attributeChangedCallback(e,t,o),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",o=this._attr("alt"),i=o!==null?o:t,a=this._attr("size"),n=this._resolveSize(a),r=this._presenceForRender(),l=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${n}px`);const c=e&&!this._imgFailed?"":this._initialsBg(t),d=e&&!this._imgFailed?b`<img | |
| 14 | 14 | src=${e} |
| 15 | 15 | alt=${i} |
| 16 | 16 | @error=${()=>this._onImgError()} |
| 17 | 17 | loading="lazy" |
| @@ -36,9 +36,9 @@ | ||
| 36 | 36 | >${d}</div> |
| 37 | 37 | ${p} |
| 38 | 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=to(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&Rt.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"),o={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",o)}_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 o=this.getBoundingClientRect();if(o.width===0||o.height===0)return;const i=(t.clientX-o.left)/o.width-.5,a=(t.clientY-o.top)/o.height-.5,n=14;this._pendingTiltY=`${(i*n).toFixed(2)}deg`,this._pendingTiltX=`${(-a*n).toFixed(2)}deg`;const r=Math.max(0,Math.min(100,(i+.5)*100)),l=Math.max(0,Math.min(100,(a+.5)*100));this._pendingGlareX=`${r.toFixed(1)}%`,this._pendingGlareY=`${l.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"),o=!!e&&!t;o&&!this._presenceHandler?(this._presenceHandler=i=>{const a=i.detail;a&&String(a.userId)===String(e)&&a.newStatus&&Rt.has(a.newStatus)&&this.setAttribute("presence",a.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!o&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};me.props=["src","alt","name","size","presence","userId","clickable"],me.styles=[so],me.help=void 0;let je=me;W("os-avatar",je);const oo=R`:host{display:inline;color:inherit;font:inherit}`,ze=new Set;let he=null;const io=3e4;function no(){he===null&&(he=window.setInterval(()=>{for(const s of ze)s.tick()},io))}function ao(){he!==null&&ze.size===0&&(window.clearInterval(he),he=null)}function ro(s){if(!s)return null;const e=t=>{const o=new Date(t);return Number.isNaN(o.getTime())?null:o};return lo(s)?e(s):e(s.replace(" ","T")+"Z")}function lo(s){const e=Math.max(s.indexOf("T"),s.indexOf(" ")),t=e===-1?"":s.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let Ke=null,Be=null;function It(){return typeof navigator<"u"&&navigator.language||"en"}function co(){return Ke||(Ke=new Intl.RelativeTimeFormat(It(),{numeric:"auto"})),Ke}function Nt(){return Be||(Be=new Intl.RelativeTimeFormat(It(),{numeric:"always",style:"narrow"})),Be}function po(s,e){const t=co(),o=s.getTime()-e,i=Math.round(o/1e3),a=Math.abs;return a(i)<45?t.format(0,"second"):Ot(t,i)}function Ot(s,e){const t=Math.abs,o=Math.round(e/60);if(t(o)<45)return s.format(o,"minute");const i=Math.round(o/60);if(t(i)<22)return s.format(i,"hour");const a=Math.round(i/24);if(t(a)<26)return s.format(a,"day");const n=Math.round(a/30);if(t(n)<11)return s.format(n,"month");const r=Math.round(a/365);return s.format(r,"year")}function uo(s,e){const t=Math.round((s.getTime()-e)/1e3),o=Math.abs;return o(t)<45?Nt().format(0,"second"):o(t)>604800?s.toLocaleDateString(void 0,{month:"short",day:"numeric"}):Ot(Nt(),t)}const be=class be extends U{connectedCallback(){super.connectedCallback(),ze.add(this),no()}disconnectedCallback(){ze.delete(this),ao()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=ro(e);if(!t)return b`<span>${e??""}</span>`;const o=Date.now(),i=this.hasAttribute("compact")?uo(t,o):po(t,o),a=t.toLocaleString();return b`<time datetime=${t.toISOString()} title=${a} |
| 39 | 39 | >${i}</time |
| 40 | - >`}};be.props=["datetime","compact"],be.styles=[oo],be.help=void 0;let Ge=be;W("os-relative-time",Ge);function X(s,e,t,o){const i=`${e}|${t}`,a=s.get(i);if(a)return a;const n=o();return s.set(i,n),n}const Ze={publish:u("Published"),future:u("Scheduled"),draft:u("Draft"),pending:u("Pending"),private:u("Private"),trash:u("Trash")};function ho(s){switch(s){case"publish":return{bg:"var(--os-ui-surface-raised, #e6f4ea)",fg:"var(--os-ui-success-fg, #1d6f42)"};case"draft":return{bg:"var(--os-ui-surface-raised, #fdecea)",fg:"var(--os-ui-danger, #a02622)"};case"pending":return{bg:"var(--os-ui-warning-bg, #fef7e0)",fg:"var(--os-ui-warning-fg, #8a6d00)"};case"private":return{bg:"var(--os-ui-info-bg, #e8f0fe)",fg:"var(--os-ui-info-fg, #1a52a8)"};case"future":return{bg:"var(--os-ui-surface-raised, #ede7f6)",fg:"var(--os-ui-accent, #5b3aa0)"};default:return{bg:"var(--os-ui-surface-raised, #f1f1f2)",fg:"var(--os-ui-fg-muted, #50575e)"}}}function Te(s,e){const t=s.editPostUrlBase??"",o=t.includes("?")?"&":"?";return`${t}${o}post=${e}&action=edit`}function Xe(s){const e=s._embedded?.author?.[0];return e?{id:e.id,name:e.name,avatar:Xs(e.avatar_urls)||void 0}:{id:s.author,name:u("Unknown")}}function fo(s,e){for(const t of s._embedded?.["wp:term"]??[])if(t.length>0&&t[0].taxonomy===e)return t.map(o=>({id:o.id,name:o.name}));return[]}function Ye(s){const e=s._embedded?.["wp:featuredmedia"]?.[0];if(!e)return null;const t=e.media_details?.sizes??{};return{url:t.thumbnail?.source_url??t.medium?.source_url??e.source_url,alt:e.alt_text??""}}function re(s){return ue(s.title.rendered)}function Pe(s,e,t={}){const o=document.createElement("span");o.style.cssText=["display:inline-flex","align-items:center","gap:4px","padding:2px 8px","border-radius:10px","font-size:11px","font-weight:600",t.uppercase?"text-transform:uppercase;letter-spacing:0.04em":"",`background:${e.bg}`,`color:${e.fg}`,"white-space:nowrap","flex-shrink:0"].filter(Boolean).join(";"),t.icon&&o.appendChild(t.icon);const i=document.createElement("span");return i.textContent=s,o.appendChild(i),t.title&&(o.title=t.title),o}function qt(s,e=13){const t=document.createElement("span");return t.className=`dashicons ${s}`,t.setAttribute("aria-hidden","true"),t.style.cssText=`font-size:${e}px;width:${e}px;height:${e}px;line-height:1;`,t}function go(){const s=document.createElement("span");return s.setAttribute("aria-hidden","true"),s.style.cssText="font-family:dashicons;font-size:14px;line-height:1;display:inline-block;speak:none;-webkit-font-smoothing:antialiased",s.textContent="",s}function Dt(s){s.addEventListener("mouseenter",()=>{s.style.textDecoration="underline"}),s.addEventListener("mouseleave",()=>{s.style.textDecoration="none"})}function mo(s,e){const t=document.createElement("span");t.style.cssText="display:flex;flex-direction:column;gap:4px;min-width:0;";const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;gap:8px;min-width:0;";const i=document.createElement("a");i.href=Te(e.extra,s.id),i.setAttribute("data-noclick","");const a=re(s)||u("(no title)");i.textContent=a,i.title=a,i.style.cssText="font-weight:600;color:inherit;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px;",Dt(i),i.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.openUrl(i.href,a,"dashicons-admin-post")}),o.appendChild(i);const n=s.openstation_lock??null;n&&o.appendChild(Pe(n.userName,{fg:"var(--os-ui-danger, #b32d2e)",bg:"var(--os-ui-surface-raised, rgba(179, 45, 46, 0.1))"},{icon:go(),title:H(u("%s is currently editing"),n.userName)}));const r=e.extra.mode==="pages";if(r&&typeof e.extra.frontPageId=="number"&&e.extra.frontPageId===s.id&&o.appendChild(Pe(u("Front page"),{fg:"var(--os-ui-info-fg, #0a4b78)",bg:"var(--os-ui-info-bg, rgba(34,113,177,0.12))"},{icon:qt("dashicons-admin-home")})),r&&typeof e.extra.postsPageId=="number"&&e.extra.postsPageId===s.id&&o.appendChild(Pe(u("Posts page"),{fg:"var(--os-ui-accent, #5b3aa0)",bg:"var(--os-ui-surface-raised, rgba(91,58,160,0.12))"},{icon:qt("dashicons-admin-post")})),s.status&&s.status!=="publish"&&o.appendChild(Pe(Ze[s.status]??s.status,ho(s.status),{uppercase:!0})),r&&typeof s.link=="string"&&s.link&&s.status==="publish"){const l=document.createElement("a");l.href=s.link,l.target="_blank",l.rel="noreferrer noopener",l.textContent=u("View"),l.title=s.link,l.setAttribute("data-noclick",""),l.style.cssText="font-size:11px;color:var(--wp-admin-theme-color, #2271b1);text-decoration:none;flex-shrink:0;",l.addEventListener("click",c=>c.stopPropagation()),Dt(l),o.appendChild(l)}return t.appendChild(o),t}function bo(s){const e=Xe(s),t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:8px;min-width:0;";const o=document.createElement("os-avatar");o.setAttribute("size","24"),e.name&&o.setAttribute("name",e.name),e.id>0&&o.setAttribute("user-id",String(e.id)),e.avatar&&Ys(o,e.avatar),t.appendChild(o);const i=document.createElement("span");return i.textContent=e.name,i.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",t.appendChild(i),t}function _o(s){const e=document.createElement("span");e.style.cssText="display:flex;flex-direction:column;line-height:1.2;";const t=document.createElement("os-relative-time");if(t.setAttribute("datetime",s.date_gmt||s.date),e.appendChild(t),s.modified_gmt&&s.modified_gmt!==s.date_gmt){const o=document.createElement("span");o.textContent=u("modified"),o.style.cssText="font-size:11px;color:var(--os-ui-fg-muted, #646970);",e.appendChild(o)}return e}function vo(s){const e=document.createElement("div");e.style.cssText="display:flex;gap:16px;padding:12px 16px;background:var(--os-ui-surface-sunken, #fafafa);align-items:flex-start;";const t=Ye(s);if(t){const r=document.createElement("img");r.src=t.url,r.alt=t.alt,r.loading="lazy",r.style.cssText="width:96px;height:96px;border-radius:6px;object-fit:cover;flex-shrink:0;",e.appendChild(r)}const o=document.createElement("div");o.style.cssText="flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;";const i=document.createElement("div");i.style.cssText="font-size:13px;color:var(--os-ui-fg-muted, #646970);text-transform:uppercase;letter-spacing:0.04em;",i.textContent=u("Excerpt"),o.appendChild(i);const a=document.createElement("div");a.style.cssText="color:var(--os-ui-fg, #1d2327);line-height:1.5;";const n=s.excerpt?.rendered??"";return n?a.textContent=ue(n.replace(/<[^>]+>/g,"").trim())||u("(no excerpt)"):(a.textContent=u("(no excerpt)"),a.style.color="var(--os-ui-fg-muted, #a7aaad)"),o.appendChild(a),e.appendChild(o),e}const Ht={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function Ft(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xo(s){return Object.prototype.hasOwnProperty.call(Ht,s)?Ht[s]:null}function yo(s,e={}){const t=xo(s);if(!t)return"";const{size:o=24,className:i,title:a,rotate:n}=e,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];o!=null&&r.push(`width="${o}"`,`height="${o}"`),r.push(t.a),i&&r.push(`class="${Ft(i)}"`),a?r.push('role="img"',`aria-label="${Ft(a)}"`):r.push('aria-hidden="true"','focusable="false"');const l=n?`<g transform="rotate(${n} 12 12)">${t.b}</g>`:t.b;return`<svg ${r.join(" ")}>${l}</svg>`}function Y(s,e={}){const t=yo(s,e),o=document.createElement("div");o.innerHTML=t;const i=o.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}const ko=R`:host{display:flex;width:100%;min-width:0;max-width:100%;align-items:stretch}.os-cat{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:var( --os-ui-cat-padding,2px );min-height:24px;max-width:100%;width:100%}.os-cat__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-cat-gap,4px );min-width:0}.os-cat__chains{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.os-cat__viz-host{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;max-width:100%;min-height:28px;cursor:pointer;position:relative}.os-cat__viz-svg{display:block;width:100%;max-width:100%;min-width:0;overflow:visible;flex:1 1 auto}.os-cat__viz-svg .os-cat-edge{fill:none;stroke:var( --os-ui-cat-edge-color,currentColor );stroke-width:1.25;stroke-linecap:round;opacity:0.55;transition:stroke-width 0.18s ease,opacity 0.18s ease}.os-cat__viz-svg .os-cat-edge[ data-active='true' ]{stroke-width:2;opacity:1}.os-cat__viz-svg .os-cat-node{cursor:pointer;transition:r 0.2s cubic-bezier( 0.34,1.56,0.64,1 ),fill 0.18s ease,stroke-width 0.18s ease,filter 0.18s ease}.os-cat__viz-svg .os-cat-node[ data-selected='true' ]{filter:drop-shadow( 0 0 6px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.18 ) ) )}.os-cat__viz-svg .os-cat-node:hover,.os-cat__viz-svg .os-cat-node:focus-visible{filter:drop-shadow( 0 0 8px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.3 ) ) );outline:none}.os-cat__viz-svg .os-cat-label{font-family:var( --os-ui-font,system-ui,sans-serif );font-size:10.5px;fill:var( --os-ui-cat-label-fg,var( --os-ui-fg,#1d2327 ) );font-weight:500;pointer-events:none;user-select:none}.os-cat__viz-svg .os-cat-label[ data-selected='false' ]{fill:var( --os-ui-cat-label-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-weight:400;font-style:italic}.os-cat__trigger{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-cat-trigger-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-cat-trigger-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-cat__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-cat-trigger-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-cat-trigger-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-cat__trigger:focus-visible{outline:none;border-style:solid;box-shadow:0 0 0 2px var( --wp-admin-theme-color,#2271b1 )}.os-cat__trigger svg{display:block}.os-cat__uncategorized{display:inline-flex;align-items:center;gap:4px;padding:1px 10px;min-height:22px;font-size:11px;font-weight:500;line-height:1.6;color:var( --os-ui-cat-uncat-fg,var( --os-ui-fg-muted,#8c8f94 ) );background:transparent;border:1px dashed var( --os-ui-cat-uncat-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;font-style:italic}.os-cat__popover{position:fixed;top:0;left:0;min-width:280px;max-width:360px;max-height:360px;display:flex;flex-direction:column;background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-cat-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-cat-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:1000}.os-cat__editor{position:relative;display:inline-flex;align-items:center}.os-cat__search{appearance:none;font:inherit;font-size:13px;padding:8px 12px;border:0;border-bottom:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );background:transparent;color:inherit;outline:none}.os-cat__search:focus{border-bottom-color:var( --wp-admin-theme-color,#2271b1 )}.os-cat__tree{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0}.os-cat__row-block{display:contents}.os-cat__row{display:flex;align-items:center;gap:6px;padding:4px 8px 4px var( --os-ui-cat-row-indent,12px );cursor:pointer;user-select:none;font-size:13px;line-height:1.4;position:relative}.os-cat__row:hover,.os-cat__row[ data-focused='true' ]{background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) )}.os-cat__row[ data-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 );font-weight:600}.os-cat__row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__expander{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:0;background:transparent;color:inherit;cursor:pointer;flex-shrink:0;opacity:0.65}.os-cat__expander:hover{opacity:1}.os-cat__expander svg{display:block;transition:transform 0.12s ease}.os-cat__row[ data-expanded='true' ] .os-cat__expander svg{transform:rotate( 90deg )}.os-cat__expander--placeholder{visibility:hidden}.os-cat__create-row{display:flex;align-items:center;padding:2px 8px 2px var( --os-ui-cat-row-indent,28px );position:relative}.os-cat__create-row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__create-wrap{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;padding:1px 1px 1px 0;border:1px solid transparent;border-radius:6px;background:transparent;transition:border-color 0.12s ease,background-color 0.12s ease,box-shadow 0.12s ease}.os-cat__create-wrap:hover{border-color:var( --os-ui-border,rgba( 0,0,0,0.12 ) );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) )}.os-cat__create-wrap:focus-within{border-color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );box-shadow:0 0 0 2px color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 15%,transparent )}.os-cat__create-input{flex:1 1 auto;min-width:0;appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );padding:3px 6px;border:0;background:transparent;color:inherit;outline:none}.os-cat__create-input::placeholder{color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-style:italic;opacity:1}.os-cat__create-submit{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}.os-cat__create-wrap:focus-within .os-cat__create-submit:not( [ disabled ] ){background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__create-submit:hover:not( [ disabled ] ){filter:brightness( 1.05 )}.os-cat__create-submit[ disabled ]{cursor:default;opacity:0.5}.os-cat__create-submit svg{display:block}.os-cat__create-spinner{display:inline-block;width:12px;height:12px;margin:0 4px;border-radius:50%;border:2px solid var( --wp-admin-theme-color,#2271b1 );border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;flex-shrink:0}.os-cat__check{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;border:1.5px solid var( --os-ui-cat-check-border,var( --os-ui-border,#8c8f94 ) );border-radius:3px;color:transparent;transition:background-color 0.12s ease,border-color 0.12s ease,color 0.12s ease}.os-cat__row[ data-selected='true' ] .os-cat__check{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__check svg{display:block;width:14px;height:14px}.os-cat__label{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-cat__delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:transparent;color:var( --os-ui-cat-delete-color,var( --os-ui-danger,#d63638 ) );cursor:pointer;opacity:0;transition:opacity 0.12s ease,background-color 0.12s ease}.os-cat__row:hover .os-cat__delete,.os-cat__row[ data-focused='true' ] .os-cat__delete,.os-cat__delete:focus-visible{opacity:1}.os-cat__delete:hover,.os-cat__delete:focus-visible{background:var( --os-ui-badge-danger-bg,rgba( 214,54,56,0.12 ) )}.os-cat__delete svg{display:block;width:14px;height:14px}.os-cat__match{background:var( --os-ui-search-highlight-bg,rgba( 252,211,77,0.45 ) );border-radius:2px;padding:0 1px}.os-cat__empty,.os-cat__loading{padding:12px;font-size:12px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );text-align:center}.os-cat__loading-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;margin-inline-end:8px;vertical-align:middle}@keyframes os-cat-spin{to{transform:rotate( 360deg )}}.os-cat__footer{padding:8px 12px;font-size:11px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );border-top:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );border-radius:10px;background:var( --os-ui-cat-pop-footer-bg,var( --os-ui-surface,#fafafb ) );display:flex;align-items:center;gap:6px;line-height:1.4}.os-cat__footer .dashicons{font-size:14px;width:14px;height:14px;flex-shrink:0}:host( [ disabled ] ) .os-cat{opacity:0.6;pointer-events:none}`,fe=R`: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 ) )}`,wo=R` .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%}}`,$o=R` .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%}}`,Co=R` .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}}`,So=R` .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}}`,Ao=R` .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}}`,Eo=R` .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%}}`,zo=R` .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}}`,To=R` 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}}`,Je=R` 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}}`,Po=R` @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}}`;R` ${fe} ${wo} ${$o} ${Co} ${So} ${Ao} ${Eo} ${zo} ${To} ${Je} ${Po} `;const Mo=R` ${fe}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,_e=class _e extends U{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const i=this.label??"";this.emit("os-chip-dismiss",{label:i})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,o=this.disabled!==null;return b` | |
| 40 | + >`}};be.props=["datetime","compact"],be.styles=[oo],be.help=void 0;let Ge=be;W("os-relative-time",Ge);function X(s,e,t,o){const i=`${e}|${t}`,a=s.get(i);if(a)return a;const n=o();return s.set(i,n),n}const Ze={publish:u("Published"),future:u("Scheduled"),draft:u("Draft"),pending:u("Pending"),private:u("Private"),trash:u("Trash")};function ho(s){switch(s){case"publish":return{bg:"var(--os-ui-surface-raised, #e6f4ea)",fg:"var(--os-ui-success-fg, #1d6f42)"};case"draft":return{bg:"var(--os-ui-surface-raised, #fdecea)",fg:"var(--os-ui-danger, #a02622)"};case"pending":return{bg:"var(--os-ui-warning-bg, #fef7e0)",fg:"var(--os-ui-warning-fg, #8a6d00)"};case"private":return{bg:"var(--os-ui-info-bg, #e8f0fe)",fg:"var(--os-ui-info-fg, #1a52a8)"};case"future":return{bg:"var(--os-ui-surface-raised, #ede7f6)",fg:"var(--os-ui-accent, #5b3aa0)"};default:return{bg:"var(--os-ui-surface-raised, #f1f1f2)",fg:"var(--os-ui-fg-muted, #50575e)"}}}function Te(s,e){const t=s.editPostUrlBase??"",o=t.includes("?")?"&":"?";return`${t}${o}post=${e}&action=edit`}function Xe(s){const e=s._embedded?.author?.[0];return e?{id:e.id,name:ae(e.name??""),avatar:Xs(e.avatar_urls)||void 0}:{id:s.author,name:u("Unknown")}}function fo(s,e){for(const t of s._embedded?.["wp:term"]??[])if(t.length>0&&t[0].taxonomy===e)return t.map(o=>({id:o.id,name:o.name}));return[]}function Ye(s){const e=s._embedded?.["wp:featuredmedia"]?.[0];if(!e)return null;const t=e.media_details?.sizes??{};return{url:t.thumbnail?.source_url??t.medium?.source_url??e.source_url,alt:e.alt_text??""}}function le(s){return ae(s.title.rendered)}function Pe(s,e,t={}){const o=document.createElement("span");o.style.cssText=["display:inline-flex","align-items:center","gap:4px","padding:2px 8px","border-radius:10px","font-size:11px","font-weight:600",t.uppercase?"text-transform:uppercase;letter-spacing:0.04em":"",`background:${e.bg}`,`color:${e.fg}`,"white-space:nowrap","flex-shrink:0"].filter(Boolean).join(";"),t.icon&&o.appendChild(t.icon);const i=document.createElement("span");return i.textContent=s,o.appendChild(i),t.title&&(o.title=t.title),o}function qt(s,e=13){const t=document.createElement("span");return t.className=`dashicons ${s}`,t.setAttribute("aria-hidden","true"),t.style.cssText=`font-size:${e}px;width:${e}px;height:${e}px;line-height:1;`,t}function go(){const s=document.createElement("span");return s.setAttribute("aria-hidden","true"),s.style.cssText="font-family:dashicons;font-size:14px;line-height:1;display:inline-block;speak:none;-webkit-font-smoothing:antialiased",s.textContent="",s}function Dt(s){s.addEventListener("mouseenter",()=>{s.style.textDecoration="underline"}),s.addEventListener("mouseleave",()=>{s.style.textDecoration="none"})}function mo(s,e){const t=document.createElement("span");t.style.cssText="display:flex;flex-direction:column;gap:4px;min-width:0;";const o=document.createElement("span");o.style.cssText="display:flex;align-items:center;gap:8px;min-width:0;";const i=document.createElement("a");i.href=Te(e.extra,s.id),i.setAttribute("data-noclick","");const a=le(s)||u("(no title)");i.textContent=a,i.title=a,i.style.cssText="font-weight:600;color:inherit;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:340px;",Dt(i),i.addEventListener("click",l=>{l.preventDefault(),l.stopPropagation(),e.openUrl(i.href,a,"dashicons-admin-post")}),o.appendChild(i);const n=s.openstation_lock??null;n&&o.appendChild(Pe(n.userName,{fg:"var(--os-ui-danger, #b32d2e)",bg:"var(--os-ui-surface-raised, rgba(179, 45, 46, 0.1))"},{icon:go(),title:H(u("%s is currently editing"),n.userName)}));const r=e.extra.mode==="pages";if(r&&typeof e.extra.frontPageId=="number"&&e.extra.frontPageId===s.id&&o.appendChild(Pe(u("Front page"),{fg:"var(--os-ui-info-fg, #0a4b78)",bg:"var(--os-ui-info-bg, rgba(34,113,177,0.12))"},{icon:qt("dashicons-admin-home")})),r&&typeof e.extra.postsPageId=="number"&&e.extra.postsPageId===s.id&&o.appendChild(Pe(u("Posts page"),{fg:"var(--os-ui-accent, #5b3aa0)",bg:"var(--os-ui-surface-raised, rgba(91,58,160,0.12))"},{icon:qt("dashicons-admin-post")})),s.status&&s.status!=="publish"&&o.appendChild(Pe(Ze[s.status]??s.status,ho(s.status),{uppercase:!0})),r&&typeof s.link=="string"&&s.link&&s.status==="publish"){const l=document.createElement("a");l.href=s.link,l.target="_blank",l.rel="noreferrer noopener",l.textContent=u("View"),l.title=s.link,l.setAttribute("data-noclick",""),l.style.cssText="font-size:11px;color:var(--wp-admin-theme-color, #2271b1);text-decoration:none;flex-shrink:0;",l.addEventListener("click",c=>c.stopPropagation()),Dt(l),o.appendChild(l)}return t.appendChild(o),t}function bo(s){const e=Xe(s),t=document.createElement("span");t.style.cssText="display:inline-flex;align-items:center;gap:8px;min-width:0;";const o=document.createElement("os-avatar");o.setAttribute("size","24"),e.name&&o.setAttribute("name",e.name),e.id>0&&o.setAttribute("user-id",String(e.id)),e.avatar&&Ys(o,e.avatar),t.appendChild(o);const i=document.createElement("span");return i.textContent=e.name,i.style.cssText="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",t.appendChild(i),t}function _o(s){const e=document.createElement("span");e.style.cssText="display:flex;flex-direction:column;line-height:1.2;";const t=document.createElement("os-relative-time");if(t.setAttribute("datetime",s.date_gmt||s.date),e.appendChild(t),s.modified_gmt&&s.modified_gmt!==s.date_gmt){const o=document.createElement("span");o.textContent=u("modified"),o.style.cssText="font-size:11px;color:var(--os-ui-fg-muted, #646970);",e.appendChild(o)}return e}function vo(s){const e=document.createElement("div");e.style.cssText="display:flex;gap:16px;padding:12px 16px;background:var(--os-ui-surface-sunken, #fafafa);align-items:flex-start;";const t=Ye(s);if(t){const r=document.createElement("img");r.src=t.url,r.alt=t.alt,r.loading="lazy",r.style.cssText="width:96px;height:96px;border-radius:6px;object-fit:cover;flex-shrink:0;",e.appendChild(r)}const o=document.createElement("div");o.style.cssText="flex:1;min-width:0;display:flex;flex-direction:column;gap:6px;";const i=document.createElement("div");i.style.cssText="font-size:13px;color:var(--os-ui-fg-muted, #646970);text-transform:uppercase;letter-spacing:0.04em;",i.textContent=u("Excerpt"),o.appendChild(i);const a=document.createElement("div");a.style.cssText="color:var(--os-ui-fg, #1d2327);line-height:1.5;";const n=s.excerpt?.rendered??"";return n?a.textContent=ae(n.replace(/<[^>]+>/g,"").trim())||u("(no excerpt)"):(a.textContent=u("(no excerpt)"),a.style.color="var(--os-ui-fg-muted, #a7aaad)"),o.appendChild(a),e.appendChild(o),e}const Ht={close:{a:'fill="currentColor"',b:'<path d="m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" />'},check:{a:'fill="currentColor"',b:'<path d="M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" />'},"chevron-right":{a:'fill="currentColor"',b:'<path d="M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" />'},"arrow-up-right":{a:'fill="currentColor"',b:'<path d="M10 6H18V14H16.5V8.5L7 18L6 17L15.5 7.5H10V6Z" />'},plus:{a:'fill="currentColor"',b:'<path d="M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" />'},search:{a:'fill="currentColor"',b:'<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" />'},pin:{a:'fill="currentColor"',b:'<path d="m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" />'},trash:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" />'},download:{a:'fill="currentColor"',b:'<path d="M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" />'},settings:{a:'fill="currentColor"',b:'<path d="m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z" /><path d="m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z" />'},info:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" />'},bell:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17 11.5c0 1.353.17 2.368.976 3 .266.209.602.376 1.024.5v1H5v-1c.422-.124.757-.291 1.024-.5.806-.632.976-1.647.976-3V9c0-2.8 2.2-5 5-5s5 2.2 5 5v2.5ZM15.5 9v2.5c0 .93.066 1.98.515 2.897l.053.103H7.932a4.018 4.018 0 0 0 .053-.103c.449-.917.515-1.967.515-2.897V9c0-1.972 1.528-3.5 3.5-3.5s3.5 1.528 3.5 3.5Zm-5.492 9.008c0-.176.023-.346.065-.508h3.854A1.996 1.996 0 0 1 12 20c-1.1 0-1.992-.892-1.992-1.992Z" />'},more:{a:'fill="currentColor"',b:'<path d="M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z" />'},maximize:{a:'fill="currentColor"',b:'<path d="M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" />'},edit:{a:'fill="currentColor"',b:'<path d="m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" />'},color:{a:'fill="currentColor"',b:'<path d="M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" />'},wallpaper:{a:'fill="currentColor"',b:'<path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" />'},warning:{a:'fill="currentColor"',b:'<path fill-rule="evenodd" clip-rule="evenodd" d="M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" />'},minimize:{a:'fill="currentColor"',b:'<path d="M5 11.25h14v1.5H5z" />'},window:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="5.4375" width="15.75" height="13.125" rx="1.75"/><path d="M4.125 9.8125h15.75"/><circle cx="7.275" cy="7.625" r="0.7438" fill="currentColor" stroke="none"/>'},windows:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="8.5" width="11.375" height="10.0625" rx="1.75"/><path d="M3.6875 12h11.375"/><path d="M8.5 8.5V7.1875a1.75 1.75 0 0 1 1.75-1.75h7.875A1.75 1.75 0 0 1 19.875 7.1875v7a1.75 1.75 0 0 1-1.75 1.75h-3.0625"/>'},dock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.25" y="8.5" width="17.5" height="7" rx="3.5"/><circle cx="7.625" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="12" cy="12" r="1.0062" fill="currentColor" stroke="none"/><circle cx="16.375" cy="12" r="1.0062" fill="currentColor" stroke="none"/>'},spaces:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><rect x="12.875" y="5.4375" width="7.4375" height="7.875" rx="1.75"/><circle cx="9.375" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="12" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/><circle cx="14.625" cy="17.6875" r="0.7875" fill="currentColor" stroke="none"/>'},copilot:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M10 2.5Q10.9 8.5 17.5 10Q10.9 11.5 10 17.5Q9.1 11.5 2.5 10Q9.1 8.5 10 2.5Z" fill="currentColor" stroke="none"/><path d="M17.9 14Q18.35 17.1 21.5 17.6Q18.35 18.1 17.9 21.2Q17.45 18.1 14.3 17.6Q17.45 17.1 17.9 14Z" fill="currentColor" stroke="none"/>'},snap:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="5.4375" width="16.625" height="13.125" rx="1.75"/><path d="M12 5.4375v13.125"/><path d="M12 12h8.3125"/>'},command:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<path d="M14.625 6.75v10.5a2.625 2.625 0 1 0 2.625-2.625H6.75a2.625 2.625 0 1 0 2.625 2.625V6.75a2.625 2.625 0 1 0-2.625 2.625h10.5a2.625 2.625 0 1 0-2.625-2.625"/>'},apps:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="4.125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="4.125" width="6.5625" height="6.5625" rx="1.75"/><rect x="4.125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/><rect x="13.3125" y="13.3125" width="6.5625" height="6.5625" rx="1.75"/>'},widgets:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="3.6875" y="3.6875" width="9.625" height="9.625" rx="1.75"/><rect x="15.0625" y="3.6875" width="5.25" height="5.25" rx="1.75"/><rect x="15.0625" y="10.6875" width="5.25" height="9.625" rx="1.75"/><rect x="3.6875" y="15.0625" width="9.625" height="5.25" rx="1.75"/>'},user:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<circle cx="12" cy="8.9375" r="3.5"/><path d="M5.4375 19.4375a6.5625 6.5625 0 0 1 13.125 0"/>'},lock:{a:'fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"',b:'<rect x="5.4375" y="10.6875" width="13.125" height="8.75" rx="1.75"/><path d="M8.5 10.6875V8.0625a3.5 3.5 0 0 1 7 0v2.625"/>'}};function Ft(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function xo(s){return Object.prototype.hasOwnProperty.call(Ht,s)?Ht[s]:null}function yo(s,e={}){const t=xo(s);if(!t)return"";const{size:o=24,className:i,title:a,rotate:n}=e,r=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];o!=null&&r.push(`width="${o}"`,`height="${o}"`),r.push(t.a),i&&r.push(`class="${Ft(i)}"`),a?r.push('role="img"',`aria-label="${Ft(a)}"`):r.push('aria-hidden="true"','focusable="false"');const l=n?`<g transform="rotate(${n} 12 12)">${t.b}</g>`:t.b;return`<svg ${r.join(" ")}>${l}</svg>`}function Y(s,e={}){const t=yo(s,e),o=document.createElement("div");o.innerHTML=t;const i=o.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}const ko=R`:host{display:flex;width:100%;min-width:0;max-width:100%;align-items:stretch}.os-cat{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:var( --os-ui-cat-padding,2px );min-height:24px;max-width:100%;width:100%}.os-cat__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-cat-gap,4px );min-width:0}.os-cat__chains{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.os-cat__viz-host{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;max-width:100%;min-height:28px;cursor:pointer;position:relative}.os-cat__viz-svg{display:block;width:100%;max-width:100%;min-width:0;overflow:visible;flex:1 1 auto}.os-cat__viz-svg .os-cat-edge{fill:none;stroke:var( --os-ui-cat-edge-color,currentColor );stroke-width:1.25;stroke-linecap:round;opacity:0.55;transition:stroke-width 0.18s ease,opacity 0.18s ease}.os-cat__viz-svg .os-cat-edge[ data-active='true' ]{stroke-width:2;opacity:1}.os-cat__viz-svg .os-cat-node{cursor:pointer;transition:r 0.2s cubic-bezier( 0.34,1.56,0.64,1 ),fill 0.18s ease,stroke-width 0.18s ease,filter 0.18s ease}.os-cat__viz-svg .os-cat-node[ data-selected='true' ]{filter:drop-shadow( 0 0 6px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.18 ) ) )}.os-cat__viz-svg .os-cat-node:hover,.os-cat__viz-svg .os-cat-node:focus-visible{filter:drop-shadow( 0 0 8px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.3 ) ) );outline:none}.os-cat__viz-svg .os-cat-label{font-family:var( --os-ui-font,system-ui,sans-serif );font-size:10.5px;fill:var( --os-ui-cat-label-fg,var( --os-ui-fg,#1d2327 ) );font-weight:500;pointer-events:none;user-select:none}.os-cat__viz-svg .os-cat-label[ data-selected='false' ]{fill:var( --os-ui-cat-label-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-weight:400;font-style:italic}.os-cat__trigger{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-cat-trigger-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-cat-trigger-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-cat__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-cat-trigger-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-cat-trigger-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-cat__trigger:focus-visible{outline:none;border-style:solid;box-shadow:0 0 0 2px var( --wp-admin-theme-color,#2271b1 )}.os-cat__trigger svg{display:block}.os-cat__uncategorized{display:inline-flex;align-items:center;gap:4px;padding:1px 10px;min-height:22px;font-size:11px;font-weight:500;line-height:1.6;color:var( --os-ui-cat-uncat-fg,var( --os-ui-fg-muted,#8c8f94 ) );background:transparent;border:1px dashed var( --os-ui-cat-uncat-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;font-style:italic}.os-cat__popover{position:fixed;top:0;left:0;min-width:280px;max-width:360px;max-height:360px;display:flex;flex-direction:column;background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-cat-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-cat-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:1000}.os-cat__editor{position:relative;display:inline-flex;align-items:center}.os-cat__search{appearance:none;font:inherit;font-size:13px;padding:8px 12px;border:0;border-bottom:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );background:transparent;color:inherit;outline:none}.os-cat__search:focus{border-bottom-color:var( --wp-admin-theme-color,#2271b1 )}.os-cat__tree{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0}.os-cat__row-block{display:contents}.os-cat__row{display:flex;align-items:center;gap:6px;padding:4px 8px 4px var( --os-ui-cat-row-indent,12px );cursor:pointer;user-select:none;font-size:13px;line-height:1.4;position:relative}.os-cat__row:hover,.os-cat__row[ data-focused='true' ]{background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) )}.os-cat__row[ data-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 );font-weight:600}.os-cat__row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__expander{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:0;background:transparent;color:inherit;cursor:pointer;flex-shrink:0;opacity:0.65}.os-cat__expander:hover{opacity:1}.os-cat__expander svg{display:block;transition:transform 0.12s ease}.os-cat__row[ data-expanded='true' ] .os-cat__expander svg{transform:rotate( 90deg )}.os-cat__expander--placeholder{visibility:hidden}.os-cat__create-row{display:flex;align-items:center;padding:2px 8px 2px var( --os-ui-cat-row-indent,28px );position:relative}.os-cat__create-row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__create-wrap{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;padding:1px 1px 1px 0;border:1px solid transparent;border-radius:6px;background:transparent;transition:border-color 0.12s ease,background-color 0.12s ease,box-shadow 0.12s ease}.os-cat__create-wrap:hover{border-color:var( --os-ui-border,rgba( 0,0,0,0.12 ) );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) )}.os-cat__create-wrap:focus-within{border-color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );box-shadow:0 0 0 2px color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 15%,transparent )}.os-cat__create-input{flex:1 1 auto;min-width:0;appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );padding:3px 6px;border:0;background:transparent;color:inherit;outline:none}.os-cat__create-input::placeholder{color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-style:italic;opacity:1}.os-cat__create-submit{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}.os-cat__create-wrap:focus-within .os-cat__create-submit:not( [ disabled ] ){background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__create-submit:hover:not( [ disabled ] ){filter:brightness( 1.05 )}.os-cat__create-submit[ disabled ]{cursor:default;opacity:0.5}.os-cat__create-submit svg{display:block}.os-cat__create-spinner{display:inline-block;width:12px;height:12px;margin:0 4px;border-radius:50%;border:2px solid var( --wp-admin-theme-color,#2271b1 );border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;flex-shrink:0}.os-cat__check{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;border:1.5px solid var( --os-ui-cat-check-border,var( --os-ui-border,#8c8f94 ) );border-radius:3px;color:transparent;transition:background-color 0.12s ease,border-color 0.12s ease,color 0.12s ease}.os-cat__row[ data-selected='true' ] .os-cat__check{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__check svg{display:block;width:14px;height:14px}.os-cat__label{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-cat__delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:transparent;color:var( --os-ui-cat-delete-color,var( --os-ui-danger,#d63638 ) );cursor:pointer;opacity:0;transition:opacity 0.12s ease,background-color 0.12s ease}.os-cat__row:hover .os-cat__delete,.os-cat__row[ data-focused='true' ] .os-cat__delete,.os-cat__delete:focus-visible{opacity:1}.os-cat__delete:hover,.os-cat__delete:focus-visible{background:var( --os-ui-badge-danger-bg,rgba( 214,54,56,0.12 ) )}.os-cat__delete svg{display:block;width:14px;height:14px}.os-cat__match{background:var( --os-ui-search-highlight-bg,rgba( 252,211,77,0.45 ) );border-radius:2px;padding:0 1px}.os-cat__empty,.os-cat__loading{padding:12px;font-size:12px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );text-align:center}.os-cat__loading-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;margin-inline-end:8px;vertical-align:middle}@keyframes os-cat-spin{to{transform:rotate( 360deg )}}.os-cat__footer{padding:8px 12px;font-size:11px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );border-top:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );border-radius:10px;background:var( --os-ui-cat-pop-footer-bg,var( --os-ui-surface,#fafafb ) );display:flex;align-items:center;gap:6px;line-height:1.4}.os-cat__footer .dashicons{font-size:14px;width:14px;height:14px;flex-shrink:0}:host( [ disabled ] ) .os-cat{opacity:0.6;pointer-events:none}`,fe=R`: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 ) )}`,wo=R` .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%}}`,$o=R` .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%}}`,Co=R` .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}}`,So=R` .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}}`,Ao=R` .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}}`,Eo=R` .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%}}`,zo=R` .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}}`,To=R` 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}}`,Je=R` 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}}`,Po=R` @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}}`;R` ${fe} ${wo} ${$o} ${Co} ${So} ${Ao} ${Eo} ${zo} ${To} ${Je} ${Po} `;const Mo=R` ${fe}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,_e=class _e extends U{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const i=this.label??"";this.emit("os-chip-dismiss",{label:i})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,o=this.disabled!==null;return b` | |
| 41 | 41 | <span part="chip" class="os-chip"> |
| 42 | 42 | <span class="os-chip__icon"> |
| 43 | 43 | <slot name="icon"></slot> |
| 44 | 44 | </span> |
| @@ -196,9 +196,9 @@ | ||
| 196 | 196 | </div> |
| 197 | 197 | </div> |
| 198 | 198 | `}_onCreateInput(e,t){const o=e.target.value;o===""?this._creatingValues.delete(t):this._creatingValues.set(t,o),this.requestUpdate()}_onCreateKeydown(e,t){if(e.key==="Escape"){e.preventDefault(),this._creatingValues.delete(t),this.requestUpdate();return}e.key==="Enter"&&(e.preventDefault(),this._submitCreate(t))}_submitCreate(e){const t=(this._creatingValues.get(e)??"").trim();!t||this._creatingPending.has(e)||(this._creatingPending.add(e),this.requestUpdate(),this.emit("os-categories-create",{name:t,parent:e}))}endCreating(e=0){this._creatingPending.delete(e),this._creatingValues.delete(e),this.requestUpdate()}failCreating(e=0,t){this._creatingPending.delete(e),this.requestUpdate()}_buildTree(){const e=new Map;for(const a of this._items)e.set(a.id,{item:a,children:[],depth:0});const t=[];for(const a of e.values()){const n=a.item.parent;n&&e.has(n)?e.get(n).children.push(a):t.push(a)}const o=(a,n)=>{a.depth=n;for(const r of a.children)o(r,n+1)};for(const a of t)o(a,0);const i=a=>{a.sort((n,r)=>{const l=Me(n.item),c=Me(r.item);return l!==c?l?-1:1:n.item.name.localeCompare(r.item.name)});for(const n of a)i(n.children)};return i(t),t}_filterTree(e,t){const o=t.trim().toLowerCase();if(!o)return e;const i=a=>{if(a.item.name.toLowerCase().includes(o))return{item:a.item,children:a.children.slice(),depth:a.depth};const r=a.children.map(i).filter(l=>l!==null);return r.length>0?{item:a.item,children:r,depth:a.depth}:null};return e.map(i).filter(a=>a!==null)}_flattenForDisplay(e){const t=[],o=this._query.trim()!=="",i=a=>{for(const n of a)t.push({node:n,visible:!0,hasChildren:n.children.length>0}),!(this._collapsed.has(n.item.id)&&!o)&&n.children.length>0&&i(n.children)};return i(e),t}_selectedItemsInOrder(){const e=new Map;for(const i of this._items)e.set(i.id,i);const t=[],o=[];for(const i of this._value){const a=e.get(i);a&&(a.name.toLowerCase()===Kt||a.id===1?o.push(a):t.push(a))}return t.length>0?t:o.length>0?[]:t}_highlight(e,t){const o=t.trim();if(!o)return e;const i=e.toLowerCase(),a=o.toLowerCase(),n=i.indexOf(a);return n===-1?e:b`${e.slice(0,n)}<span class="os-cat__match" |
| 199 | 199 | >${e.slice(n,n+o.length)}</span |
| 200 | - >${e.slice(n+o.length)}`}_toggleSelection(e){const t=this._value.includes(e)?this._value.filter(o=>o!==e):[...this._value,e];this.emit("os-categories-change",{value:t})}_onDeleteClick(e,t){e.stopPropagation(),e.preventDefault(),this.emit("os-categories-delete",{id:t.id,name:t.name})}_toggleExpand(e){this._collapsed.has(e)?this._collapsed.delete(e):this._collapsed.add(e),this.requestUpdate()}_onSearchInput(e){this._query=e.target.value,this._focusedRow=0,this.requestUpdate()}_onSearchKeydown(e,t){switch(e.key){case"ArrowDown":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow+1>=t.length?0:this._focusedRow+1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowUp":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow<=0?t.length-1:this._focusedRow-1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowRight":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"ArrowLeft":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&!this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"Enter":case" ":{if(this._focusedRow<0||this._focusedRow>=t.length)return;e.preventDefault();const o=t[this._focusedRow];this._toggleSelection(o.node.item.id);return}case"Escape":e.preventDefault(),this.closePicker()}}_scrollFocusedIntoView(){queueMicrotask(()=>{const e=this.shadowRoot?.querySelector(".os-cat__tree");if(!e)return;const t=e.querySelector('.os-cat__row[data-focused="true"]');if(!t)return;const o=t.getBoundingClientRect(),i=e.getBoundingClientRect();o.top<i.top?t.scrollIntoView({block:"nearest"}):o.bottom>i.bottom&&t.scrollIntoView({block:"nearest"})})}_positionPopover(){const e=this.shadowRoot?.querySelector(".os-cat__popover");if(!e)return;const t=this.getBoundingClientRect(),o=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=8;let r=t.bottom+4;const l=r+o.height+n>a,c=t.top-4-o.height>=n;l&&c?r=t.top-4-o.height:l&&(r=Math.max(n,a-o.height-n));let d=t.left;d+o.width+n>i&&(d=t.right-o.width),d=Math.max(n,Math.min(d,i-o.width-n)),e.style.top=`${r}px`,e.style.left=`${d}px`}};xe.props=["placeholder","add-label","disabled","readonly","open","loading","max-visible"],xe.styles=[ko],xe.help=void 0;let tt=xe;W("os-category-picker",tt);function Bt(){return Y("chevron-right",{size:14})}function Do(){return Y("plus",{size:16})}function Ho(){return Y("check",{size:null})}function Fo(){return Y("close",{size:null})}function Uo(s){return s.categories.tree||(s.categories.tree=s.client.fetchAllCategories().then(e=>e.map(t=>({id:t.id,name:t.name,parent:t.parent})))),s.categories.tree}function Gt(s){s.categories.tree=null}function Vo(s){Uo(s).then(e=>{for(const t of s.categories.pickers)t.isConnected?t.items=e:s.categories.pickers.delete(t)}).catch(()=>{})}function Zt(s,e){s.parentTitles.clear();for(const t of e)s.parentTitles.set(t.id,re(t))}function Wo(s,e){const t=document.createElement("span"),o=typeof s.parent=="number"?s.parent:0;if(o===0)return t.textContent="—",t.setAttribute("aria-label",u("Top-level page")),t;const i=e.parentTitles.get(o);return t.textContent=i?`↳ ${i}`:H(u("↳ #%d"),o),t}function jo(s,e){const t=document.createElement("span"),o=typeof s.template=="string"?s.template:"",i=e.extra.pageTemplates??{};return t.textContent=i[o]??(o===""?u("Default template"):o),o!==""&&(t.title=o),t}function Ko(s,e){const t=document.createElement("button");t.type="button";const o=typeof s.slug=="string"?s.slug:"";return t.textContent=o||"—",t.disabled=o==="",t.title=o?u("Click to copy slug"):"",Object.assign(t.style,{appearance:"none",background:"transparent",border:"none",padding:"2px 6px",font:"inherit",color:"inherit",cursor:o?"copy":"default",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:"12px",borderRadius:"4px",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),t.addEventListener("click",i=>{i.stopPropagation(),o&&$t(o).then(a=>{if(!a){e.toast(u("Couldn’t copy the slug."),null);return}t.textContent=u("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=o,t.style.color=""},1200)})}),t}function Bo(s){const e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",alignItems:"center",gap:"6px",fontVariantNumeric:"tabular-nums"});const t=typeof s.openstation_comment_count=="number"?s.openstation_comment_count:null;if(t===null)return e.textContent="—",e.style.color="var(--os-ui-fg-muted, #8c8f94)",e;const o=document.createElement("span");o.className="dashicons dashicons-admin-comments",o.setAttribute("aria-hidden","true"),Object.assign(o.style,{fontSize:"16px",width:"16px",height:"16px",color:t>0?"var(--wp-admin-theme-color, #2271b1)":"var(--os-ui-fg-muted, #8c8f94)"});const i=document.createElement("span");return i.textContent=String(t),t===0&&(i.style.color="var(--os-ui-fg-muted, #8c8f94)"),e.appendChild(o),e.appendChild(i),e.setAttribute("aria-label",H(Fe("%d comment","%d comments",t),t)),e}const Go=R` ${fe} ${Je}: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}}`,le="__wpd_expander__",ce="__wpd_select__",ye=class ye extends U{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(o=>o.key));for(const o of Object.keys(this._filters))t.has(o)||delete this._filters[o];for(const o of Array.from(this._filterCache.keys()))t.has(o)||this._filterCache.delete(o);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,o)=>{this._selection.has(this._getRowId(t,o))&&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,o)=>o,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(),o=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...o])}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 o=t.querySelector("tbody");if(!o)return;let i=null;if(e!=="all"){i=new Set;for(const r of e)i.add(String(r))}const a=o.querySelectorAll("tr[data-row-id]");for(const r of a){const l=r.dataset.rowId;if(l===void 0||i&&!i.has(l))continue;const c=Number(r.dataset.rowIndex);if(!Number.isFinite(c))continue;const d=this._data[c];if(d===void 0)continue;const p=this._getRowId(d,c),g=this._selection.has(p);r.classList.toggle("is-selected",g);const v=r.querySelector("input.select-row-checkbox");v&&v.checked!==g&&(v.checked=g)}const n=t.querySelector("thead .select-all-checkbox");if(n){const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<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 b` | |
| 200 | + >${e.slice(n+o.length)}`}_toggleSelection(e){const t=this._value.includes(e)?this._value.filter(o=>o!==e):[...this._value,e];this.emit("os-categories-change",{value:t})}_onDeleteClick(e,t){e.stopPropagation(),e.preventDefault(),this.emit("os-categories-delete",{id:t.id,name:t.name})}_toggleExpand(e){this._collapsed.has(e)?this._collapsed.delete(e):this._collapsed.add(e),this.requestUpdate()}_onSearchInput(e){this._query=e.target.value,this._focusedRow=0,this.requestUpdate()}_onSearchKeydown(e,t){switch(e.key){case"ArrowDown":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow+1>=t.length?0:this._focusedRow+1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowUp":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow<=0?t.length-1:this._focusedRow-1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowRight":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"ArrowLeft":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&!this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"Enter":case" ":{if(this._focusedRow<0||this._focusedRow>=t.length)return;e.preventDefault();const o=t[this._focusedRow];this._toggleSelection(o.node.item.id);return}case"Escape":e.preventDefault(),this.closePicker()}}_scrollFocusedIntoView(){queueMicrotask(()=>{const e=this.shadowRoot?.querySelector(".os-cat__tree");if(!e)return;const t=e.querySelector('.os-cat__row[data-focused="true"]');if(!t)return;const o=t.getBoundingClientRect(),i=e.getBoundingClientRect();o.top<i.top?t.scrollIntoView({block:"nearest"}):o.bottom>i.bottom&&t.scrollIntoView({block:"nearest"})})}_positionPopover(){const e=this.shadowRoot?.querySelector(".os-cat__popover");if(!e)return;const t=this.getBoundingClientRect(),o=e.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=8;let r=t.bottom+4;const l=r+o.height+n>a,c=t.top-4-o.height>=n;l&&c?r=t.top-4-o.height:l&&(r=Math.max(n,a-o.height-n));let d=t.left;d+o.width+n>i&&(d=t.right-o.width),d=Math.max(n,Math.min(d,i-o.width-n)),e.style.top=`${r}px`,e.style.left=`${d}px`}};xe.props=["placeholder","add-label","disabled","readonly","open","loading","max-visible"],xe.styles=[ko],xe.help=void 0;let tt=xe;W("os-category-picker",tt);function Bt(){return Y("chevron-right",{size:14})}function Do(){return Y("plus",{size:16})}function Ho(){return Y("check",{size:null})}function Fo(){return Y("close",{size:null})}function Uo(s){return s.categories.tree||(s.categories.tree=s.client.fetchAllCategories().then(e=>e.map(t=>({id:t.id,name:t.name,parent:t.parent})))),s.categories.tree}function Gt(s){s.categories.tree=null}function Vo(s){Uo(s).then(e=>{for(const t of s.categories.pickers)t.isConnected?t.items=e:s.categories.pickers.delete(t)}).catch(()=>{})}function Zt(s,e){s.parentTitles.clear();for(const t of e)s.parentTitles.set(t.id,le(t))}function Wo(s,e){const t=document.createElement("span"),o=typeof s.parent=="number"?s.parent:0;if(o===0)return t.textContent="—",t.setAttribute("aria-label",u("Top-level page")),t;const i=e.parentTitles.get(o);return t.textContent=i?`↳ ${i}`:H(u("↳ #%d"),o),t}function jo(s,e){const t=document.createElement("span"),o=typeof s.template=="string"?s.template:"",i=e.extra.pageTemplates??{};return t.textContent=i[o]??(o===""?u("Default template"):o),o!==""&&(t.title=o),t}function Ko(s,e){const t=document.createElement("button");t.type="button";const o=typeof s.slug=="string"?s.slug:"";return t.textContent=o||"—",t.disabled=o==="",t.title=o?u("Click to copy slug"):"",Object.assign(t.style,{appearance:"none",background:"transparent",border:"none",padding:"2px 6px",font:"inherit",color:"inherit",cursor:o?"copy":"default",textAlign:"left",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:"12px",borderRadius:"4px",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}),t.addEventListener("click",i=>{i.stopPropagation(),o&&$t(o).then(a=>{if(!a){e.toast(u("Couldn’t copy the slug."),null);return}t.textContent=u("Copied!"),t.style.color="var(--wp-admin-theme-color, #2271b1)",setTimeout(()=>{t.textContent=o,t.style.color=""},1200)})}),t}function Bo(s){const e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",alignItems:"center",gap:"6px",fontVariantNumeric:"tabular-nums"});const t=typeof s.openstation_comment_count=="number"?s.openstation_comment_count:null;if(t===null)return e.textContent="—",e.style.color="var(--os-ui-fg-muted, #8c8f94)",e;const o=document.createElement("span");o.className="dashicons dashicons-admin-comments",o.setAttribute("aria-hidden","true"),Object.assign(o.style,{fontSize:"16px",width:"16px",height:"16px",color:t>0?"var(--wp-admin-theme-color, #2271b1)":"var(--os-ui-fg-muted, #8c8f94)"});const i=document.createElement("span");return i.textContent=String(t),t===0&&(i.style.color="var(--os-ui-fg-muted, #8c8f94)"),e.appendChild(o),e.appendChild(i),e.setAttribute("aria-label",H(Fe("%d comment","%d comments",t),t)),e}const Go=R` ${fe} ${Je}: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}}`,ce="__wpd_expander__",de="__wpd_select__",ye=class ye extends U{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(o=>o.key));for(const o of Object.keys(this._filters))t.has(o)||delete this._filters[o];for(const o of Array.from(this._filterCache.keys()))t.has(o)||this._filterCache.delete(o);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,o)=>{this._selection.has(this._getRowId(t,o))&&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,o)=>o,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(),o=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...o])}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 o=t.querySelector("tbody");if(!o)return;let i=null;if(e!=="all"){i=new Set;for(const r of e)i.add(String(r))}const a=o.querySelectorAll("tr[data-row-id]");for(const r of a){const l=r.dataset.rowId;if(l===void 0||i&&!i.has(l))continue;const c=Number(r.dataset.rowIndex);if(!Number.isFinite(c))continue;const d=this._data[c];if(d===void 0)continue;const p=this._getRowId(d,c),g=this._selection.has(p);r.classList.toggle("is-selected",g);const v=r.querySelector("input.select-row-checkbox");v&&v.checked!==g&&(v.checked=g)}const n=t.querySelector("thead .select-all-checkbox");if(n){const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<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 b` | |
| 201 | 201 | <div class="scroll" part="scroll"> |
| 202 | 202 | <table part="table"> |
| 203 | 203 | <colgroup></colgroup> |
| 204 | 204 | <thead></thead> |
| @@ -204,9 +204,9 @@ | ||
| 204 | 204 | <thead></thead> |
| 205 | 205 | <tbody></tbody> |
| 206 | 206 | </table> |
| 207 | 207 | </div> |
| 208 | - `}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")||Z(this.render(),e);const t=e.querySelector("colgroup"),o=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!o||!i)return;const a=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintColgroup(t,a),this._paintHead(o,a,n),this._paintBody(i,a,n),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 o=[];for(const i of t){const a=document.createElement("col");i.width&&(a.style.width=i.width),o.push(a)}e.replaceChildren(...o)}_paintHead(e,t,o){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let l=0;l<t.length;l++)i.appendChild(this._buildHeaderCell(t[l],l,o));const a=e.querySelector(':scope > tr[part="header-row"]');a?e.replaceChild(i,a):e.insertBefore(i,e.firstChild);const n=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(n){const l=[];for(let p=0;p<t.length;p++)l.push(this._buildFilterCell(t[p],p,o));r||(r=document.createElement("tr"),r.classList.add("filter-row"),r.setAttribute("part","filter-row"),e.appendChild(r));const c=Array.from(r.children);let d=c.length===l.length;if(d){for(let p=0;p<l.length;p++)if(c[p]!==l[p]){d=!1;break}}if(!d){const p=new Set(l);for(const g of l)r.appendChild(g);for(const g of Array.from(r.children))p.has(g)||r.removeChild(g)}}else r&&r.remove()}_buildHeaderCell(e,t,o){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,o),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===ce){if(this._readSelectable()==="multi"){const n=document.createElement("input");n.type="checkbox",n.className="select-all-checkbox",n.setAttribute("data-noclick",""),n.setAttribute("aria-label","Select all rows");const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r,n.addEventListener("change",()=>{n.checked?this.selectAll():this.clearSelection()}),i.appendChild(n)}return i}if(i.textContent=e.label??(e.key===le?"":e.key),e.sortable){i.classList.add("is-sortable");const a=this._sort?.key===e.key,n=document.createElement("span");n.className="sort-indicator";let r="";a&&(r=this._sort.direction==="asc"?" ▲":" ▼"),n.textContent=r,i.appendChild(n),a&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,o){const i=this._filterCache.get(e.key),a=Array.isArray(e.filterOptions),n=typeof e.filterRender=="function";let r;if(!e.filter&&!a&&!n||e.key===le||e.key===ce?r="none":n?r="custom":e.filter==="select"||a?r="select":r="text",i&&i.kind===r){if(i.th.className="",this._applyCellClasses(i.th,e,t,o),r==="select"){const p=i.control,g=this._resolveFilterOptions(e),v=g.map(_=>_.value).join("|");v!==i.optionsKey?(this._populateSelect(p,g,this._filters[e.key]??""),i.optionsKey=v):p.value=this._filters[e.key]??""}else if(r==="text"){const p=i.control,g=this._filters[e.key]??"";p.value!==g&&p.ownerDocument.activeElement!==p&&(p.value=g)}else r==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e});return i.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,o),r==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(r==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let c,d="";if(r==="select"){const p=document.createElement("select");p.classList.add("filter-select"),p.setAttribute("data-noclick",""),p.setAttribute("aria-label",`Filter ${e.label??e.key}`);const g=this._resolveFilterOptions(e);this._populateSelect(p,g,this._filters[e.key]??""),d=g.map(v=>v.value).join("|"),p.addEventListener("change",()=>{this._onFilterChange(e.key,p.value)}),c=p}else{const p=document.createElement("input");p.type="search",p.classList.add("filter-input"),p.setAttribute("data-noclick",""),p.setAttribute("placeholder","Filter…"),p.setAttribute("aria-label",`Filter ${e.label??e.key}`),p.value=this._filters[e.key]??"",p.addEventListener("input",()=>{this._onFilterChange(e.key,p.value)}),c=p}return l.appendChild(c),this._filterCache.set(e.key,{th:l,control:c,optionsKey:d,kind:r}),l}_populateSelect(e,t,o){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const a of t){const n=document.createElement("option");n.value=a.value,n.textContent=a.label,a.value===o&&(n.selected=!0),e.appendChild(n)}e.value=o}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,o){if(e.replaceChildren(),this.hasAttribute("loading")){const a=this._readLoadingRows();for(let n=0;n<a;n++)e.appendChild(this._buildSkeletonRow(t,n));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:a,index:n}of i)if(e.appendChild(this._stacked?this._buildStackedRow(a,n,t):this._buildBodyRow(a,n,t,o)),this._expanded.has(n)&&this._subTable){const r=this._subTable(a,n);r&&e.appendChild(this._buildSubTableRow(r,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const o=document.createElement("td");o.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",o.appendChild(i),t.appendChild(o),t}_buildSkeletonRow(e,t){const o=document.createElement("tr");if(o.classList.add("skeleton"),o.setAttribute("aria-hidden","true"),this._stacked){o.classList.add("stack-row");const i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const a of[55+t*7%25,30+t*11%15]){const n=document.createElement("span");n.className="skeleton-bar",n.style.width=`${a}%`,i.appendChild(n)}return o.appendChild(i),o}for(const i of e){const a=document.createElement("td"),n=document.createElement("span");n.className="skeleton-bar";const r=50+(t*7+o.children.length*13)%40;n.style.width=`${r}%`,a.appendChild(n),o.appendChild(a)}return o}_buildBodyRow(e,t,o,i){const a=document.createElement("tr");a.setAttribute("part","row"),a.dataset.rowIndex=String(t);const n=this._getRowId(e,t);a.dataset.rowId=String(n),this._selection.has(n)&&a.classList.add("is-selected"),a.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<o.length;r++)a.appendChild(this._buildBodyCell(o[r],r,e,t,i));return a}_buildStackedRow(e,t,o){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const a=this._getRowId(e,t);i.dataset.rowId=String(a),this._selection.has(a)&&i.classList.add("is-selected"),i.addEventListener("click",c=>{this._onRowClick(e,t,c)});const n=document.createElement("td");n.className="stack-body";let r=0,l=0;for(let c=0;c<o.length;c++){const d=o[c];if(d.key===ce||d.key===le){i.appendChild(this._buildBodyCell(d,c,e,t,0));continue}l++;const p=Zo(d,r++);if(p==="hidden")continue;const g=document.createElement("div");if(g.className=`stack-cell stack-${p}`,g.dataset.key=d.key,p==="meta"&&d.label){const h=document.createElement("span");h.className="stack-label",h.textContent=d.label,g.appendChild(h)}const v=document.createElement("span");v.className="stack-value";const _=e[d.key],x=Le(_);d.render?this._mountCellContent(v,d.render(_,e,t)):x!==null?v.appendChild(this._slotFor(x)):_!=null&&(v.textContent=String(_)),g.appendChild(v),n.appendChild(g)}return n.colSpan=Math.max(1,l),i.appendChild(n),i}_buildBodyCell(e,t,o,i,a){const n=document.createElement("td");if(this._applyCellClasses(n,e,t,a),e.minWidth&&(n.style.minWidth=e.minWidth),e.key===ce){const c=this._getRowId(o,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)}),n.appendChild(d),this._stacked&&(n.setAttribute("data-noclick",""),n.addEventListener("click",p=>{p.target===n&&(d.checked=!d.checked,d.dispatchEvent(new Event("change")))})),n}if(e.key===le){if(!(this._subTable?!!this._subTable(o,i):!1))return n;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",g=>{this._toggleRow(i,o,g)}),n.appendChild(p),n}const r=o[e.key],l=Le(r);if(e.render){const c=e.render(r,o,i);this._mountCellContent(n,c)}else l!==null?n.appendChild(this._slotFor(l)):r!=null&&(n.textContent=String(r));return n}_slotFor(e){const t=document.createElement("slot");return t.name=e,t}_buildSubTableRow(e,t){const o=document.createElement("tr");o.classList.add("subtable"),o.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const a=document.createElement("div");if(a.classList.add("subtable-inner"),e instanceof Node)a.appendChild(e);else if(Xt(e))Z(e,a);else{const n=document.createElement("os-table");n.columns=e.columns,n.data=e.data,e.subTable&&(n.subTable=e.subTable),a.appendChild(n)}return i.appendChild(a),o.appendChild(i),o}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}Xt(t)&&Z(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 a=this._effectiveColumns(),n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintBody(i,a,n),this._applyStickyOffsets()}}_onRowClick(e,t,o){const i=o.composedPath?.()??[];for(const a of i){if(a instanceof Element&&a.hasAttribute("data-noclick"))return;if(a===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:o})}_toggleRow(e,t,o){o.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(o=>this._filters[o]!=="");for(let o=0;o<this._data.length;o++){const i=this._data[o];let a=!0;for(const n of t){const r=this._columns.find(p=>p.key===n);if(r&&typeof r.filterRender=="function")continue;const l=this._filters[n]??"",c=i[n],d=ot(c);if(r?.filter==="select"){if(d!==l){a=!1;break}}else if(!d.toLowerCase().includes(l.toLowerCase())){a=!1;break}}a&&e.push({row:i,index:o})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(a=>a.key===this._sort.key);if(!t)return e;const o=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((a,n)=>{const r=a.row[t.key],l=n.row[t.key],c=t.sortValue?t.sortValue(a.row,r):Yt(r),d=t.sortValue?t.sortValue(n.row,l):Yt(l);return Xo(c,d)*o}),i}_uniqueValues(e){const t=new Set;for(const o of this._data){const i=o[e];i!=null&&t.add(ot(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:o,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(o,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,o){return this._stacked||o.sticky===!1?!1:o.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let o=-1;for(let i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(o=i);return o}_applyCellClasses(e,t,o,i){t.key===le&&e.classList.add("col-expander"),t.key===ce&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(o,i,t)&&(e.classList.add("is-sticky"),o===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:ce,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:le,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 o=Array.from(t.children),i=[];let a=0;for(let r=0;r<o.length;r++)i[r]=a,o[r].classList.contains("is-sticky")&&(a+=o[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const l=Array.from(r.children);for(let c=0;c<l.length;c++)l[c].classList.contains("is-sticky")&&(l[c].style.insetInlineStart=`${i[c]}px`)}),this._maybeWarnStickyOffsetRace(o,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const o=this._readStickyColumns();if(o<2)return;const i=Math.min(o-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const a=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 ${a}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 o=t.offsetHeight;o>0&&this.style.setProperty("--os-ui-table-header-height",`${o}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."))}};ye.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ye.styles=[Go],ye.help=void 0;let st=ye;function Xt(s){return!!s&&s.__wpdHtml===!0}function Zo(s,e){return s.stack?s.stack:e===0?"title":s.label?"meta":"actions"}function Le(s){return s&&typeof s=="object"&&typeof s.slot=="string"?s.slot:null}function ot(s){if(s==null)return"";if(Le(s)!==null){const e=s.text;return e==null?"":String(e)}return String(s)}function Yt(s){return Le(s)!==null?ot(s):s}function Xo(s,e){if(s===e)return 0;if(s==null)return-1;if(e==null)return 1;if(typeof s=="number"&&typeof e=="number")return s-e;if(s instanceof Date&&e instanceof Date)return s.getTime()-e.getTime();const t=Number(s),o=Number(e);return Number.isFinite(t)&&Number.isFinite(o)?t-o:String(s).localeCompare(String(e))}W("os-table",st);const Yo=R` ${fe}:host{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-select__label{font-size:13px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;padding:8px 12px;background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:1.5;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}.os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-border-strong,#8c8f94 )}.os-select__trigger:focus,.os-select__trigger:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.os-select__trigger:disabled{opacity:0.5;cursor:not-allowed}:host( [ plain ] ){display:inline-flex;flex-direction:row;align-items:center}:host( [ plain ] ) .os-select__label{display:none}:host( [ plain ] ) .os-select__trigger{width:auto;padding:4px 6px;background:transparent;border-color:transparent;border-radius:6px}:host( [ plain ] ) .os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border-color:transparent}:host( [ plain ] ) .os-select__trigger:focus,:host( [ plain ] ) .os-select__trigger:focus-visible{border-color:var( --os-ui-accent,#2271b1 )}:host( [ plain ] ) .os-select__value{flex:0 1 auto}.os-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-select__value--placeholder{color:var( --os-ui-fg-muted,#646970 )}.os-select__chevron{flex:0 0 auto;pointer-events:none;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger:hover .os-select__chevron{color:var( --os-ui-fg,#1d2327 )}.os-select__trigger:focus .os-select__chevron,.os-select__trigger:focus-visible .os-select__chevron{color:var( --os-ui-accent,#2271b1 )}.os-select__popup{position:fixed;inset:auto;margin:0;max-height:min( 320px,60vh );overflow-y:auto;padding:4px;background:var( --os-ui-surface,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;box-shadow:0 12px 32px rgba( 0,0,0,0.45 );color:var( --os-ui-fg,#1d2327 )}.os-select__popup:not( [ data-open ] ){display:none}.os-select__popup:popover-open{display:block}.os-select__popup[ data-open ]{position:absolute;top:calc( 100% + 4px );left:0;min-width:100%;z-index:1000}:host{position:relative}.os-select__option{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;white-space:nowrap}.os-select__check{flex:0 0 auto;visibility:hidden}.os-select__option[ aria-selected='true' ] .os-select__check{visibility:visible}.os-select__option[ data-active ],.os-select__option:hover{background:var( --os-ui-accent,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-select__option[ aria-disabled='true' ]{opacity:0.5;cursor:not-allowed}.os-select__option[ aria-disabled='true' ]:hover{background:transparent;color:inherit}@media ( prefers-reduced-motion:reduce ){.os-select__trigger{transition-duration:1ms}}`,Jo=R`:host{display:none}`,ke=class ke extends U{render(){return b``}};ke.props=["value","disabled"],ke.styles=[Jo],ke.help=void 0;let it=ke;W("os-option",it);const we=class we extends U{constructor(){super(...arguments),this._optionObserver=null,this._open=!1,this._activeIndex=-1,this._typed="",this._dismissedAt=0,this._typedTimer=null,this._onWindowScroll=e=>{const t=e.target,o=this._popup();o&&t instanceof Node&&(t===o||o.contains(t))||this._hide()},this._onWindowResize=()=>this._hide()}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}const o=this.value;!(o!==null&&e.some(a=>a.value===o))&&e.length>0&&(this.value=e[0].value),this.requestUpdate()}connectedCallback(){super.connectedCallback(),Mt(this),this._optionObserver=new MutationObserver(()=>this.requestUpdate()),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._teardownDismiss(),this._open=!1,this._typedTimer&&(clearTimeout(this._typedTimer),this._typedTimer=null)}render(){const e=this.label||"",t=this.value,o=this.placeholder||"",i=this.disabled!==null;e&&this.setAttribute("aria-label",e);const a=this.getAttribute("aria-label")||"",n=e||a||o,r=this._readOptions(),l=r.find(_=>_.value===t),c=l?l.label:o,d=this.id||"os-unnamed",p=`${d}__listbox`,g=`${d}__trigger`,v=this._open&&this._activeIndex>=0?`${d}__opt-${this._activeIndex}`:"";return b` | |
| 208 | + `}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")||Z(this.render(),e);const t=e.querySelector("colgroup"),o=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!o||!i)return;const a=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintColgroup(t,a),this._paintHead(o,a,n),this._paintBody(i,a,n),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 o=[];for(const i of t){const a=document.createElement("col");i.width&&(a.style.width=i.width),o.push(a)}e.replaceChildren(...o)}_paintHead(e,t,o){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let l=0;l<t.length;l++)i.appendChild(this._buildHeaderCell(t[l],l,o));const a=e.querySelector(':scope > tr[part="header-row"]');a?e.replaceChild(i,a):e.insertBefore(i,e.firstChild);const n=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let r=e.querySelector(":scope > tr.filter-row");if(n){const l=[];for(let p=0;p<t.length;p++)l.push(this._buildFilterCell(t[p],p,o));r||(r=document.createElement("tr"),r.classList.add("filter-row"),r.setAttribute("part","filter-row"),e.appendChild(r));const c=Array.from(r.children);let d=c.length===l.length;if(d){for(let p=0;p<l.length;p++)if(c[p]!==l[p]){d=!1;break}}if(!d){const p=new Set(l);for(const g of l)r.appendChild(g);for(const g of Array.from(r.children))p.has(g)||r.removeChild(g)}}else r&&r.remove()}_buildHeaderCell(e,t,o){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,o),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===de){if(this._readSelectable()==="multi"){const n=document.createElement("input");n.type="checkbox",n.className="select-all-checkbox",n.setAttribute("data-noclick",""),n.setAttribute("aria-label","Select all rows");const{total:r,selected:l}=this._visibleSelectionStats();n.checked=r>0&&l===r,n.indeterminate=l>0&&l<r,n.addEventListener("change",()=>{n.checked?this.selectAll():this.clearSelection()}),i.appendChild(n)}return i}if(i.textContent=e.label??(e.key===ce?"":e.key),e.sortable){i.classList.add("is-sortable");const a=this._sort?.key===e.key,n=document.createElement("span");n.className="sort-indicator";let r="";a&&(r=this._sort.direction==="asc"?" ▲":" ▼"),n.textContent=r,i.appendChild(n),a&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,o){const i=this._filterCache.get(e.key),a=Array.isArray(e.filterOptions),n=typeof e.filterRender=="function";let r;if(!e.filter&&!a&&!n||e.key===ce||e.key===de?r="none":n?r="custom":e.filter==="select"||a?r="select":r="text",i&&i.kind===r){if(i.th.className="",this._applyCellClasses(i.th,e,t,o),r==="select"){const p=i.control,g=this._resolveFilterOptions(e),v=g.map(_=>_.value).join("|");v!==i.optionsKey?(this._populateSelect(p,g,this._filters[e.key]??""),i.optionsKey=v):p.value=this._filters[e.key]??""}else if(r==="text"){const p=i.control,g=this._filters[e.key]??"";p.value!==g&&p.ownerDocument.activeElement!==p&&(p.value=g)}else r==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e});return i.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,o),r==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(r==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let c,d="";if(r==="select"){const p=document.createElement("select");p.classList.add("filter-select"),p.setAttribute("data-noclick",""),p.setAttribute("aria-label",`Filter ${e.label??e.key}`);const g=this._resolveFilterOptions(e);this._populateSelect(p,g,this._filters[e.key]??""),d=g.map(v=>v.value).join("|"),p.addEventListener("change",()=>{this._onFilterChange(e.key,p.value)}),c=p}else{const p=document.createElement("input");p.type="search",p.classList.add("filter-input"),p.setAttribute("data-noclick",""),p.setAttribute("placeholder","Filter…"),p.setAttribute("aria-label",`Filter ${e.label??e.key}`),p.value=this._filters[e.key]??"",p.addEventListener("input",()=>{this._onFilterChange(e.key,p.value)}),c=p}return l.appendChild(c),this._filterCache.set(e.key,{th:l,control:c,optionsKey:d,kind:r}),l}_populateSelect(e,t,o){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const a of t){const n=document.createElement("option");n.value=a.value,n.textContent=a.label,a.value===o&&(n.selected=!0),e.appendChild(n)}e.value=o}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,o){if(e.replaceChildren(),this.hasAttribute("loading")){const a=this._readLoadingRows();for(let n=0;n<a;n++)e.appendChild(this._buildSkeletonRow(t,n));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:a,index:n}of i)if(e.appendChild(this._stacked?this._buildStackedRow(a,n,t):this._buildBodyRow(a,n,t,o)),this._expanded.has(n)&&this._subTable){const r=this._subTable(a,n);r&&e.appendChild(this._buildSubTableRow(r,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const o=document.createElement("td");o.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",o.appendChild(i),t.appendChild(o),t}_buildSkeletonRow(e,t){const o=document.createElement("tr");if(o.classList.add("skeleton"),o.setAttribute("aria-hidden","true"),this._stacked){o.classList.add("stack-row");const i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const a of[55+t*7%25,30+t*11%15]){const n=document.createElement("span");n.className="skeleton-bar",n.style.width=`${a}%`,i.appendChild(n)}return o.appendChild(i),o}for(const i of e){const a=document.createElement("td"),n=document.createElement("span");n.className="skeleton-bar";const r=50+(t*7+o.children.length*13)%40;n.style.width=`${r}%`,a.appendChild(n),o.appendChild(a)}return o}_buildBodyRow(e,t,o,i){const a=document.createElement("tr");a.setAttribute("part","row"),a.dataset.rowIndex=String(t);const n=this._getRowId(e,t);a.dataset.rowId=String(n),this._selection.has(n)&&a.classList.add("is-selected"),a.addEventListener("click",r=>{this._onRowClick(e,t,r)});for(let r=0;r<o.length;r++)a.appendChild(this._buildBodyCell(o[r],r,e,t,i));return a}_buildStackedRow(e,t,o){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const a=this._getRowId(e,t);i.dataset.rowId=String(a),this._selection.has(a)&&i.classList.add("is-selected"),i.addEventListener("click",c=>{this._onRowClick(e,t,c)});const n=document.createElement("td");n.className="stack-body";let r=0,l=0;for(let c=0;c<o.length;c++){const d=o[c];if(d.key===de||d.key===ce){i.appendChild(this._buildBodyCell(d,c,e,t,0));continue}l++;const p=Zo(d,r++);if(p==="hidden")continue;const g=document.createElement("div");if(g.className=`stack-cell stack-${p}`,g.dataset.key=d.key,p==="meta"&&d.label){const h=document.createElement("span");h.className="stack-label",h.textContent=d.label,g.appendChild(h)}const v=document.createElement("span");v.className="stack-value";const _=e[d.key],x=Le(_);d.render?this._mountCellContent(v,d.render(_,e,t)):x!==null?v.appendChild(this._slotFor(x)):_!=null&&(v.textContent=String(_)),g.appendChild(v),n.appendChild(g)}return n.colSpan=Math.max(1,l),i.appendChild(n),i}_buildBodyCell(e,t,o,i,a){const n=document.createElement("td");if(this._applyCellClasses(n,e,t,a),e.minWidth&&(n.style.minWidth=e.minWidth),e.key===de){const c=this._getRowId(o,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)}),n.appendChild(d),this._stacked&&(n.setAttribute("data-noclick",""),n.addEventListener("click",p=>{p.target===n&&(d.checked=!d.checked,d.dispatchEvent(new Event("change")))})),n}if(e.key===ce){if(!(this._subTable?!!this._subTable(o,i):!1))return n;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",g=>{this._toggleRow(i,o,g)}),n.appendChild(p),n}const r=o[e.key],l=Le(r);if(e.render){const c=e.render(r,o,i);this._mountCellContent(n,c)}else l!==null?n.appendChild(this._slotFor(l)):r!=null&&(n.textContent=String(r));return n}_slotFor(e){const t=document.createElement("slot");return t.name=e,t}_buildSubTableRow(e,t){const o=document.createElement("tr");o.classList.add("subtable"),o.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const a=document.createElement("div");if(a.classList.add("subtable-inner"),e instanceof Node)a.appendChild(e);else if(Xt(e))Z(e,a);else{const n=document.createElement("os-table");n.columns=e.columns,n.data=e.data,e.subTable&&(n.subTable=e.subTable),a.appendChild(n)}return i.appendChild(a),o.appendChild(i),o}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}Xt(t)&&Z(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 a=this._effectiveColumns(),n=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(a,n),this._paintBody(i,a,n),this._applyStickyOffsets()}}_onRowClick(e,t,o){const i=o.composedPath?.()??[];for(const a of i){if(a instanceof Element&&a.hasAttribute("data-noclick"))return;if(a===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:o})}_toggleRow(e,t,o){o.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(o=>this._filters[o]!=="");for(let o=0;o<this._data.length;o++){const i=this._data[o];let a=!0;for(const n of t){const r=this._columns.find(p=>p.key===n);if(r&&typeof r.filterRender=="function")continue;const l=this._filters[n]??"",c=i[n],d=ot(c);if(r?.filter==="select"){if(d!==l){a=!1;break}}else if(!d.toLowerCase().includes(l.toLowerCase())){a=!1;break}}a&&e.push({row:i,index:o})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(a=>a.key===this._sort.key);if(!t)return e;const o=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((a,n)=>{const r=a.row[t.key],l=n.row[t.key],c=t.sortValue?t.sortValue(a.row,r):Yt(r),d=t.sortValue?t.sortValue(n.row,l):Yt(l);return Xo(c,d)*o}),i}_uniqueValues(e){const t=new Set;for(const o of this._data){const i=o[e];i!=null&&t.add(ot(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:o,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(o,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,o){return this._stacked||o.sticky===!1?!1:o.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let o=-1;for(let i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(o=i);return o}_applyCellClasses(e,t,o,i){t.key===ce&&e.classList.add("col-expander"),t.key===de&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(o,i,t)&&(e.classList.add("is-sticky"),o===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:de,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:ce,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 o=Array.from(t.children),i=[];let a=0;for(let r=0;r<o.length;r++)i[r]=a,o[r].classList.contains("is-sticky")&&(a+=o[r].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(r=>{const l=Array.from(r.children);for(let c=0;c<l.length;c++)l[c].classList.contains("is-sticky")&&(l[c].style.insetInlineStart=`${i[c]}px`)}),this._maybeWarnStickyOffsetRace(o,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const o=this._readStickyColumns();if(o<2)return;const i=Math.min(o-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const a=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 ${a}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 o=t.offsetHeight;o>0&&this.style.setProperty("--os-ui-table-header-height",`${o}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."))}};ye.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],ye.styles=[Go],ye.help=void 0;let st=ye;function Xt(s){return!!s&&s.__wpdHtml===!0}function Zo(s,e){return s.stack?s.stack:e===0?"title":s.label?"meta":"actions"}function Le(s){return s&&typeof s=="object"&&typeof s.slot=="string"?s.slot:null}function ot(s){if(s==null)return"";if(Le(s)!==null){const e=s.text;return e==null?"":String(e)}return String(s)}function Yt(s){return Le(s)!==null?ot(s):s}function Xo(s,e){if(s===e)return 0;if(s==null)return-1;if(e==null)return 1;if(typeof s=="number"&&typeof e=="number")return s-e;if(s instanceof Date&&e instanceof Date)return s.getTime()-e.getTime();const t=Number(s),o=Number(e);return Number.isFinite(t)&&Number.isFinite(o)?t-o:String(s).localeCompare(String(e))}W("os-table",st);const Yo=R` ${fe}:host{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-select__label{font-size:13px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;padding:8px 12px;background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:1.5;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}.os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-border-strong,#8c8f94 )}.os-select__trigger:focus,.os-select__trigger:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.os-select__trigger:disabled{opacity:0.5;cursor:not-allowed}:host( [ plain ] ){display:inline-flex;flex-direction:row;align-items:center}:host( [ plain ] ) .os-select__label{display:none}:host( [ plain ] ) .os-select__trigger{width:auto;padding:4px 6px;background:transparent;border-color:transparent;border-radius:6px}:host( [ plain ] ) .os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border-color:transparent}:host( [ plain ] ) .os-select__trigger:focus,:host( [ plain ] ) .os-select__trigger:focus-visible{border-color:var( --os-ui-accent,#2271b1 )}:host( [ plain ] ) .os-select__value{flex:0 1 auto}.os-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-select__value--placeholder{color:var( --os-ui-fg-muted,#646970 )}.os-select__chevron{flex:0 0 auto;pointer-events:none;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger:hover .os-select__chevron{color:var( --os-ui-fg,#1d2327 )}.os-select__trigger:focus .os-select__chevron,.os-select__trigger:focus-visible .os-select__chevron{color:var( --os-ui-accent,#2271b1 )}.os-select__popup{position:fixed;inset:auto;margin:0;max-height:min( 320px,60vh );overflow-y:auto;padding:4px;background:var( --os-ui-surface,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;box-shadow:0 12px 32px rgba( 0,0,0,0.45 );color:var( --os-ui-fg,#1d2327 )}.os-select__popup:not( [ data-open ] ){display:none}.os-select__popup:popover-open{display:block}.os-select__popup[ data-open ]{position:absolute;top:calc( 100% + 4px );left:0;min-width:100%;z-index:1000}:host{position:relative}.os-select__option{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;white-space:nowrap}.os-select__check{flex:0 0 auto;visibility:hidden}.os-select__option[ aria-selected='true' ] .os-select__check{visibility:visible}.os-select__option[ data-active ],.os-select__option:hover{background:var( --os-ui-accent,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-select__option[ aria-disabled='true' ]{opacity:0.5;cursor:not-allowed}.os-select__option[ aria-disabled='true' ]:hover{background:transparent;color:inherit}@media ( prefers-reduced-motion:reduce ){.os-select__trigger{transition-duration:1ms}}`,Jo=R`:host{display:none}`,ke=class ke extends U{render(){return b``}};ke.props=["value","disabled"],ke.styles=[Jo],ke.help=void 0;let it=ke;W("os-option",it);const we=class we extends U{constructor(){super(...arguments),this._optionObserver=null,this._open=!1,this._activeIndex=-1,this._typed="",this._dismissedAt=0,this._typedTimer=null,this._onWindowScroll=e=>{const t=e.target,o=this._popup();o&&t instanceof Node&&(t===o||o.contains(t))||this._hide()},this._onWindowResize=()=>this._hide()}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const a of Array.from(t))a.remove();for(const a of e){const n=document.createElement("os-option");n.setAttribute("value",a.value),n.textContent=a.label,this.appendChild(n)}const o=this.value;!(o!==null&&e.some(a=>a.value===o))&&e.length>0&&(this.value=e[0].value),this.requestUpdate()}connectedCallback(){super.connectedCallback(),Mt(this),this._optionObserver=new MutationObserver(()=>this.requestUpdate()),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._teardownDismiss(),this._open=!1,this._typedTimer&&(clearTimeout(this._typedTimer),this._typedTimer=null)}render(){const e=this.label||"",t=this.value,o=this.placeholder||"",i=this.disabled!==null;e&&this.setAttribute("aria-label",e);const a=this.getAttribute("aria-label")||"",n=e||a||o,r=this._readOptions(),l=r.find(_=>_.value===t),c=l?l.label:o,d=this.id||"os-unnamed",p=`${d}__listbox`,g=`${d}__trigger`,v=this._open&&this._activeIndex>=0?`${d}__opt-${this._activeIndex}`:"";return b` | |
| 209 | 209 | ${e?b`<label |
| 210 | 210 | class="os-select__label" |
| 211 | 211 | for=${g} |
| 212 | 212 | >${e}</label>`:b``} |
| @@ -468,9 +468,9 @@ | ||
| 468 | 468 | > |
| 469 | 469 | <span class="os-multiselect__summary">${a}</span> |
| 470 | 470 | ${Y("chevron-right",{size:16,rotate:90,className:"os-multiselect__chevron"})} |
| 471 | 471 | </button> |
| 472 | - `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_readValues(){return(this.value??"").split(",").map(t=>t.trim()).filter(t=>t!=="")}_writeValueAttribute(e){const t=e.join(",");this.value=t}_summarize(e){const t=this._readValues();if(t.length===0)return e;const o=this._readOptions(),i=new Map(o.map(a=>[a.value,a.label]));return t.length===1?i.get(t[0])??t[0]:`${t.length} selected`}_isOpen(){return this.open!==null}_onTriggerClick(e){e.stopPropagation(),e.preventDefault(),this.disabled===null&&(this._popover?this._closePopover():this._openPopover())}_openPopover(){if(this._popover)return;const e=document.createElement("div");e.className="os-multiselect__popover",e.setAttribute("role","listbox"),e.setAttribute("aria-multiselectable","true"),e.style.setProperty("--wp-admin-theme-color",getComputedStyle(this).getPropertyValue("--wp-admin-theme-color")||"#2271b1"),document.body.appendChild(e),this._popover=e,this._refreshPopover(),this._placePopover();const t=n=>{const r=n.target;if(!r)return;const l=this.shadowRoot?.querySelector(".os-multiselect__trigger");e.contains(r)||l&&l.contains(r)||this._closePopover()},o=n=>{n.key==="Escape"&&(n.stopPropagation(),this._closePopover(),this.shadowRoot?.querySelector(".os-multiselect__trigger")?.focus())},i=()=>this._placePopover(),a=()=>{if(!this._hasMore||this._loadingMore)return;const n=e.scrollHeight,r=e.clientHeight,l=e.scrollTop;n-(l+r)<64&&this.emit("os-multiselect-load-more",{})};setTimeout(()=>{document.addEventListener("pointerdown",t,!0)},0),document.addEventListener("keydown",o,!0),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),e.addEventListener("scroll",a),this._teardownOpen=()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",o,!0),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),e.removeEventListener("scroll",a)},this.setAttribute("open",""),this.requestUpdate(),this.emit("os-multiselect-open",{})}_closePopover(){this._teardownOpen&&(this._teardownOpen(),this._teardownOpen=null),this._popover&&(this._popover.remove(),this._popover=null,this.removeAttribute("open"),this.requestUpdate(),this.emit("os-multiselect-close",{}))}_refreshPopover(){const e=this._popover;if(!e)return;const t=this._readOptions(),o=new Set(this._readValues());if(e.replaceChildren(),t.length===0){const i=document.createElement("div");i.className="os-multiselect__empty",i.textContent="No options",e.appendChild(i);return}if(o.size>0){const i=document.createElement("button");i.type="button",i.className="os-multiselect__clear",i.textContent="Clear",i.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this._writeValueAttribute([]),this.requestUpdate(),this._refreshPopover(),this._emitPick()}),e.appendChild(i)}for(const i of t){const a=document.createElement("label");a.className="os-multiselect__option",a.setAttribute("role","option"),a.setAttribute("aria-selected",o.has(i.value)?"true":"false"),i.disabled&&(a.setAttribute("aria-disabled","true"),a.dataset.disabled="true");const n=document.createElement("input");n.type="checkbox",n.checked=o.has(i.value),n.disabled=i.disabled,n.addEventListener("change",()=>{const l=new Set(this._readValues());n.checked?l.add(i.value):l.delete(i.value);const c=t.map(d=>d.value).filter(d=>l.has(d));this._writeValueAttribute(c),a.setAttribute("aria-selected",n.checked?"true":"false"),this.requestUpdate(),this._refreshPopover(),this._emitPick()});const r=document.createElement("span");r.textContent=i.label,a.appendChild(n),a.appendChild(r),e.appendChild(a)}if(this._loadingMore){const i=document.createElement("div");i.className="os-multiselect__loading";const a=document.createElement("span");a.className="os-multiselect__spinner",a.setAttribute("aria-hidden","true");const n=document.createElement("span");n.textContent="Loading…",i.appendChild(a),i.appendChild(n),e.appendChild(i)}}_placePopover(){const e=this._popover,t=this.shadowRoot?.querySelector(".os-multiselect__trigger");if(!e||!t)return;const o=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=Math.max(o.width,200);e.style.minWidth=`${n}px`;let r=o.left;r+n>i-8&&(r=Math.max(8,i-n-8)),e.style.left=`${r}px`,e.style.top=`${o.bottom+4}px`;const l=e.offsetHeight||200;o.bottom+4+l>a-8&&(e.style.top=`${Math.max(8,o.top-l-4)}px`)}_emitPick(){const e=this._readValues();this.emit("os-pick",{value:e.join(","),values:e})}};$e.props=["value","label","placeholder","disabled","name","open"],$e.styles=[Qo],$e.help=void 0;let at=$e;W("os-multiselect",at);const ti="openstation.postsWindow.columns",si="openstation.postsWindow.statusSegments",oi="openstation.postsWindow.bulkActions",ii="openstation.postsWindow.toolbarTrailing",ni="openstation.postsWindow.opened",ai="openstation.postsWindow.dataLoaded",rt="[openstation:desktop-mode-posts]",Jt=new Set(["title"]),ri=new Set(["title","author","parent","date"]);function Qt(s){try{const e=window.wp?.os;if(e&&typeof e.getOsSettings=="function"){const o=e.getOsSettings()[s];if(Array.isArray(o))return new Set(o.filter(i=>typeof i=="string"))}}catch{}return new Set}const lt={authors:[],tags:[]};function es(s,e,t,o){const i="osPostsFilterMounted",a=s,n=t.map(c=>({value:String(c.id),label:c.name})),r=n.map(c=>`${c.value}:${c.label}`).join("|");if(a[i]){const c=a[i];c.listSig!==r&&(c.picker.items=n,c.listSig=r),c.picker.getAttribute("value")!==e.value&&c.picker.setAttribute("value",e.value),c.picker.hasMore=!!o.hasMore;return}const l=document.createElement("os-multiselect");if(l.setAttribute("placeholder",o.label),l.setAttribute("aria-label",o.ariaLabel),l.setAttribute("data-noclick",""),l.setAttribute("value",e.value),o.dataKey&&l.setAttribute("data-key",o.dataKey),s.appendChild(l),l.items=n,l.hasMore=!!o.hasMore,l.addEventListener("os-pick",c=>{const d=c.detail?.value??"";e.value=d,e.setValue(d)}),o.onLoadMore){const c=o.onLoadMore;l.addEventListener("os-multiselect-load-more",()=>{l.loadingMore=!0,c()})}a[i]={picker:l,listSig:r}}function ts(s,e,t){const o={key:"title",label:u("Title"),sortable:!0,sticky:!0,render:(c,d)=>X(e,d.id,"title",()=>mo(d,s))},i={key:"author",label:u("Author"),sortable:!0,width:"180px",filterRender:(c,d)=>es(c,d,t.authors,{label:u("All authors"),ariaLabel:u("Filter by author")}),render:(c,d)=>X(e,d.id,"author",()=>bo(d))},a={key:"date",label:u("Date"),sortable:!0,width:"170px",sortValue:c=>Date.parse(c.date_gmt+"Z")||0,render:(c,d)=>X(e,d.id,"date",()=>_o(d))};if(s.extra.mode==="pages")return[o,i,{key:"parent",label:u("Parent"),width:"200px",render:(c,d)=>X(e,d.id,"parent",()=>Wo(d,s))},{key:"template",label:u("Template"),width:"180px",render:(c,d)=>X(e,d.id,"template",()=>jo(d,s))},{key:"slug",label:u("Slug"),width:"200px",render:(c,d)=>X(e,d.id,"slug",()=>Ko(d,s))},{key:"comments",label:u("Comments"),width:"110px",sortValue:c=>typeof c.openstation_comment_count=="number"?c.openstation_comment_count:0,render:(c,d)=>X(e,d.id,"comments",()=>Bo(d))},a];const n=[o,i],{categories:r,tags:l}=s.cells;return r&&n.push({key:"categories",label:u("Categories"),width:"260px",render:(c,d)=>X(e,d.id,"categories",()=>r(d,s))}),l&&n.push({key:"tags",label:u("Tags"),minWidth:"360px",filterRender:(c,d)=>es(c,d,t.tags.map(p=>({id:p.id,name:p.name})),{label:u("All tags"),ariaLabel:u("Filter by tag"),dataKey:"tags",hasMore:!!t.tagsHasMore,onLoadMore:t.loadMoreTags}),render:(c,d)=>X(e,d.id,"tags",()=>l(d,s))}),n.push(a),n}function ss(s,e,t=lt){const o=ts(s,e,t),i=window.wp?.hooks;return i&&typeof i.applyFilters=="function"?i.applyFilters(ti,o):o}function li(s,e=lt,t=new Set){const o=new Set(ts(s,new Map,e).map(i=>i.key));return ct(s,new Map,e,!1,t).filter(i=>!o.has(i.key))}function ci(s){return ss(s,new Map).filter(e=>!Jt.has(e.key)).map(e=>({key:e.key,label:e.label||e.key}))}function ct(s,e,t=lt,o=!1,i=new Set){const a=ss(s,e,t),n=i.size===0?a:a.filter(r=>Jt.has(r.key)||!i.has(r.key));return o?n.filter(r=>ri.has(r.key)):n}function di(){return[{value:"",label:u("All")},{value:"publish",label:u("Published")},{value:"draft",label:u("Drafts")},{value:"pending",label:u("Pending")},{value:"future",label:u("Scheduled")},{value:"trash",label:u("Trash")}]}function pi(){const s=window.wp?.hooks,e=di();if(!s||typeof s.applyFilters!="function")return e;try{const t=s.applyFilters(si,e);return Array.isArray(t)&&t.length>0?t:e}catch(t){return console.error(`${rt} status-segments filter threw; falling back to defaults:`,t),e}}function ui(s,e){return[{id:"trash",label:u("Move to trash"),icon:"dashicons-trash",variant:"danger",confirm:t=>H(s==="pages"?Fe("Move %d page to the trash?","Move %d pages to the trash?",t):Fe("Move %d post to the trash?","Move %d posts to the trash?",t),t),run:async(t,o)=>{const i=o.table.data??[],a=t.filter(n=>{const r=i.find(l=>l.id===n);return r&&r.status!=="trash"});return a.length>0&&await e(a),o.table.clearSelection(),!1}}]}function hi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return s;try{const t=e.applyFilters(oi,s);return Array.isArray(t)?t:s}catch(t){return console.error(`${rt} bulk-actions filter threw; falling back to defaults:`,t),s}}function fi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return[];try{const t=e.applyFilters(ii,[],s);return Array.isArray(t)?t.filter(o=>o instanceof HTMLElement):[]}catch(t){return console.error(`${rt} toolbar-trailing filter threw; ignoring:`,t),[]}}function gi(s,e="date"){switch(s){case"title":case"author":case"date":case"modified":return s;case"comments":return"comment_count";default:return e}}function mi(s){return s==="comment_count"?"comments":s}function Re(s,e,t){const o=window.wp?.os;o&&typeof o.broadcast=="function"&&o.broadcast("os.term.changed",{source:"posts-window",taxonomy:s,action:e,id:t})}function oe(s){const e=new URLSearchParams;for(const[o,i]of Object.entries(s))i!==void 0&&i!==""&&e.set(o,String(i));const t=e.toString();return t?`?${t}`:""}function bi(s){const e=async(n,r={})=>{const l=await s(n,{...r,headers:{...r.body?{"Content-Type":"application/json"}:{},...r.headers??{}}});if(!l.ok){let d=`${l.status} ${l.statusText}`;try{const p=await l.json();p&&typeof p.message=="string"&&(d=p.message)}catch{}throw new Error(d)}return{data:r.expectJson===!1?null:await l.json(),headers:l.headers}},t=async(n,r)=>{const l={per_page:20,_fields:"id,name,slug,count",orderby:"count",order:"desc"};n&&(l.search=n,l.orderby="name",l.order="asc");const{data:c}=await e(`wp/v2/tags${oe(l)}`,{method:"GET",signal:r});return Array.isArray(c)?c:[]},o=async n=>{const{data:r}=await e(`wp/v2/categories${oe({per_page:100,_fields:"id,name,slug,parent",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]},i=(n,r=0)=>{const l=n.openstation_count;return{id:n.id??r,name:n.name??"",slug:n.slug??"",parent:n.parent??0,count:typeof l=="number"?l:n.count??0,description:n.description??"",isDefault:n.openstation_is_default===!0}},a=async(n,r={})=>{const{data:l,headers:c}=await e(`wp/v2/${n}${oe({per_page:r.perPage??50,page:r.page??1,_fields:"id,name,slug,parent,count,description,openstation_is_default",orderby:r.orderby??"name",order:r.order??"asc",search:r.search,parent:typeof r.parent=="number"&&r.parent>=0?r.parent:void 0})}`,{method:"GET"});return{items:Array.isArray(l)?l.map(d=>i(d)):[],total:parseInt(c.get("X-WP-Total")??"0",10)||0,totalPages:parseInt(c.get("X-WP-TotalPages")??"0",10)||0}};return{searchTags:t,fetchAllCategories:o,async createTag(n){try{const{data:r}=await e("wp/v2/tags",{method:"POST",body:JSON.stringify({name:n})});return Re("post_tag","created",r.id),r}catch(r){const l=r instanceof Error?r.message:String(r);if(/term[\s_]?exists/i.test(l)){const c=(await t(n)).find(d=>d.name.toLowerCase()===n.toLowerCase());if(c)return c}throw r}},async updatePostTags(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({tags:r})});return l},async fetchAuthorOptions(n){try{const{data:r}=await e(`wp/v2/users${oe({per_page:100,who:"authors",_fields:"id,name",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]}catch{return[]}},async fetchTagOptions(n=1,r=50,l){try{const{data:c,headers:d}=await e(`wp/v2/tags${oe({per_page:Math.max(1,r),page:Math.max(1,n),_fields:"id,name,count",orderby:"count",order:"desc"})}`,{method:"GET",signal:l});return{items:Array.isArray(c)?c:[],totalPages:parseInt(d.get("X-WP-TotalPages")??"0",10)||0}}catch{return{items:[],totalPages:0}}},async createCategory(n,r=0,l={}){const c={name:n,parent:r};l.slug&&(c.slug=l.slug),l.description&&(c.description=l.description);try{const{data:d}=await e("wp/v2/categories",{method:"POST",body:JSON.stringify(c)});return Re("category","created",d.id),d}catch(d){const p=d instanceof Error?d.message:String(d);if(/term[\s_]?exists/i.test(p)){const g=(await o()).find(v=>v.name.toLowerCase()===n.toLowerCase()&&v.parent===r);if(g)return g}throw d}},async updatePostCategories(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({categories:r})});return l},fetchTerms:a,async fetchAllTerms(n){const r=[];let l=1;for(;l<=5;){const c=await a(n,{page:l,perPage:100});if(r.push(...c.items),l>=c.totalPages)break;l++}return r},async fetchTagCooccurrence(n="tags",r=8){const{data:l}=await e(`desktop-mode/v1/tag-cooccurrence${oe({taxonomy:n==="tags"?"post_tag":"category",limit:r})}`,{method:"GET"}),c=new Map,d=l&&typeof l=="object"&&!Array.isArray(l)?l.pairs:void 0;if(!d)return c;for(const[p,g]of Object.entries(d)){const v=parseInt(p,10);if(!Number.isFinite(v)||v<=0)continue;const _=[];for(const x of g){const h=Number(x?.id),f=Number(x?.shared);Number.isFinite(h)&&h>0&&Number.isFinite(f)&&f>0&&_.push({id:h,shared:f})}_.length>0&&c.set(v,_)}return c},async updateTerm(n,r,l){const{data:c}=await e(`wp/v2/${n}/${r}`,{method:"POST",body:JSON.stringify(l)});return Re(n==="categories"?"category":"post_tag","updated",r),i(c,r)},async deleteTerm(n,r){await e(`wp/v2/${n}/${r}?force=true`,{method:"DELETE"}),Re(n==="categories"?"category":"post_tag","deleted",r)},async fetchTermPosts(n,r,l,c){const{data:d,headers:p}=await e(`wp/v2/posts${oe({[n]:r,per_page:c,page:l,status:"any",_fields:"id,title,status"})}`,{method:"GET"}),g=parseInt(p.get("X-WP-Total")??"",10);return{items:(Array.isArray(d)?d:[]).map(v=>({id:v.id,title:v.title?.rendered||`#${v.id}`})),totalPages:Math.max(1,parseInt(p.get("X-WP-TotalPages")??"1",10)||1),total:Number.isFinite(g)?g:-1}},async fetchTermCounts(n,r){const{data:l}=await e(`desktop-mode/v1/term-counts${oe({taxonomy:n,ids:r.join(",")})}`,{method:"GET"});return l&&typeof l=="object"?l:{}}}}const _i="[openstation:desktop-mode-posts]",V=s=>s.root.querySelector("[data-os-posts-table]");function vi(s){return{page:s.page,perPage:s.perPage,search:s.search||void 0,status:s.status||void 0,orderby:s.orderby,order:s.order,author:s.author.length>0?s.author:void 0,tag:s.tag.length>0?s.tag:void 0}}function dt(s,e){if(!e.postsCtx){const t={body:s.root,get table(){return V(s)},refresh:()=>s.dispatch("refresh").then(()=>{}),getSelectedIds:()=>Array.from(V(s)?.selection??[]).map(o=>Number(o)),getSelectedRows:()=>{const o=new Set(t.getSelectedIds());return(V(s)?.data??[]).filter(i=>o.has(i.id))},getCurrentParams:()=>vi(s.state)};e.postsCtx=t}return e.postsCtx}async function xi(s,e,t){const o=t.getSelectedIds();if(o.length===0)return;const{confirm:i}=e;if(i){const a=typeof i=="function"?i(o.length):H(i,o.length);if(!await(s.host.confirm?.({message:a,danger:!0})??Promise.resolve(!1)))return}try{if(await e.run(o,t)===!1)return}catch(a){console.error(`${_i} bulk action "${e.id}" failed`,a)}t.table.clearSelection(),await t.refresh()}function yi(s){const e={items:s.list.items,total:s.list.total,totalPages:s.list.pages,page:s.list.page},t=window.wp?.hooks;t&&typeof t.doAction=="function"&&t.doAction(ai,e),document.dispatchEvent(new CustomEvent("os-posts-window-data-loaded",{detail:e}))}class ki{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.generation=0}queryKey(e){return JSON.stringify([e.search,e.status,e.orderby,e.order,e.author,e.tag,e.perPage])}reconcile(e){this.ctx=e;const{state:t,data:o}=e,i=this.queryKey(t);if(i!==this.key&&(this.generation++,this.expected=0,this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&o&&o!==this.lastData&&o.list.page===t.page&&(!o.query||this.queryKey(o.query)===i))if(this.lastData=o,o.list.error)this.error=!0;else{if(o.list.page>1&&this.page===0&&o.list.page!==this.expected&&!o.list.replace)return{...e,data:{...o,list:{...o.list,items:this.items}}};const a=o.list.page===1||o.list.replace?o.list.items:[...this.items,...o.list.items];this.items=Array.from(new Map(a.map(n=>[n.id,n])).values()),this.page=o.list.page,this.pages=o.list.pages,this.error=!1}return o?{...e,data:{...o,list:{...o.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)return;const t=this.generation;this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const o=await e.dispatch("page",{page:this.expected});t===this.generation&&(!o||e.data?.list.error)&&(this.error=!0)}catch{t===this.generation&&(this.error=!0)}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}tail(){let e=this.items.length?u("You’re all caught up."):"";return this.pending?e=u("Loading more…"):this.hasMore&&(e=b`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?u("Could not load more. Retry"):u("Load more")}</os-button>`),b`<div class="os-posts-desk__continuation" data-content-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-posts-desk__feed [data-content-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-posts-desk__feed"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}function wi(s){const e=new DOMParser().parseFromString(s,"text/html");e.querySelectorAll("script, style").forEach(i=>i.remove()),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, br").forEach(i=>i.append(e.createTextNode(" ")));const t=e.body.textContent||"",o=Intl.Segmenter;return o?Array.from(new o(void 0,{granularity:"word"}).segment(t)).filter(i=>i.isWordLike).length:(t.match(/[\p{L}\p{N}]+/gu)||[]).length}async function $i(s,e,t,o){const i={},a=async(l,c,d,p)=>{try{const g=await s(c,{...d,signal:o},{silent:!0});if(!g.ok)return i[l]=g.status===429||g.status>=500?"retry":"unavailable",null;const v=await p(g);return v===null&&(i[l]="unavailable"),v}catch{return i[l]="retry",null}},[n,r]=await Promise.all([a("words",`wp/v2/${e}/${t}?context=edit&_fields=content`,{},async l=>{const c=await l.json();return typeof c.content?.rendered=="string"&&!c.content.protected?wi(c.content.rendered):null}),a("comments",`wp/v2/comments?post=${t}&status=approve&per_page=1`,{method:"HEAD"},async l=>{const c=l.headers.get("X-WP-Total");return c!==null&&/^\d+$/.test(c)?Number(c):null})]);return Object.keys(i).length?{words:n,comments:r,errors:i}:{words:n,comments:r}}function Ci(s,e,t){const o=new AbortController,i=new Map,a=new Set,n=new Map,r=new Map,l=new Set,c=new WeakMap;let d=0;const p=()=>{for(const x of s.querySelectorAll("[data-content-metrics]")){const h=i.get(x.dataset.contentMetrics||"");if(!h)continue;for(const y of["words","comments"]){const w=x.querySelector(`[data-metric="${y}"]`);w?.setAttribute("value",h[y]===null?"—":h[y].toLocaleString());let k=h.errors?.[y]?u("This count is unavailable or access is restricted."):"";h.errors?.[y]==="retry"&&(k=u("Could not load this count.")),w?.setAttribute("title",k)}const f=x.dataset.contentMetrics||"";let m=x.querySelector("[data-retry-metrics]");Object.values(h.errors||{}).includes("retry")&&(r.get(f)||0)>=3?m||(m=document.createElement("os-button"),m.setAttribute("variant","ghost"),m.setAttribute("data-retry-metrics",""),m.textContent=u("Retry counts"),m.addEventListener("click",()=>{r.delete(f),i.delete(f),m?.remove(),g(f,Number(x.dataset.postId)),v()}),x.append(m)):m?.remove()}},g=(x,h)=>{!a.has(x)&&!o.signal.aborted&&(a.add(x),n.set(x,h))},v=()=>{if(!o.signal.aborted)for(;d<2&&n.size;){const[x,h]=n.entries().next().value;n.delete(x),d++,r.set(x,(r.get(x)||0)+1),$i(e,t,h,o.signal).then(f=>{if(!o.signal.aborted&&(i.set(x,f),p(),Object.values(f.errors||{}).includes("retry")&&r.get(x)<3)){const m=setTimeout(()=>{l.delete(m),g(x,h),v()},500*r.get(x));l.add(m)}}).finally(()=>{a.delete(x),d--,v()})}},_=typeof IntersectionObserver>"u"?null:new IntersectionObserver(x=>{for(const h of x){if(!h.isIntersecting)continue;const f=h.target,m=f.dataset.contentMetrics||"";i.has(m)||g(m,Number(f.dataset.postId)),_?.unobserve(f)}v()},{root:s.querySelector(".os-posts-desk__feed"),rootMargin:"80px"});return{sync:()=>{p(),s.querySelectorAll("[data-content-metrics]").forEach(x=>{const h=x.getAttribute("data-content-metrics")||"";c.get(x)!==h&&(c.set(x,h),_?.observe(x))})},dispose:()=>{o.abort(),_?.disconnect(),l.forEach(clearTimeout),l.clear(),n.clear(),i.clear()}}}const os=R` .desktop-mode-posts .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;align-content:start;gap:8px;padding:8px 12px}.os-posts-desk__continuation{grid-column:1 / -1;padding:14px 8px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__filter-toggle{display:none}.os-posts-desk__metrics{display:flex;gap:22px;margin-block:18px 0;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:24px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-posts-desk__metrics os-stat{min-inline-size:62px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{position:relative;border-radius:3px 12px 12px 3px;padding-inline-start:34px;background-image:repeating-linear-gradient(transparent 0 27px,var( --os-ui-surface-subtle,#f0f0f1 ) 27px 28px);background-position:0 10px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{content:'';position:absolute;inset-block:0;inset-inline-start:22px;border-inline-start:1px solid var( --os-ui-accent-dim,#c3c4c7 );opacity:.3}.desktop-mode-pages .os-posts-desk__story{position:relative;border-radius:3px 22px 3px 3px;box-shadow:3px 4px 0 -1px var( --os-ui-surface,#fff ),3px 4px 0 0 var( --os-ui-border,#dcdcde )}.desktop-mode-pages .os-posts-desk__story::after{content:'';position:absolute;inset-block-start:0;inset-inline-end:0;inline-size:16px;block-size:16px;border-end-start-radius:3px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.desktop-mode-pages .os-posts-desk__select{margin-inline-end:6px}.os-pages-atlas-host{flex:1;min-block-size:0;display:flex;position:relative}@container content-desk (max-width:600px){.os-posts-desk__hero{padding:8px 12px;min-block-size:36px;gap:8px}.os-posts-desk__hero h2{font-size:17px;margin:0;letter-spacing:-.03em}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.desktop-mode-posts .os-app-list__toolbar{display:none}.desktop-mode-posts[data-desk-options="true"] .os-app-list__toolbar{display:flex;padding:6px 12px}.os-posts-desk__tools{padding:6px 12px;gap:8px}.os-posts-desk__tools .os-app-list__search{flex:1;min-inline-size:0}.os-posts-desk__filter-toggle{display:block;flex:0 0 auto}.os-posts-desk__tools:not(.is-expanded)>os-select,.os-posts-desk__tools:not(.is-expanded)>os-checkbox{display:none}.os-posts-desk__tools.is-expanded>os-checkbox{flex-basis:100%}.os-posts-desk__feed,.desktop-mode-pages .os-posts-desk__feed{display:block;padding:8px 12px 14px}.os-posts-desk__story,.desktop-mode-pages .os-posts-desk__story,.os-posts-desk__story.is-current{padding:9px 12px;margin-block-end:9px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{padding-inline-start:24px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{inset-inline-start:14px}.os-posts-desk__story-top{margin-block-end:3px;min-block-size:18px}.os-posts-desk__story-content,.desktop-mode-pages .os-posts-desk__story-content{flex-direction:row;gap:10px}.os-posts-desk__page-mark,.os-posts-desk__kicker{display:none}.os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__story h3{font-size:18px;margin-block-end:2px;line-height:1.2}.os-posts-desk__thumbnail{inline-size:46px;block-size:46px}.os-posts-desk__excerpt{-webkit-line-clamp:1;line-clamp:1;font-size:11px;line-height:1.4}.desktop-mode-pages .os-posts-desk__excerpt{display:none}.os-posts-desk__metrics{gap:14px;margin-block-start:7px;--os-ui-stat-value-size:14px}.os-posts-desk__metrics os-stat{min-inline-size:0;flex-direction:row;align-items:baseline}.os-posts-desk__metrics os-stat::part(value),.os-posts-desk__metrics os-stat::part(label){display:inline}.os-posts-desk__metrics os-stat::part(label){font-size:9px;margin-inline-start:4px;letter-spacing:0;text-transform:none}.os-posts-desk__story-foot{margin-block-start:4px;gap:4px;flex-wrap:nowrap}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline,.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1;margin:0;font-size:10px;min-inline-size:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-posts-desk__story-foot os-button{--os-ui-button-padding:5px 9px;font-size:11px}.desktop-mode-posts .os-app-list__pager{padding:6px 12px;gap:4px;flex-wrap:nowrap}.desktop-mode-posts .os-app-list__pager-meta{font-size:10px;flex:1}.desktop-mode-posts .os-app-list__pager-perpage{display:none}.desktop-mode-posts .os-app-list__pager-nav{flex:0 0 auto}.desktop-mode-posts .os-app-list__pager-nav os-button{font-size:10px}}`,is=R` .desktop-mode-posts{container:content-desk / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-posts [hidden]{display:none !important}.os-posts-desk__hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px 20px;background:var( --os-ui-surface,#fff )}.os-posts-desk__eyebrow,.os-posts-desk__inspector-head{font-size:10px;font-weight:600;letter-spacing:0.14em;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero h2{margin:7px 0;font-size:clamp( 24px,3.4cqi,38px );font-weight:500;letter-spacing:-0.045em;line-height:1.1;color:inherit}.os-posts-desk__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero>os-button{flex-shrink:0}.desktop-mode-posts .os-app-list__toolbar{padding:12px 24px;background:var( --os-ui-surface,#fff );flex-wrap:wrap}.desktop-mode-posts .os-app-list__toolbar-left{flex-wrap:wrap;min-inline-size:0}.desktop-mode-posts .os-app-list__search{min-inline-size:150px;flex:1 1 190px}.os-posts-desk__tools{display:flex;align-items:center;gap:10px;padding:9px 24px;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );flex-shrink:0}.os-posts-desk__tools>os-checkbox{margin-inline-end:auto;font-size:11px}.os-posts-desk__tools os-select{inline-size:155px}.os-posts-desk__workspace{display:flex;flex:1;min-block-size:0;min-inline-size:0;overflow:hidden}.os-posts-desk__feed{flex:1;min-inline-size:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:20px 24px 32px}.os-posts-desk__story{padding:20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:12px;background:var( --os-ui-surface,#fff );margin-block-end:12px;min-inline-size:0;transition:border-color 140ms ease,box-shadow 140ms ease}.os-posts-desk__story:hover{border-color:var( --os-ui-accent-dim,#2271b1 )}.os-posts-desk__story.is-current{border-inline-start:3px solid var( --os-ui-accent,#2271b1 );padding-inline-start:18px}.os-posts-desk__story-top{display:flex;align-items:center;gap:8px;margin-block-end:13px;min-block-size:22px}.os-posts-desk__id{margin-inline-start:auto;flex:0 0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;font-variant-numeric:tabular-nums;--os-ui-button-padding:3px 5px}.os-posts-desk__id::part(button){color:var( --os-ui-fg-muted,#646970 );gap:5px;min-block-size:24px}.os-posts-desk__id .dashicons{font-size:12px;inline-size:12px;block-size:12px}.os-posts-desk__id + .os-posts-desk__select{margin-inline-start:0}.os-posts-desk__select{margin-inline-start:auto;flex:0 0 20px;inline-size:20px;block-size:20px}.os-posts-desk__status,.os-posts-desk__role{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__status::before{content:"";inline-size:6px;block-size:6px;border-radius:50%;background:currentColor}.os-posts-desk__status[data-status="publish"]{color:var( --os-ui-success-fg,#008a20 )}.os-posts-desk__status[data-status="draft"],.os-posts-desk__status[data-status="pending"]{color:var( --os-ui-warning,#996800 )}.os-posts-desk__status[data-status="future"],.os-posts-desk__role{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__role{border-inline-start:1px solid var( --os-ui-border,#dcdcde );padding-inline-start:8px}.os-posts-desk__story-content{display:flex;gap:18px;align-items:flex-start}.os-posts-desk__story-copy{min-inline-size:0;flex:1}.os-posts-desk__thumbnail{inline-size:104px;block-size:104px;object-fit:cover;border-radius:7px;flex:0 0 auto}.os-posts-desk__kicker{font-size:10px;letter-spacing:0.06em;color:var( --os-ui-fg-muted,#646970 );margin-block-end:5px;overflow-wrap:anywhere}.os-posts-desk__story h3{font-family:Georgia,"Times New Roman",serif;font-size:23px;font-weight:400;line-height:1.18;letter-spacing:-0.025em;margin:0 0 8px;color:inherit;overflow-wrap:anywhere}.os-posts-desk__story h3 a{color:inherit;text-decoration:none}.os-posts-desk__story h3 a:hover{text-decoration:underline;text-underline-offset:3px}.os-posts-desk__excerpt{font-size:12px;line-height:1.65;margin:0;color:var( --os-ui-fg-muted,#646970 );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.os-posts-desk__story-foot{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-block-start:16px}.os-posts-desk__byline{font-size:11px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 );margin-inline-end:auto;overflow-wrap:anywhere}.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1 1 100px}.os-posts-desk__plugin-stat{display:flex;flex-direction:column;gap:4px;min-width:0}.os-posts-desk__plugin-stat-value{display:flex;align-items:center;min-height:22px}.os-posts-desk__plugin-stat-label{font-size:10px;line-height:1.2;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__lock{font-size:11px;color:var( --os-ui-warning,#996800 )}.os-posts-desk__inspector{flex:0 0 330px;max-inline-size:40%;min-inline-size:0;display:flex;flex-direction:column;border-inline-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-posts-desk__inspector-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 18px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-posts-desk__inspector-head os-button{letter-spacing:normal}.os-posts-desk__inspector-scroll{flex:1;min-block-size:0;overflow:auto;padding:20px;overscroll-behavior:contain}.os-posts-desk__cover{inline-size:100%;max-block-size:180px;object-fit:cover;border-radius:8px;margin-block-end:20px}.os-posts-desk__inspector h2{font-family:Georgia,"Times New Roman",serif;font-size:27px;font-weight:400;line-height:1.2;letter-spacing:-0.03em;margin:10px 0;color:inherit;overflow-wrap:anywhere}.os-posts-desk__preview{font-size:13px;line-height:1.8;color:var( --os-ui-fg-muted,#646970 );overflow-wrap:anywhere}.os-posts-desk__dates{padding-block:16px;border-block:1px solid var( --os-ui-border,#dcdcde );--os-ui-facts-font-size:11px;--os-ui-facts-row-gap:4px;--os-ui-facts-column-gap:10px}.os-posts-desk__fields section{padding-block:8px;font-size:12px;overflow-wrap:anywhere}.os-posts-desk__fields h3{font-size:11px;font-weight:600;margin:0 0 8px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__inspector-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 20px;border-block-start:1px solid var( --os-ui-border,#dcdcde );font-size:11px}.os-posts-desk__inspector-actions a{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__empty{padding:48px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__empty>.dashicons{font-size:40px;inline-size:40px;block-size:40px}.desktop-mode-posts .os-app-list__bulk--footer{padding:10px 24px}.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__count,.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:0 1 auto}.desktop-mode-pages .os-posts-desk__feed{display:grid;grid-template-columns:repeat( auto-fill,minmax( 230px,1fr ) );align-content:start;gap:16px}.desktop-mode-pages .os-posts-desk__story{margin:0;display:flex;flex-direction:column}.desktop-mode-pages .os-posts-desk__story-content{flex-direction:column;flex:1}.desktop-mode-pages .os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__inspector h2{font-family:inherit;font-weight:600;font-size:21px}.os-posts-desk__page-mark{border:1px solid var( --os-ui-border,#dcdcde );border-radius:5px;inline-size:42px;block-size:50px;padding:8px;color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-posts-desk__page-mark i{display:block;block-size:2px;margin-block-start:4px;background:var( --os-ui-border,#dcdcde )}.os-posts-desk__page-mark i:last-child{inline-size:60%}@container content-desk (max-width:850px){.os-posts-desk__inspector{display:none}.os-posts-desk__inspector.is-open{display:flex;flex:1;max-inline-size:none;border-inline-start:0}.os-posts-desk__workspace.has-detail .os-posts-desk__feed{display:none}.os-posts-desk__hero{padding:20px}}@container content-desk (max-width:540px){.os-posts-desk__hero{padding:16px;gap:12px}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.os-posts-desk__hero h2{font-size:23px}.desktop-mode-posts .os-app-list__toolbar,.os-posts-desk__tools{padding:8px 12px}.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools>os-checkbox{flex-basis:100%}.os-posts-desk__tools os-select{flex:1;inline-size:130px}.os-posts-desk__feed{padding:12px}.os-posts-desk__story{padding:16px}.os-posts-desk__story.is-current{padding-inline-start:14px}.os-posts-desk__thumbnail{inline-size:64px;block-size:64px}.os-posts-desk__story h3{font-size:21px}}@media (prefers-reduced-motion:reduce){.os-posts-desk__story{transition:none}}.os-posts-desk__tools .os-app-list__search{flex:1 1 170px;min-inline-size:130px}.os-posts-desk__tools>os-checkbox{flex-shrink:0}@container content-desk (max-width:700px){.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools .os-app-list__search{flex-basis:calc( 100% - 145px )}.os-posts-desk__tools>os-checkbox{flex-basis:auto}.os-posts-desk__tools os-select{flex:1 1 130px;min-inline-size:130px}}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline{flex-basis:100%;margin-block-end:4px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-left{flex:1 1 140px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-trailing{flex:0 0 auto}`,Si=R` ${fe} ${Je}: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}`,Ce=class Ce extends U{render(){const e=this.checked!==null,t=this.disabled!==null,o=this.label||"",i=this.value;return b` | |
| 472 | + `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_readValues(){return(this.value??"").split(",").map(t=>t.trim()).filter(t=>t!=="")}_writeValueAttribute(e){const t=e.join(",");this.value=t}_summarize(e){const t=this._readValues();if(t.length===0)return e;const o=this._readOptions(),i=new Map(o.map(a=>[a.value,a.label]));return t.length===1?i.get(t[0])??t[0]:`${t.length} selected`}_isOpen(){return this.open!==null}_onTriggerClick(e){e.stopPropagation(),e.preventDefault(),this.disabled===null&&(this._popover?this._closePopover():this._openPopover())}_openPopover(){if(this._popover)return;const e=document.createElement("div");e.className="os-multiselect__popover",e.setAttribute("role","listbox"),e.setAttribute("aria-multiselectable","true"),e.style.setProperty("--wp-admin-theme-color",getComputedStyle(this).getPropertyValue("--wp-admin-theme-color")||"#2271b1"),document.body.appendChild(e),this._popover=e,this._refreshPopover(),this._placePopover();const t=n=>{const r=n.target;if(!r)return;const l=this.shadowRoot?.querySelector(".os-multiselect__trigger");e.contains(r)||l&&l.contains(r)||this._closePopover()},o=n=>{n.key==="Escape"&&(n.stopPropagation(),this._closePopover(),this.shadowRoot?.querySelector(".os-multiselect__trigger")?.focus())},i=()=>this._placePopover(),a=()=>{if(!this._hasMore||this._loadingMore)return;const n=e.scrollHeight,r=e.clientHeight,l=e.scrollTop;n-(l+r)<64&&this.emit("os-multiselect-load-more",{})};setTimeout(()=>{document.addEventListener("pointerdown",t,!0)},0),document.addEventListener("keydown",o,!0),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),e.addEventListener("scroll",a),this._teardownOpen=()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",o,!0),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),e.removeEventListener("scroll",a)},this.setAttribute("open",""),this.requestUpdate(),this.emit("os-multiselect-open",{})}_closePopover(){this._teardownOpen&&(this._teardownOpen(),this._teardownOpen=null),this._popover&&(this._popover.remove(),this._popover=null,this.removeAttribute("open"),this.requestUpdate(),this.emit("os-multiselect-close",{}))}_refreshPopover(){const e=this._popover;if(!e)return;const t=this._readOptions(),o=new Set(this._readValues());if(e.replaceChildren(),t.length===0){const i=document.createElement("div");i.className="os-multiselect__empty",i.textContent="No options",e.appendChild(i);return}if(o.size>0){const i=document.createElement("button");i.type="button",i.className="os-multiselect__clear",i.textContent="Clear",i.addEventListener("click",a=>{a.preventDefault(),a.stopPropagation(),this._writeValueAttribute([]),this.requestUpdate(),this._refreshPopover(),this._emitPick()}),e.appendChild(i)}for(const i of t){const a=document.createElement("label");a.className="os-multiselect__option",a.setAttribute("role","option"),a.setAttribute("aria-selected",o.has(i.value)?"true":"false"),i.disabled&&(a.setAttribute("aria-disabled","true"),a.dataset.disabled="true");const n=document.createElement("input");n.type="checkbox",n.checked=o.has(i.value),n.disabled=i.disabled,n.addEventListener("change",()=>{const l=new Set(this._readValues());n.checked?l.add(i.value):l.delete(i.value);const c=t.map(d=>d.value).filter(d=>l.has(d));this._writeValueAttribute(c),a.setAttribute("aria-selected",n.checked?"true":"false"),this.requestUpdate(),this._refreshPopover(),this._emitPick()});const r=document.createElement("span");r.textContent=i.label,a.appendChild(n),a.appendChild(r),e.appendChild(a)}if(this._loadingMore){const i=document.createElement("div");i.className="os-multiselect__loading";const a=document.createElement("span");a.className="os-multiselect__spinner",a.setAttribute("aria-hidden","true");const n=document.createElement("span");n.textContent="Loading…",i.appendChild(a),i.appendChild(n),e.appendChild(i)}}_placePopover(){const e=this._popover,t=this.shadowRoot?.querySelector(".os-multiselect__trigger");if(!e||!t)return;const o=t.getBoundingClientRect(),i=window.innerWidth,a=window.innerHeight,n=Math.max(o.width,200);e.style.minWidth=`${n}px`;let r=o.left;r+n>i-8&&(r=Math.max(8,i-n-8)),e.style.left=`${r}px`,e.style.top=`${o.bottom+4}px`;const l=e.offsetHeight||200;o.bottom+4+l>a-8&&(e.style.top=`${Math.max(8,o.top-l-4)}px`)}_emitPick(){const e=this._readValues();this.emit("os-pick",{value:e.join(","),values:e})}};$e.props=["value","label","placeholder","disabled","name","open"],$e.styles=[Qo],$e.help=void 0;let at=$e;W("os-multiselect",at);const ti="openstation.postsWindow.columns",si="openstation.postsWindow.statusSegments",oi="openstation.postsWindow.bulkActions",ii="openstation.postsWindow.toolbarTrailing",ni="openstation.postsWindow.opened",ai="openstation.postsWindow.dataLoaded",rt="[openstation:desktop-mode-posts]",Jt=new Set(["title"]),ri=new Set(["title","author","parent","date"]);function Qt(s){try{const e=window.wp?.os;if(e&&typeof e.getOsSettings=="function"){const o=e.getOsSettings()[s];if(Array.isArray(o))return new Set(o.filter(i=>typeof i=="string"))}}catch{}return new Set}const lt={authors:[],tags:[]};function es(s,e,t,o){const i="osPostsFilterMounted",a=s,n=t.map(c=>({value:String(c.id),label:c.name})),r=n.map(c=>`${c.value}:${c.label}`).join("|");if(a[i]){const c=a[i];c.listSig!==r&&(c.picker.items=n,c.listSig=r),c.picker.getAttribute("value")!==e.value&&c.picker.setAttribute("value",e.value),c.picker.hasMore=!!o.hasMore;return}const l=document.createElement("os-multiselect");if(l.setAttribute("placeholder",o.label),l.setAttribute("aria-label",o.ariaLabel),l.setAttribute("data-noclick",""),l.setAttribute("value",e.value),o.dataKey&&l.setAttribute("data-key",o.dataKey),s.appendChild(l),l.items=n,l.hasMore=!!o.hasMore,l.addEventListener("os-pick",c=>{const d=c.detail?.value??"";e.value=d,e.setValue(d)}),o.onLoadMore){const c=o.onLoadMore;l.addEventListener("os-multiselect-load-more",()=>{l.loadingMore=!0,c()})}a[i]={picker:l,listSig:r}}function ts(s,e,t){const o={key:"title",label:u("Title"),sortable:!0,sticky:!0,render:(c,d)=>X(e,d.id,"title",()=>mo(d,s))},i={key:"author",label:u("Author"),sortable:!0,width:"180px",filterRender:(c,d)=>es(c,d,t.authors,{label:u("All authors"),ariaLabel:u("Filter by author")}),render:(c,d)=>X(e,d.id,"author",()=>bo(d))},a={key:"date",label:u("Date"),sortable:!0,width:"170px",sortValue:c=>Date.parse(c.date_gmt+"Z")||0,render:(c,d)=>X(e,d.id,"date",()=>_o(d))};if(s.extra.mode==="pages")return[o,i,{key:"parent",label:u("Parent"),width:"200px",render:(c,d)=>X(e,d.id,"parent",()=>Wo(d,s))},{key:"template",label:u("Template"),width:"180px",render:(c,d)=>X(e,d.id,"template",()=>jo(d,s))},{key:"slug",label:u("Slug"),width:"200px",render:(c,d)=>X(e,d.id,"slug",()=>Ko(d,s))},{key:"comments",label:u("Comments"),width:"110px",sortValue:c=>typeof c.openstation_comment_count=="number"?c.openstation_comment_count:0,render:(c,d)=>X(e,d.id,"comments",()=>Bo(d))},a];const n=[o,i],{categories:r,tags:l}=s.cells;return r&&n.push({key:"categories",label:u("Categories"),width:"260px",render:(c,d)=>X(e,d.id,"categories",()=>r(d,s))}),l&&n.push({key:"tags",label:u("Tags"),minWidth:"360px",filterRender:(c,d)=>es(c,d,t.tags.map(p=>({id:p.id,name:p.name})),{label:u("All tags"),ariaLabel:u("Filter by tag"),dataKey:"tags",hasMore:!!t.tagsHasMore,onLoadMore:t.loadMoreTags}),render:(c,d)=>X(e,d.id,"tags",()=>l(d,s))}),n.push(a),n}function ss(s,e,t=lt){const o=ts(s,e,t),i=window.wp?.hooks;return i&&typeof i.applyFilters=="function"?i.applyFilters(ti,o):o}function li(s,e=lt,t=new Set){const o=new Set(ts(s,new Map,e).map(i=>i.key));return ct(s,new Map,e,!1,t).filter(i=>!o.has(i.key))}function ci(s){return ss(s,new Map).filter(e=>!Jt.has(e.key)).map(e=>({key:e.key,label:e.label||e.key}))}function ct(s,e,t=lt,o=!1,i=new Set){const a=ss(s,e,t),n=i.size===0?a:a.filter(r=>Jt.has(r.key)||!i.has(r.key));return o?n.filter(r=>ri.has(r.key)):n}function di(){return[{value:"",label:u("All")},{value:"publish",label:u("Published")},{value:"draft",label:u("Drafts")},{value:"pending",label:u("Pending")},{value:"future",label:u("Scheduled")},{value:"trash",label:u("Trash")}]}function pi(){const s=window.wp?.hooks,e=di();if(!s||typeof s.applyFilters!="function")return e;try{const t=s.applyFilters(si,e);return Array.isArray(t)&&t.length>0?t:e}catch(t){return console.error(`${rt} status-segments filter threw; falling back to defaults:`,t),e}}function ui(s,e){return[{id:"trash",label:u("Move to trash"),icon:"dashicons-trash",variant:"danger",confirm:t=>H(s==="pages"?Fe("Move %d page to the trash?","Move %d pages to the trash?",t):Fe("Move %d post to the trash?","Move %d posts to the trash?",t),t),run:async(t,o)=>{const i=o.table.data??[],a=t.filter(n=>{const r=i.find(l=>l.id===n);return r&&r.status!=="trash"});return a.length>0&&await e(a),o.table.clearSelection(),!1}}]}function hi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return s;try{const t=e.applyFilters(oi,s);return Array.isArray(t)?t:s}catch(t){return console.error(`${rt} bulk-actions filter threw; falling back to defaults:`,t),s}}function fi(s){const e=window.wp?.hooks;if(!e||typeof e.applyFilters!="function")return[];try{const t=e.applyFilters(ii,[],s);return Array.isArray(t)?t.filter(o=>o instanceof HTMLElement):[]}catch(t){return console.error(`${rt} toolbar-trailing filter threw; ignoring:`,t),[]}}function gi(s,e="date"){switch(s){case"title":case"author":case"date":case"modified":return s;case"comments":return"comment_count";default:return e}}function mi(s){return s==="comment_count"?"comments":s}function Re(s,e,t){const o=window.wp?.os;o&&typeof o.broadcast=="function"&&o.broadcast("os.term.changed",{source:"posts-window",taxonomy:s,action:e,id:t})}function oe(s){const e=new URLSearchParams;for(const[o,i]of Object.entries(s))i!==void 0&&i!==""&&e.set(o,String(i));const t=e.toString();return t?`?${t}`:""}function bi(s){const e=async(n,r={})=>{const l=await s(n,{...r,headers:{...r.body?{"Content-Type":"application/json"}:{},...r.headers??{}}});if(!l.ok){let d=`${l.status} ${l.statusText}`;try{const p=await l.json();p&&typeof p.message=="string"&&(d=p.message)}catch{}throw new Error(d)}return{data:r.expectJson===!1?null:await l.json(),headers:l.headers}},t=async(n,r)=>{const l={per_page:20,_fields:"id,name,slug,count",orderby:"count",order:"desc"};n&&(l.search=n,l.orderby="name",l.order="asc");const{data:c}=await e(`wp/v2/tags${oe(l)}`,{method:"GET",signal:r});return Array.isArray(c)?c:[]},o=async n=>{const{data:r}=await e(`wp/v2/categories${oe({per_page:100,_fields:"id,name,slug,parent",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r:[]},i=(n,r=0)=>{const l=n.openstation_count;return{id:n.id??r,name:n.name??"",slug:n.slug??"",parent:n.parent??0,count:typeof l=="number"?l:n.count??0,description:n.description??"",isDefault:n.openstation_is_default===!0}},a=async(n,r={})=>{const{data:l,headers:c}=await e(`wp/v2/${n}${oe({per_page:r.perPage??50,page:r.page??1,_fields:"id,name,slug,parent,count,description,openstation_is_default",orderby:r.orderby??"name",order:r.order??"asc",search:r.search,parent:typeof r.parent=="number"&&r.parent>=0?r.parent:void 0})}`,{method:"GET"});return{items:Array.isArray(l)?l.map(d=>i(d)):[],total:parseInt(c.get("X-WP-Total")??"0",10)||0,totalPages:parseInt(c.get("X-WP-TotalPages")??"0",10)||0}};return{searchTags:t,fetchAllCategories:o,async createTag(n){try{const{data:r}=await e("wp/v2/tags",{method:"POST",body:JSON.stringify({name:n})});return Re("post_tag","created",r.id),r}catch(r){const l=r instanceof Error?r.message:String(r);if(/term[\s_]?exists/i.test(l)){const c=(await t(n)).find(d=>d.name.toLowerCase()===n.toLowerCase());if(c)return c}throw r}},async updatePostTags(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({tags:r})});return l},async fetchAuthorOptions(n){try{const{data:r}=await e(`wp/v2/users${oe({per_page:100,who:"authors",_fields:"id,name",orderby:"name",order:"asc"})}`,{method:"GET",signal:n});return Array.isArray(r)?r.map(l=>({...l,name:ae(l.name)})):[]}catch{return[]}},async fetchTagOptions(n=1,r=50,l){try{const{data:c,headers:d}=await e(`wp/v2/tags${oe({per_page:Math.max(1,r),page:Math.max(1,n),_fields:"id,name,count",orderby:"count",order:"desc"})}`,{method:"GET",signal:l});return{items:Array.isArray(c)?c:[],totalPages:parseInt(d.get("X-WP-TotalPages")??"0",10)||0}}catch{return{items:[],totalPages:0}}},async createCategory(n,r=0,l={}){const c={name:n,parent:r};l.slug&&(c.slug=l.slug),l.description&&(c.description=l.description);try{const{data:d}=await e("wp/v2/categories",{method:"POST",body:JSON.stringify(c)});return Re("category","created",d.id),d}catch(d){const p=d instanceof Error?d.message:String(d);if(/term[\s_]?exists/i.test(p)){const g=(await o()).find(v=>v.name.toLowerCase()===n.toLowerCase()&&v.parent===r);if(g)return g}throw d}},async updatePostCategories(n,r){const{data:l}=await e(`wp/v2/posts/${n}`,{method:"POST",body:JSON.stringify({categories:r})});return l},fetchTerms:a,async fetchAllTerms(n){const r=[];let l=1;for(;l<=5;){const c=await a(n,{page:l,perPage:100});if(r.push(...c.items),l>=c.totalPages)break;l++}return r},async fetchTagCooccurrence(n="tags",r=8){const{data:l}=await e(`desktop-mode/v1/tag-cooccurrence${oe({taxonomy:n==="tags"?"post_tag":"category",limit:r})}`,{method:"GET"}),c=new Map,d=l&&typeof l=="object"&&!Array.isArray(l)?l.pairs:void 0;if(!d)return c;for(const[p,g]of Object.entries(d)){const v=parseInt(p,10);if(!Number.isFinite(v)||v<=0)continue;const _=[];for(const x of g){const h=Number(x?.id),f=Number(x?.shared);Number.isFinite(h)&&h>0&&Number.isFinite(f)&&f>0&&_.push({id:h,shared:f})}_.length>0&&c.set(v,_)}return c},async updateTerm(n,r,l){const{data:c}=await e(`wp/v2/${n}/${r}`,{method:"POST",body:JSON.stringify(l)});return Re(n==="categories"?"category":"post_tag","updated",r),i(c,r)},async deleteTerm(n,r){await e(`wp/v2/${n}/${r}?force=true`,{method:"DELETE"}),Re(n==="categories"?"category":"post_tag","deleted",r)},async fetchTermPosts(n,r,l,c){const{data:d,headers:p}=await e(`wp/v2/posts${oe({[n]:r,per_page:c,page:l,status:"any",_fields:"id,title,status"})}`,{method:"GET"}),g=parseInt(p.get("X-WP-Total")??"",10);return{items:(Array.isArray(d)?d:[]).map(v=>({id:v.id,title:v.title?.rendered||`#${v.id}`})),totalPages:Math.max(1,parseInt(p.get("X-WP-TotalPages")??"1",10)||1),total:Number.isFinite(g)?g:-1}},async fetchTermCounts(n,r){const{data:l}=await e(`desktop-mode/v1/term-counts${oe({taxonomy:n,ids:r.join(",")})}`,{method:"GET"});return l&&typeof l=="object"?l:{}}}}const _i="[openstation:desktop-mode-posts]",V=s=>s.root.querySelector("[data-os-posts-table]");function vi(s){return{page:s.page,perPage:s.perPage,search:s.search||void 0,status:s.status||void 0,orderby:s.orderby,order:s.order,author:s.author.length>0?s.author:void 0,tag:s.tag.length>0?s.tag:void 0}}function dt(s,e){if(!e.postsCtx){const t={body:s.root,get table(){return V(s)},refresh:()=>s.dispatch("refresh").then(()=>{}),getSelectedIds:()=>Array.from(V(s)?.selection??[]).map(o=>Number(o)),getSelectedRows:()=>{const o=new Set(t.getSelectedIds());return(V(s)?.data??[]).filter(i=>o.has(i.id))},getCurrentParams:()=>vi(s.state)};e.postsCtx=t}return e.postsCtx}async function xi(s,e,t){const o=t.getSelectedIds();if(o.length===0)return;const{confirm:i}=e;if(i){const a=typeof i=="function"?i(o.length):H(i,o.length);if(!await(s.host.confirm?.({message:a,danger:!0})??Promise.resolve(!1)))return}try{if(await e.run(o,t)===!1)return}catch(a){console.error(`${_i} bulk action "${e.id}" failed`,a)}t.table.clearSelection(),await t.refresh()}function yi(s){const e={items:s.list.items,total:s.list.total,totalPages:s.list.pages,page:s.list.page},t=window.wp?.hooks;t&&typeof t.doAction=="function"&&t.doAction(ai,e),document.dispatchEvent(new CustomEvent("os-posts-window-data-loaded",{detail:e}))}class ki{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.generation=0}queryKey(e){return JSON.stringify([e.search,e.status,e.orderby,e.order,e.author,e.tag,e.perPage])}reconcile(e){this.ctx=e;const{state:t,data:o}=e,i=this.queryKey(t);if(i!==this.key&&(this.generation++,this.expected=0,this.key=i,this.items=[],this.page=0,this.pages=0,this.lastData=null,this.error=!1),!e.loading&&o&&o!==this.lastData&&o.list.page===t.page&&(!o.query||this.queryKey(o.query)===i))if(this.lastData=o,o.list.error)this.error=!0;else{if(o.list.page>1&&this.page===0&&o.list.page!==this.expected&&!o.list.replace)return{...e,data:{...o,list:{...o.list,items:this.items}}};const a=o.list.page===1||o.list.replace?o.list.items:[...this.items,...o.list.items];this.items=Array.from(new Map(a.map(n=>[n.id,n])).values()),this.page=o.list.page,this.pages=o.list.pages,this.error=!1}return o?{...e,data:{...o,list:{...o.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)return;const t=this.generation;this.pending=!0,this.error=!1,this.expected=this.page+1,e.repaint();try{const o=await e.dispatch("page",{page:this.expected});t===this.generation&&(!o||e.data?.list.error)&&(this.error=!0)}catch{t===this.generation&&(this.error=!0)}finally{this.pending=!1,this.expected=0,this.sentinel=null,this.disposed||e.repaint()}}tail(){let e=this.items.length?u("You’re all caught up."):"";return this.pending?e=u("Loading more…"):this.hasMore&&(e=b`<os-button variant="ghost" @click=${()=>void this.more()}>${this.error?u("Could not load more. Retry"):u("Load more")}</os-button>`),b`<div class="os-posts-desk__continuation" data-content-feed-end role="status">${e}</div>`}observe(e){const t=e.querySelector(".os-posts-desk__feed [data-content-feed-end]");t!==this.sentinel&&(this.observer?.disconnect(),this.sentinel=t,!(!t||typeof IntersectionObserver>"u")&&(this.observer=new IntersectionObserver(o=>{o.some(i=>i.isIntersecting)&&!this.error&&this.more()},{root:e.querySelector(".os-posts-desk__feed"),rootMargin:"0px 0px 240px 0px"}),this.observer.observe(t)))}dispose(){this.disposed=!0,this.observer?.disconnect()}}function wi(s){const e=new DOMParser().parseFromString(s,"text/html");e.querySelectorAll("script, style").forEach(i=>i.remove()),e.querySelectorAll("p, div, li, h1, h2, h3, h4, h5, h6, br").forEach(i=>i.append(e.createTextNode(" ")));const t=e.body.textContent||"",o=Intl.Segmenter;return o?Array.from(new o(void 0,{granularity:"word"}).segment(t)).filter(i=>i.isWordLike).length:(t.match(/[\p{L}\p{N}]+/gu)||[]).length}async function $i(s,e,t,o){const i={},a=async(l,c,d,p)=>{try{const g=await s(c,{...d,signal:o},{silent:!0});if(!g.ok)return i[l]=g.status===429||g.status>=500?"retry":"unavailable",null;const v=await p(g);return v===null&&(i[l]="unavailable"),v}catch{return i[l]="retry",null}},[n,r]=await Promise.all([a("words",`wp/v2/${e}/${t}?context=edit&_fields=content`,{},async l=>{const c=await l.json();return typeof c.content?.rendered=="string"&&!c.content.protected?wi(c.content.rendered):null}),a("comments",`wp/v2/comments?post=${t}&status=approve&per_page=1`,{method:"HEAD"},async l=>{const c=l.headers.get("X-WP-Total");return c!==null&&/^\d+$/.test(c)?Number(c):null})]);return Object.keys(i).length?{words:n,comments:r,errors:i}:{words:n,comments:r}}function Ci(s,e,t){const o=new AbortController,i=new Map,a=new Set,n=new Map,r=new Map,l=new Set,c=new WeakMap;let d=0;const p=()=>{for(const x of s.querySelectorAll("[data-content-metrics]")){const h=i.get(x.dataset.contentMetrics||"");if(!h)continue;for(const y of["words","comments"]){const w=x.querySelector(`[data-metric="${y}"]`);w?.setAttribute("value",h[y]===null?"—":h[y].toLocaleString());let k=h.errors?.[y]?u("This count is unavailable or access is restricted."):"";h.errors?.[y]==="retry"&&(k=u("Could not load this count.")),w?.setAttribute("title",k)}const f=x.dataset.contentMetrics||"";let m=x.querySelector("[data-retry-metrics]");Object.values(h.errors||{}).includes("retry")&&(r.get(f)||0)>=3?m||(m=document.createElement("os-button"),m.setAttribute("variant","ghost"),m.setAttribute("data-retry-metrics",""),m.textContent=u("Retry counts"),m.addEventListener("click",()=>{r.delete(f),i.delete(f),m?.remove(),g(f,Number(x.dataset.postId)),v()}),x.append(m)):m?.remove()}},g=(x,h)=>{!a.has(x)&&!o.signal.aborted&&(a.add(x),n.set(x,h))},v=()=>{if(!o.signal.aborted)for(;d<2&&n.size;){const[x,h]=n.entries().next().value;n.delete(x),d++,r.set(x,(r.get(x)||0)+1),$i(e,t,h,o.signal).then(f=>{if(!o.signal.aborted&&(i.set(x,f),p(),Object.values(f.errors||{}).includes("retry")&&r.get(x)<3)){const m=setTimeout(()=>{l.delete(m),g(x,h),v()},500*r.get(x));l.add(m)}}).finally(()=>{a.delete(x),d--,v()})}},_=typeof IntersectionObserver>"u"?null:new IntersectionObserver(x=>{for(const h of x){if(!h.isIntersecting)continue;const f=h.target,m=f.dataset.contentMetrics||"";i.has(m)||g(m,Number(f.dataset.postId)),_?.unobserve(f)}v()},{root:s.querySelector(".os-posts-desk__feed"),rootMargin:"80px"});return{sync:()=>{p(),s.querySelectorAll("[data-content-metrics]").forEach(x=>{const h=x.getAttribute("data-content-metrics")||"";c.get(x)!==h&&(c.set(x,h),_?.observe(x))})},dispose:()=>{o.abort(),_?.disconnect(),l.forEach(clearTimeout),l.clear(),n.clear(),i.clear()}}}const os=R` .desktop-mode-posts .os-app-list__toolbar-right.os-app-list__bulk--footer{flex:0 0 auto;align-content:start;gap:8px;padding:8px 12px}.os-posts-desk__continuation{grid-column:1 / -1;padding:14px 8px;text-align:center;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__filter-toggle{display:none}.os-posts-desk__metrics{display:flex;gap:22px;margin-block:18px 0;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-size:24px;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 )}.os-posts-desk__metrics os-stat{min-inline-size:62px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{position:relative;border-radius:3px 12px 12px 3px;padding-inline-start:34px;background-image:repeating-linear-gradient(transparent 0 27px,var( --os-ui-surface-subtle,#f0f0f1 ) 27px 28px);background-position:0 10px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{content:'';position:absolute;inset-block:0;inset-inline-start:22px;border-inline-start:1px solid var( --os-ui-accent-dim,#c3c4c7 );opacity:.3}.desktop-mode-pages .os-posts-desk__story{position:relative;border-radius:3px 22px 3px 3px;box-shadow:3px 4px 0 -1px var( --os-ui-surface,#fff ),3px 4px 0 0 var( --os-ui-border,#dcdcde )}.desktop-mode-pages .os-posts-desk__story::after{content:'';position:absolute;inset-block-start:0;inset-inline-end:0;inline-size:16px;block-size:16px;border-end-start-radius:3px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.desktop-mode-pages .os-posts-desk__select{margin-inline-end:6px}.os-pages-atlas-host{flex:1;min-block-size:0;display:flex;position:relative}@container content-desk (max-width:600px){.os-posts-desk__hero{padding:8px 12px;min-block-size:36px;gap:8px}.os-posts-desk__hero h2{font-size:17px;margin:0;letter-spacing:-.03em}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.desktop-mode-posts .os-app-list__toolbar{display:none}.desktop-mode-posts[data-desk-options="true"] .os-app-list__toolbar{display:flex;padding:6px 12px}.os-posts-desk__tools{padding:6px 12px;gap:8px}.os-posts-desk__tools .os-app-list__search{flex:1;min-inline-size:0}.os-posts-desk__filter-toggle{display:block;flex:0 0 auto}.os-posts-desk__tools:not(.is-expanded)>os-select,.os-posts-desk__tools:not(.is-expanded)>os-checkbox{display:none}.os-posts-desk__tools.is-expanded>os-checkbox{flex-basis:100%}.os-posts-desk__feed,.desktop-mode-pages .os-posts-desk__feed{display:block;padding:8px 12px 14px}.os-posts-desk__story,.desktop-mode-pages .os-posts-desk__story,.os-posts-desk__story.is-current{padding:9px 12px;margin-block-end:9px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story{padding-inline-start:24px}.desktop-mode-posts:not(.desktop-mode-pages) .os-posts-desk__story::before{inset-inline-start:14px}.os-posts-desk__story-top{margin-block-end:3px;min-block-size:18px}.os-posts-desk__story-content,.desktop-mode-pages .os-posts-desk__story-content{flex-direction:row;gap:10px}.os-posts-desk__page-mark,.os-posts-desk__kicker{display:none}.os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__story h3{font-size:18px;margin-block-end:2px;line-height:1.2}.os-posts-desk__thumbnail{inline-size:46px;block-size:46px}.os-posts-desk__excerpt{-webkit-line-clamp:1;line-clamp:1;font-size:11px;line-height:1.4}.desktop-mode-pages .os-posts-desk__excerpt{display:none}.os-posts-desk__metrics{gap:14px;margin-block-start:7px;--os-ui-stat-value-size:14px}.os-posts-desk__metrics os-stat{min-inline-size:0;flex-direction:row;align-items:baseline}.os-posts-desk__metrics os-stat::part(value),.os-posts-desk__metrics os-stat::part(label){display:inline}.os-posts-desk__metrics os-stat::part(label){font-size:9px;margin-inline-start:4px;letter-spacing:0;text-transform:none}.os-posts-desk__story-foot{margin-block-start:4px;gap:4px;flex-wrap:nowrap}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline,.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1;margin:0;font-size:10px;min-inline-size:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-posts-desk__story-foot os-button{--os-ui-button-padding:5px 9px;font-size:11px}.desktop-mode-posts .os-app-list__pager{padding:6px 12px;gap:4px;flex-wrap:nowrap}.desktop-mode-posts .os-app-list__pager-meta{font-size:10px;flex:1}.desktop-mode-posts .os-app-list__pager-perpage{display:none}.desktop-mode-posts .os-app-list__pager-nav{flex:0 0 auto}.desktop-mode-posts .os-app-list__pager-nav os-button{font-size:10px}}`,is=R` .desktop-mode-posts{container:content-desk / inline-size;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.desktop-mode-posts [hidden]{display:none !important}.os-posts-desk__hero{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:24px 26px 20px;background:var( --os-ui-surface,#fff )}.os-posts-desk__eyebrow,.os-posts-desk__inspector-head{font-size:10px;font-weight:600;letter-spacing:0.14em;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero h2{margin:7px 0;font-size:clamp( 24px,3.4cqi,38px );font-weight:500;letter-spacing:-0.045em;line-height:1.1;color:inherit}.os-posts-desk__hero p{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__hero>os-button{flex-shrink:0}.desktop-mode-posts .os-app-list__toolbar{padding:12px 24px;background:var( --os-ui-surface,#fff );flex-wrap:wrap}.desktop-mode-posts .os-app-list__toolbar-left{flex-wrap:wrap;min-inline-size:0}.desktop-mode-posts .os-app-list__search{min-inline-size:150px;flex:1 1 190px}.os-posts-desk__tools{display:flex;align-items:center;gap:10px;padding:9px 24px;border-block-end:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff );flex-shrink:0}.os-posts-desk__tools>os-checkbox{margin-inline-end:auto;font-size:11px}.os-posts-desk__tools os-select{inline-size:155px}.os-posts-desk__workspace{display:flex;flex:1;min-block-size:0;min-inline-size:0;overflow:hidden}.os-posts-desk__feed{flex:1;min-inline-size:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding:20px 24px 32px}.os-posts-desk__story{padding:20px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:12px;background:var( --os-ui-surface,#fff );margin-block-end:12px;min-inline-size:0;transition:border-color 140ms ease,box-shadow 140ms ease}.os-posts-desk__story:hover{border-color:var( --os-ui-accent-dim,#2271b1 )}.os-posts-desk__story.is-current{border-inline-start:3px solid var( --os-ui-accent,#2271b1 );padding-inline-start:18px}.os-posts-desk__story-top{display:flex;align-items:center;gap:8px;margin-block-end:13px;min-block-size:22px}.os-posts-desk__id{margin-inline-start:auto;flex:0 0 auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;font-variant-numeric:tabular-nums;--os-ui-button-padding:3px 5px}.os-posts-desk__id::part(button){color:var( --os-ui-fg-muted,#646970 );gap:5px;min-block-size:24px}.os-posts-desk__id .dashicons{font-size:12px;inline-size:12px;block-size:12px}.os-posts-desk__id + .os-posts-desk__select{margin-inline-start:0}.os-posts-desk__select{margin-inline-start:auto;flex:0 0 20px;inline-size:20px;block-size:20px}.os-posts-desk__status,.os-posts-desk__role{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;line-height:1.6;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__status::before{content:"";inline-size:6px;block-size:6px;border-radius:50%;background:currentColor}.os-posts-desk__status[data-status="publish"]{color:var( --os-ui-success-fg,#008a20 )}.os-posts-desk__status[data-status="draft"],.os-posts-desk__status[data-status="pending"]{color:var( --os-ui-warning,#996800 )}.os-posts-desk__status[data-status="future"],.os-posts-desk__role{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__role{border-inline-start:1px solid var( --os-ui-border,#dcdcde );padding-inline-start:8px}.os-posts-desk__story-content{display:flex;gap:18px;align-items:flex-start}.os-posts-desk__story-copy{min-inline-size:0;flex:1}.os-posts-desk__thumbnail{inline-size:104px;block-size:104px;object-fit:cover;border-radius:7px;flex:0 0 auto}.os-posts-desk__kicker{font-size:10px;letter-spacing:0.06em;color:var( --os-ui-fg-muted,#646970 );margin-block-end:5px;overflow-wrap:anywhere}.os-posts-desk__story h3{font-family:Georgia,"Times New Roman",serif;font-size:23px;font-weight:400;line-height:1.18;letter-spacing:-0.025em;margin:0 0 8px;color:inherit;overflow-wrap:anywhere}.os-posts-desk__story h3 a{color:inherit;text-decoration:none}.os-posts-desk__story h3 a:hover{text-decoration:underline;text-underline-offset:3px}.os-posts-desk__excerpt{font-size:12px;line-height:1.65;margin:0;color:var( --os-ui-fg-muted,#646970 );display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.os-posts-desk__story-foot{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-block-start:16px}.os-posts-desk__byline{font-size:11px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 );margin-inline-end:auto;overflow-wrap:anywhere}.os-posts-desk__story-foot>.os-posts-desk__byline{flex:1 1 100px}.os-posts-desk__plugin-stat{display:flex;flex-direction:column;gap:4px;min-width:0}.os-posts-desk__plugin-stat-value{display:flex;align-items:center;min-height:22px}.os-posts-desk__plugin-stat-label{font-size:10px;line-height:1.2;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__lock{font-size:11px;color:var( --os-ui-warning,#996800 )}.os-posts-desk__inspector{flex:0 0 330px;max-inline-size:40%;min-inline-size:0;display:flex;flex-direction:column;border-inline-start:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface,#fff )}.os-posts-desk__inspector-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 18px;border-block-end:1px solid var( --os-ui-border,#dcdcde )}.os-posts-desk__inspector-head os-button{letter-spacing:normal}.os-posts-desk__inspector-scroll{flex:1;min-block-size:0;overflow:auto;padding:20px;overscroll-behavior:contain}.os-posts-desk__cover{inline-size:100%;max-block-size:180px;object-fit:cover;border-radius:8px;margin-block-end:20px}.os-posts-desk__inspector h2{font-family:Georgia,"Times New Roman",serif;font-size:27px;font-weight:400;line-height:1.2;letter-spacing:-0.03em;margin:10px 0;color:inherit;overflow-wrap:anywhere}.os-posts-desk__preview{font-size:13px;line-height:1.8;color:var( --os-ui-fg-muted,#646970 );overflow-wrap:anywhere}.os-posts-desk__dates{padding-block:16px;border-block:1px solid var( --os-ui-border,#dcdcde );--os-ui-facts-font-size:11px;--os-ui-facts-row-gap:4px;--os-ui-facts-column-gap:10px}.os-posts-desk__fields section{padding-block:8px;font-size:12px;overflow-wrap:anywhere}.os-posts-desk__fields h3{font-size:11px;font-weight:600;margin:0 0 8px;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__inspector-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding:16px 20px;border-block-start:1px solid var( --os-ui-border,#dcdcde );font-size:11px}.os-posts-desk__inspector-actions a{color:var( --os-ui-accent,#2271b1 )}.os-posts-desk__empty{padding:48px 20px;text-align:center;color:var( --os-ui-fg-muted,#646970 )}.os-posts-desk__empty>.dashicons{font-size:40px;inline-size:40px;block-size:40px}.desktop-mode-posts .os-app-list__bulk--footer{padding:10px 24px}.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__count,.desktop-mode-posts .os-app-list__bulk--footer .os-app-list__bulk-actions{flex:0 1 auto}.desktop-mode-pages .os-posts-desk__feed{display:grid;grid-template-columns:repeat( auto-fill,minmax( 230px,1fr ) );align-content:start;gap:16px}.desktop-mode-pages .os-posts-desk__story{margin:0;display:flex;flex-direction:column}.desktop-mode-pages .os-posts-desk__story-content{flex-direction:column;flex:1}.desktop-mode-pages .os-posts-desk__story h3,.desktop-mode-pages .os-posts-desk__inspector h2{font-family:inherit;font-weight:600;font-size:21px}.os-posts-desk__page-mark{border:1px solid var( --os-ui-border,#dcdcde );border-radius:5px;inline-size:42px;block-size:50px;padding:8px;color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-surface-sunken,#f6f7f7 )}.os-posts-desk__page-mark i{display:block;block-size:2px;margin-block-start:4px;background:var( --os-ui-border,#dcdcde )}.os-posts-desk__page-mark i:last-child{inline-size:60%}@container content-desk (max-width:850px){.os-posts-desk__inspector{display:none}.os-posts-desk__inspector.is-open{display:flex;flex:1;max-inline-size:none;border-inline-start:0}.os-posts-desk__workspace.has-detail .os-posts-desk__feed{display:none}.os-posts-desk__hero{padding:20px}}@container content-desk (max-width:540px){.os-posts-desk__hero{padding:16px;gap:12px}.os-posts-desk__hero p,.os-posts-desk__eyebrow{display:none}.os-posts-desk__hero h2{font-size:23px}.desktop-mode-posts .os-app-list__toolbar,.os-posts-desk__tools{padding:8px 12px}.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools>os-checkbox{flex-basis:100%}.os-posts-desk__tools os-select{flex:1;inline-size:130px}.os-posts-desk__feed{padding:12px}.os-posts-desk__story{padding:16px}.os-posts-desk__story.is-current{padding-inline-start:14px}.os-posts-desk__thumbnail{inline-size:64px;block-size:64px}.os-posts-desk__story h3{font-size:21px}}@media (prefers-reduced-motion:reduce){.os-posts-desk__story{transition:none}}.os-posts-desk__tools .os-app-list__search{flex:1 1 170px;min-inline-size:130px}.os-posts-desk__tools>os-checkbox{flex-shrink:0}@container content-desk (max-width:700px){.os-posts-desk__tools{flex-wrap:wrap}.os-posts-desk__tools .os-app-list__search{flex-basis:calc( 100% - 145px )}.os-posts-desk__tools>os-checkbox{flex-basis:auto}.os-posts-desk__tools os-select{flex:1 1 130px;min-inline-size:130px}}.desktop-mode-pages .os-posts-desk__story-foot>.os-posts-desk__byline{flex-basis:100%;margin-block-end:4px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-left{flex:1 1 140px}html[data-os-mode="mobile"] .desktop-mode-posts .os-app-list__toolbar-trailing{flex:0 0 auto}`,Si=R` ${fe} ${Je}: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}`,Ce=class Ce extends U{render(){const e=this.checked!==null,t=this.disabled!==null,o=this.label||"",i=this.value;return b` | |
| 473 | 473 | <label> |
| 474 | 474 | <input |
| 475 | 475 | type="checkbox" |
| 476 | 476 | .checked=${e} |
| @@ -486,9 +486,9 @@ | ||
| 486 | 486 | ${this.hasAttribute("swatch")?b`<i class="swatch" aria-hidden="true"></i>`:""} |
| 487 | 487 | ${e.label||""} |
| 488 | 488 | </span> |
| 489 | 489 | ${t?b`<span class="caption" part="caption">${t}</span>`:""} |
| 490 | - `}};Se.props=["value","label","caption","swatch"],Se.styles=[Ai],Se.help=void 0;let ut=Se;W("os-stat",ut);const Ei=()=>({view:"desk",filters:!1,peek:!1,focused:null,inspectorKey:"",fields:[]});function ns(s){return ue((s.excerpt?.rendered??"").replace(/<[^>]*>/g," ")).replace(/\s+/g," ").trim()}function zi(s,e){if(!s.parent)return u("Top-level page");const t=e.find(o=>o.id===s.parent);return t?re(t):H(u("Parent page #%d"),s.parent)}function ht(s,e){s.host.openUrl?.(Te(s.extra,e.id),re(e)||u("(no title)"),s.extra.mode==="pages"?"dashicons-admin-page":"dashicons-admin-post")}function as(s){return b`<span class="os-posts-desk__status" data-status=${s.status}>${Ze[s.status]??s.status}</span>`}function Ti(s,e){return s.extra.frontPageId===e.id?u("Front page"):s.extra.postsPageId===e.id?u("Posts page"):""}function rs(s,e){queueMicrotask(()=>s.querySelector(e)?.shadowRoot?.querySelector("button")?.focus())}function Pi(s,e){const t=s.extra.mode==="pages",o=s.data?.list.items??[],i=V(s)?.selection??new Set,a=o.length>0&&o.every(l=>i.has(l.id)),n=l=>{e.view=l.detail.value==="table"?"table":"desk",s.repaint()},r=l=>{const[c,d]=String(l.detail.value).split(":");s.dispatch("sort",{orderby:c,order:d})};return b`<div class="os-posts-desk__tools ${e.filters?"is-expanded":""}"> | |
| 490 | + `}};Se.props=["value","label","caption","swatch"],Se.styles=[Ai],Se.help=void 0;let ut=Se;W("os-stat",ut);const Ei=()=>({view:"desk",filters:!1,peek:!1,focused:null,inspectorKey:"",fields:[]});function ns(s){return ae((s.excerpt?.rendered??"").replace(/<[^>]*>/g," ")).replace(/\s+/g," ").trim()}function zi(s,e){if(!s.parent)return u("Top-level page");const t=e.find(o=>o.id===s.parent);return t?le(t):H(u("Parent page #%d"),s.parent)}function ht(s,e){s.host.openUrl?.(Te(s.extra,e.id),le(e)||u("(no title)"),s.extra.mode==="pages"?"dashicons-admin-page":"dashicons-admin-post")}function as(s){return b`<span class="os-posts-desk__status" data-status=${s.status}>${Ze[s.status]??s.status}</span>`}function Ti(s,e){return s.extra.frontPageId===e.id?u("Front page"):s.extra.postsPageId===e.id?u("Posts page"):""}function rs(s,e){queueMicrotask(()=>s.querySelector(e)?.shadowRoot?.querySelector("button")?.focus())}function Pi(s,e){const t=s.extra.mode==="pages",o=s.data?.list.items??[],i=V(s)?.selection??new Set,a=o.length>0&&o.every(l=>i.has(l.id)),n=l=>{e.view=l.detail.value==="table"?"table":"desk",s.repaint()},r=l=>{const[c,d]=String(l.detail.value).split(":");s.dispatch("sort",{orderby:c,order:d})};return b`<div class="os-posts-desk__tools ${e.filters?"is-expanded":""}"> | |
| 491 | 491 | <os-text-field id=${`${s.windowId}-content-search`} class="os-app-list__search" data-os-posts-search |
| 492 | 492 | aria-label=${u(t?"Search pages":"Search posts")} os-bind="search" os-action="filter" os-debounce="250" |
| 493 | 493 | value=${s.state.search} placeholder=${u(t?"Search pages…":"Search posts…")}></os-text-field> |
| 494 | 494 | <os-button class="os-posts-desk__filter-toggle" variant="secondary" aria-expanded=${String(e.filters)} @click=${()=>{e.filters=!e.filters,s.repaint()}}>${u("Options")}</os-button> |
| @@ -510,9 +510,9 @@ | ||
| 510 | 510 | <os-select aria-label=${u("Content view")} value=${e.view} @os-pick=${n} data-os-posts-view> |
| 511 | 511 | <os-option value="desk">${u(t?"Page directory":"Writing desk")}</os-option> |
| 512 | 512 | <os-option value="table">${u("Details table")}</os-option> |
| 513 | 513 | </os-select> |
| 514 | - </div>`}function Mi(s,e){const t=s.extra.mode==="pages",o=H(u(t?"Copy page ID %d":"Copy post ID %d"),e.id);return b`<os-button variant="ghost" class="os-posts-desk__id" title=${o} @click=${async i=>{i.stopPropagation();const n=await $t(String(e.id))?H(u(t?"Copied page ID #%d.":"Copied post ID #%d."),e.id):u("Couldn’t copy the ID. Please try again.");s.host.toast?.({message:n})}}><span class="screen-reader-text">${o}</span><span aria-hidden="true">#${e.id}</span><span class="dashicons dashicons-admin-page" aria-hidden="true"></span></os-button>`}function Li(s,e){const t=e[s.key];let o="";return s.render?o=s.render(t,e,0):t!=null&&(o=String(t)),o==null||o===""||o instanceof Element&&!o.childNodes.length&&!o.textContent?"":b`<div class="os-posts-desk__plugin-stat" data-column=${s.key}><span class="os-posts-desk__plugin-stat-value">${o}</span><span class="os-posts-desk__plugin-stat-label">${s.label||s.key}</span></div>`}function Ri(s,e,t,o,i=[]){const a=s.extra.mode==="pages",n=re(t)||u("(no title)"),r=Ye(t),l=fo(t,"category")[0]?.name,c=Ti(s,t),d=a?zi(t,s.data?.list.items??[]):ue(l||u("Story"));let p="";a?p=b`<div class="os-posts-desk__page-mark" aria-hidden="true"><span class="dashicons ${c?"dashicons-admin-home":"dashicons-admin-page"}"></span><i></i><i></i><i></i></div>`:r&&(p=b`<img class="os-posts-desk__thumbnail" src=${r.url} alt="" loading="lazy" @error=${v=>v.target.hidden=!0}>`);const g=()=>{e.focused=t.id,e.peek=!0,s.repaint(),rs(s.root,"[data-os-posts-inspect-close]")};return b`<article class="os-posts-desk__story ${o===t.id?"is-current":""}" data-story-id=${t.id}> | |
| 514 | + </div>`}function Mi(s,e){const t=s.extra.mode==="pages",o=H(u(t?"Copy page ID %d":"Copy post ID %d"),e.id);return b`<os-button variant="ghost" class="os-posts-desk__id" title=${o} @click=${async i=>{i.stopPropagation();const n=await $t(String(e.id))?H(u(t?"Copied page ID #%d.":"Copied post ID #%d."),e.id):u("Couldn’t copy the ID. Please try again.");s.host.toast?.({message:n})}}><span class="screen-reader-text">${o}</span><span aria-hidden="true">#${e.id}</span><span class="dashicons dashicons-admin-page" aria-hidden="true"></span></os-button>`}function Li(s,e){const t=e[s.key];let o="";return s.render?o=s.render(t,e,0):t!=null&&(o=String(t)),o==null||o===""||o instanceof Element&&!o.childNodes.length&&!o.textContent?"":b`<div class="os-posts-desk__plugin-stat" data-column=${s.key}><span class="os-posts-desk__plugin-stat-value">${o}</span><span class="os-posts-desk__plugin-stat-label">${s.label||s.key}</span></div>`}function Ri(s,e,t,o,i=[]){const a=s.extra.mode==="pages",n=le(t)||u("(no title)"),r=Ye(t),l=fo(t,"category")[0]?.name,c=Ti(s,t),d=a?zi(t,s.data?.list.items??[]):ae(l||u("Story"));let p="";a?p=b`<div class="os-posts-desk__page-mark" aria-hidden="true"><span class="dashicons ${c?"dashicons-admin-home":"dashicons-admin-page"}"></span><i></i><i></i><i></i></div>`:r&&(p=b`<img class="os-posts-desk__thumbnail" src=${r.url} alt="" loading="lazy" @error=${v=>v.target.hidden=!0}>`);const g=()=>{e.focused=t.id,e.peek=!0,s.repaint(),rs(s.root,"[data-os-posts-inspect-close]")};return b`<article class="os-posts-desk__story ${o===t.id?"is-current":""}" data-story-id=${t.id}> | |
| 515 | 515 | <div class="os-posts-desk__story-top"> |
| 516 | 516 | ${as(t)} |
| 517 | 517 | ${c?b`<span class="os-posts-desk__role">${c}</span>`:""} |
| 518 | 518 | ${Mi(s,t)} |
| @@ -545,9 +545,9 @@ | ||
| 545 | 545 | <header class="os-posts-desk__inspector-head"><span>${s.extra.mode==="pages"?u("PAGE DETAILS"):u("STORY DETAILS")}</span><os-button variant="ghost" data-os-posts-inspect-close @click=${l}>${u("Close details")}</os-button></header> |
| 546 | 546 | <div class="os-posts-desk__inspector-scroll"> |
| 547 | 547 | ${r?b`<img class="os-posts-desk__cover" src=${r.url} alt=${r.alt} @error=${c=>c.target.hidden=!0}>`:""} |
| 548 | 548 | ${as(a)} |
| 549 | - <h2>${re(a)||u("(no title)")}</h2> | |
| 549 | + <h2>${le(a)||u("(no title)")}</h2> | |
| 550 | 550 | <p class="os-posts-desk__byline">${Xe(a).name}</p> |
| 551 | 551 | ${a.openstation_lock?b`<os-notice tone="warning">${H(u("%s is currently editing"),a.openstation_lock.userName)}</os-notice>`:""} |
| 552 | 552 | <p class="os-posts-desk__preview">${ns(a)||u("No excerpt yet.")}</p> |
| 553 | 553 | <os-facts layout="between" class="os-posts-desk__dates"><os-fact label=${a.status==="future"?u("Scheduled for"):u("Date")}><os-relative-time datetime=${a.date_gmt||a.date}></os-relative-time></os-fact><os-fact label=${u("Last edited")}><os-relative-time datetime=${a.modified_gmt||a.modified}></os-relative-time></os-fact></os-facts> |
| @@ -561,9 +561,9 @@ | ||
| 561 | 561 | ${r.length?r.map(d=>Ri(s,e,d,e.peek?l?.id:void 0,c)):b`<div class="os-posts-desk__empty"><span class="dashicons dashicons-welcome-write-blog" aria-hidden="true"></span><h3>${s.loading?u("Opening your workspace…"):n}</h3><p>${s.loading?u("Your content will appear here."):u("Try a different search or change the status filter.")}</p></div>`} |
| 562 | 562 | ${a??""} |
| 563 | 563 | </div> |
| 564 | 564 | ${e.peek?Ii(s,e,t,o,i,l):""} |
| 565 | - </div>`}function Oi(s){queueMicrotask(()=>{for(const t of s.querySelectorAll(".os-posts-desk__select, [data-os-posts-search]"))t.shadowRoot?.querySelector("input")?.setAttribute("aria-label",t.getAttribute("aria-label")||"");const e=s.querySelector(".os-posts-desk__filter-toggle");e?.shadowRoot?.querySelector("button")?.setAttribute("aria-expanded",e.getAttribute("aria-expanded")||"false")})}const qi="[openstation:desktop-mode-posts]",Di=50,Ie=()=>({desk:Ei(),feed:new ki,client:null,env:null,cellCache:new Map,table:Ds(),filterData:{authors:[],tags:[]},columnsKey:"",hidden:null,selected:0,bulkActions:null,extras:null,postsCtx:null,tab:"posts",serverTab:"posts",editor:null,canvases:{categories:null,tags:null},canvasPending:new Set,menu:null,disposed:!1,tagPage:0,tagTotalPages:1,tagFetching:!1}),ls=s=>s.mode==="pages"?"pages":"posts";function Hi(s){return s.map(e=>`${e.id}:${e.status}:${e.modified_gmt}`).join("|")}function Ne(s,e){return e.client||(e.client=bi(s.fetch)),e.client}function de(s,e){return s.hidden||(s.hidden=Qt(e)),s.hidden}function cs(s,e,t){const o=e.replace(/:\s*$/,"");Gs(s.host.toast,t,o===e?{fallback:e,duration:6e3}:{lead:o,fallback:`${o}.`,duration:6e3})}function ft(s,e,t){return e.env||(e.env={extra:s.extra,client:Ne(s,e),cells:t,openUrl:(o,i,a)=>s.host.openUrl?.(o,i,a),confirm:o=>s.host.confirm?.(o)??Promise.resolve(!1),toast:(o,i)=>cs(s,o,i),announce:(o,i)=>s.host.announce?.("post",o,i),parentTitles:new Map,categories:{tree:null,pickers:new Set}}),e.env}function Fi(s,e){return{client:Ne(s,e),extra:s.extra,openUrl:(t,o,i)=>s.host.openUrl?.(t,o,i),toast:(t,o)=>cs(s,t,o),leaveFullscreen:()=>{const t=window.wp?.os?.windowManager?.getById?.(s.windowId);t?.isFullscreen?.()&&t.toggleFullscreen?.()}}}async function ds(s,e){if(!(e.tagFetching||e.tagPage>=e.tagTotalPages)){e.tagFetching=!0;try{const t=e.tagPage+1,o=await Ne(s,e).fetchTagOptions(t,Di);e.tagPage=t,e.tagTotalPages=Math.max(e.tagTotalPages,o.totalPages||t);const i=new Set(e.filterData.tags.map(a=>a.id));for(const a of o.items)i.has(a.id)||(e.filterData.tags.push(a),i.add(a.id));e.filterData.tagsHasMore=e.tagPage<e.tagTotalPages,s.repaint()}finally{e.tagFetching=!1}}}const Ui=s=>`${s.authors.map(e=>e.id).join(",")}|${s.tags.map(e=>e.id).join(",")}|${s.tagsHasMore?1:0}`,ps=s=>s.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>Number.isFinite(e)&&e>0),us=(s,e)=>s.length===e.length&&s.every((t,o)=>t===e[o]);function Vi(s,e,t){const o=s.extra;t.getRowId=a=>a.id,t.subTable=a=>vo(a);const i=mi(s.state.orderby);t.sort=t.columns.some(a=>a.key===i)?{key:i,direction:s.state.order}:null,t.addEventListener("os-table-selection-change",()=>{e.selected=t.selection?.size??0,s.repaint()}),t.addEventListener("os-table-sort-change",a=>{const n=a.detail?.sort,r=o.defaultOrderby??"date";s.dispatch("sort",n?{orderby:gi(n.key,r),order:n.direction}:{orderby:r,order:o.defaultOrder??"desc"})}),t.addEventListener("os-table-filter-change",a=>{const n=a.detail?.filters??{},r=ps(n.author??""),l=ps(n.tags??"");us(r,s.state.author)&&us(l,s.state.tag)||(s.local("set-column-filters",{author:r,tag:l}),s.dispatch("filter"))})}function Wi(s,e={}){const t=e.terms,o=e.cells??{},i="nativePagesHiddenColumns",a=(h,f,m)=>{if(!t||f.canvases[m]||f.canvasPending.has(m))return;const y=h.root.querySelector(m==="categories"?"[data-os-posts-cats-host]":"[data-os-posts-tags-host]");y&&(f.canvasPending.add(m),t[m](y,Fi(h,f)).then(w=>{if(f.disposed){w();return}f.canvases[m]=w}).catch(w=>{console.error(`${qi} ${m} canvas failed`,w)}).finally(()=>f.canvasPending.delete(m)))},n=(h,f,m,y)=>(f.bulkActions||(f.bulkActions=hi(ui(m,w=>h.dispatch("trash",{ids:w})))),b` | |
| 565 | + </div>`}function Oi(s){queueMicrotask(()=>{for(const t of s.querySelectorAll(".os-posts-desk__select, [data-os-posts-search]"))t.shadowRoot?.querySelector("input")?.setAttribute("aria-label",t.getAttribute("aria-label")||"");const e=s.querySelector(".os-posts-desk__filter-toggle");e?.shadowRoot?.querySelector("button")?.setAttribute("aria-expanded",e.getAttribute("aria-expanded")||"false")})}const qi="[openstation:desktop-mode-posts]",Di=50,Ie=()=>({desk:Ei(),feed:new ki,client:null,env:null,cellCache:new Map,table:Ds(),filterData:{authors:[],tags:[]},columnsKey:"",hidden:null,selected:0,bulkActions:null,extras:null,postsCtx:null,tab:"posts",serverTab:"posts",editor:null,canvases:{categories:null,tags:null},canvasPending:new Set,menu:null,disposed:!1,tagPage:0,tagTotalPages:1,tagFetching:!1}),ls=s=>s.mode==="pages"?"pages":"posts";function Hi(s){return s.map(e=>`${e.id}:${e.status}:${e.modified_gmt}`).join("|")}function Ne(s,e){return e.client||(e.client=bi(s.fetch)),e.client}function pe(s,e){return s.hidden||(s.hidden=Qt(e)),s.hidden}function cs(s,e,t){const o=e.replace(/:\s*$/,"");Gs(s.host.toast,t,o===e?{fallback:e,duration:6e3}:{lead:o,fallback:`${o}.`,duration:6e3})}function ft(s,e,t){return e.env||(e.env={extra:s.extra,client:Ne(s,e),cells:t,openUrl:(o,i,a)=>s.host.openUrl?.(o,i,a),confirm:o=>s.host.confirm?.(o)??Promise.resolve(!1),toast:(o,i)=>cs(s,o,i),announce:(o,i)=>s.host.announce?.("post",o,i),parentTitles:new Map,categories:{tree:null,pickers:new Set}}),e.env}function Fi(s,e){return{client:Ne(s,e),extra:s.extra,openUrl:(t,o,i)=>s.host.openUrl?.(t,o,i),toast:(t,o)=>cs(s,t,o),leaveFullscreen:()=>{const t=window.wp?.os?.windowManager?.getById?.(s.windowId);t?.isFullscreen?.()&&t.toggleFullscreen?.()}}}async function ds(s,e){if(!(e.tagFetching||e.tagPage>=e.tagTotalPages)){e.tagFetching=!0;try{const t=e.tagPage+1,o=await Ne(s,e).fetchTagOptions(t,Di);e.tagPage=t,e.tagTotalPages=Math.max(e.tagTotalPages,o.totalPages||t);const i=new Set(e.filterData.tags.map(a=>a.id));for(const a of o.items)i.has(a.id)||(e.filterData.tags.push(a),i.add(a.id));e.filterData.tagsHasMore=e.tagPage<e.tagTotalPages,s.repaint()}finally{e.tagFetching=!1}}}const Ui=s=>`${s.authors.map(e=>e.id).join(",")}|${s.tags.map(e=>e.id).join(",")}|${s.tagsHasMore?1:0}`,ps=s=>s.split(",").map(e=>parseInt(e.trim(),10)).filter(e=>Number.isFinite(e)&&e>0),us=(s,e)=>s.length===e.length&&s.every((t,o)=>t===e[o]);function Vi(s,e,t){const o=s.extra;t.getRowId=a=>a.id,t.subTable=a=>vo(a);const i=mi(s.state.orderby);t.sort=t.columns.some(a=>a.key===i)?{key:i,direction:s.state.order}:null,t.addEventListener("os-table-selection-change",()=>{e.selected=t.selection?.size??0,s.repaint()}),t.addEventListener("os-table-sort-change",a=>{const n=a.detail?.sort,r=o.defaultOrderby??"date";s.dispatch("sort",n?{orderby:gi(n.key,r),order:n.direction}:{orderby:r,order:o.defaultOrder??"desc"})}),t.addEventListener("os-table-filter-change",a=>{const n=a.detail?.filters??{},r=ps(n.author??""),l=ps(n.tags??"");us(r,s.state.author)&&us(l,s.state.tag)||(s.local("set-column-filters",{author:r,tag:l}),s.dispatch("filter"))})}function Wi(s,e={}){const t=e.terms,o=e.cells??{},i="nativePagesHiddenColumns",a=(h,f,m)=>{if(!t||f.canvases[m]||f.canvasPending.has(m))return;const y=h.root.querySelector(m==="categories"?"[data-os-posts-cats-host]":"[data-os-posts-tags-host]");y&&(f.canvasPending.add(m),t[m](y,Fi(h,f)).then(w=>{if(f.disposed){w();return}f.canvases[m]=w}).catch(w=>{console.error(`${qi} ${m} canvas failed`,w)}).finally(()=>f.canvasPending.delete(m)))},n=(h,f,m,y)=>(f.bulkActions||(f.bulkActions=hi(ui(m,w=>h.dispatch("trash",{ids:w})))),b` | |
| 566 | 566 | <div class="os-app-list__toolbar-right ${"os-app-list__bulk--footer"}" data-os-posts-bulk ?hidden=${f.selected===0}> |
| 567 | 567 | <span class="os-app-list__count" data-os-posts-count>${H(u("%d selected"),f.selected)}</span> |
| 568 | 568 | <os-button variant="ghost" @click=${()=>V(h)?.clearSelection()}>${u("Clear selection")}</os-button> |
| 569 | 569 | <span class="os-app-list__bulk-actions" data-os-posts-bulk-actions>${f.bulkActions.map(w=>b`<os-button |
| @@ -590,9 +590,9 @@ | ||
| 590 | 590 | </div> |
| 591 | 591 | </header> |
| 592 | 592 | ${$?.error?b`<os-notice tone="danger">${$.error}</os-notice>`:""} |
| 593 | 593 | ${Pi(w,f.desk)} |
| 594 | - ${Ni(w,f.desk,z,f.filterData,de(f,i),f.feed.tail())} | |
| 594 | + ${Ni(w,f.desk,z,f.filterData,pe(f,i),f.feed.tail())} | |
| 595 | 595 | <div class="os-app-list__body" data-os-posts-body ?hidden=${f.desk.view!=="table"}> |
| 596 | 596 | <os-table |
| 597 | 597 | data-os-posts-table |
| 598 | 598 | os-preserve |
| @@ -630,11 +630,11 @@ | ||
| 630 | 630 | </os-tabpanel> |
| 631 | 631 | <os-tabpanel for="tags" class="os-app-list__panel"> |
| 632 | 632 | <div data-os-posts-tags-host class="os-posts__terms-host" os-preserve></div> |
| 633 | 633 | </os-tabpanel>`:""} |
| 634 | - </div>`},mounted:h=>{const f=h.ui(Ie),m=[];f.stats=Ci(h.root,h.fetch,ls(h.extra)),f.stats.sync(),m.push(()=>f.stats?.dispose());const y=ft(h,f,o),w=new MutationObserver(()=>{V(h)?.toggleAttribute("loading",h.root.getAttribute("aria-busy")==="true")});w.observe(h.root,{attributes:!0,attributeFilter:["aria-busy"]}),m.push(()=>w.disconnect()),Ne(h,f).fetchAuthorOptions().then(z=>{f.filterData.authors=z,h.repaint()}),f.filterData.loadMoreTags=()=>void ds(h,f),ds(h,f),f.menu=Os(h.root,{section:u("Show columns"),prefix:s,items:ci(y),isChecked:z=>!de(f,i).has(z),onToggle:z=>{const N=de(f,i);N.has(z)?N.delete(z):N.add(z);const E=window.wp?.os;E&&typeof E.updateOsSettings=="function"&&E.updateOsSettings({[i]:Array.from(N).sort()},{windowId:h.windowId}),h.repaint()}}),m.push(()=>f.menu?.dispose());const k=window.wp?.os;if(k&&typeof k.subscribeOsSettings=="function"){let z=Array.from(de(f,i)).sort().join(",");m.push(k.subscribeOsSettings(()=>{const N=Qt(i),E=Array.from(N).sort().join(",");E!==z&&(z=E,f.hidden=N,h.repaint(),f.menu?.refresh())}))}k&&typeof k.subscribe=="function"&&m.push(k.subscribe("os.term.changed",z=>{z?.taxonomy==="category"&&(Gt(y),Vo(y))}));const C=()=>h.repaint();document.addEventListener("os-mode-changed",C),m.push(()=>document.removeEventListener("os-mode-changed",C)),m.push(c(h,f));const $=dt(h,f),P=window.wp?.hooks;return P&&typeof P.doAction=="function"&&P.doAction(ni,$),document.dispatchEvent(new CustomEvent("os-posts-window-opened",{detail:$})),()=>{f.disposed=!0;for(const z of m)z();f.feed.dispose(),f.atlas?.(),f.editor?.(),f.editor=null,f.canvases.categories?.(),f.canvases.tags?.(),f.canvases={categories:null,tags:null},Gt(y)}},updated:h=>{Oi(h.root),_(h,h.ui(Ie));const f=V(h);if(!f)return;h.loading&&f.setAttribute("loading","");const m=h.ui(Ie);m.stats?.sync(),m.feed.observe(h.root);const{state:y,data:w}=h,k=ft(h,m,o),C=`${Array.from(de(m,i)).sort().join(",")}|${Ui(m.filterData)}`;C!==m.columnsKey&&(m.columnsKey=C,m.cellCache.clear(),m.table.invalidateColumns());const $=m.feed.items;m.table.sync({table:f,rows:$,listKey:[y.perPage,y.search,y.status,y.orderby,y.order,y.author.join(","),y.tag.join(",")].join("|"),fingerprint:Hi($),columns:z=>(m.cellCache.clear(),ct(k,m.cellCache,m.filterData,z,de(m,i))),wire:()=>Vi(h,m,f),onSelection:z=>{m.selected=z.length}}).dataChanged&&($.some(z=>z.id===m.desk.focused)||(m.desk.focused=null),queueMicrotask(()=>{m.disposed||h.repaint()}),m.cellCache.clear(),Zt(k,$),w&&yi(w))}})}const gt=480,hs=368;function ji(s,e,t){var v;const o=new Map(s.map(_=>[_.id,_])),i=new Map(s.map(_=>[_.id,new Set]));for(const _ of e)i.get(_.from)?.add(_.to),i.get(_.to)?.add(_.from);const a=new Set,n=[];for(const _ of s){if(a.has(_.id))continue;const x=[_.id];a.add(_.id);for(let h=0;h<x.length;h++)for(const f of i.get(x[h])||[])o.has(f)&&!a.has(f)&&(a.add(f),x.push(f));n.push(x)}n.sort((_,x)=>x.length-_.length||_[0]-x[0]);const r=new Map;let l=0,c=1;for(const _ of n.filter(x=>x.length>1)){const x=_.includes(t||0)?t:[..._].sort((k,C)=>(i.get(C)?.size||0)-(i.get(k)?.size||0)||k-C)[0],h=new Map([[x,0]]),f=[x];for(let k=0;k<f.length;k++)for(const C of i.get(f[k])||[])!h.has(C)&&o.has(C)&&(h.set(C,h.get(f[k])+1),f.push(C));const m=[];for(const k of f)(m[v=h.get(k)]??(m[v]=[])).push(k);for(let k=0;k<6;k++){const C=m.map(($,P)=>P);k%2&&C.reverse();for(const $ of C){const P=m[$+(k%2?1:-1)];if(!P)continue;const z=new Map(P.map((E,q)=>[E,q])),N=E=>{const q=Array.from(i.get(E)||[]).filter(ee=>z.has(ee)).map(ee=>z.get(ee));return q.length?q.reduce((ee,bt)=>ee+bt,0)/q.length:0};m[$].sort((E,q)=>N(E)-N(q)||E-q)}}const y=Math.min(6,Math.max(...m.map(k=>k.length)));let w=0;for(const k of m)k.forEach((C,$)=>r.set(C,{x:(w+Math.floor($/y))*gt,y:(l+$%y+Math.floor((y-Math.min(y,k.length))/2))*hs})),w+=Math.ceil(k.length/y);l+=y+1,c=Math.max(c,w)}const d=n.filter(_=>_.length===1).flat(),p=Math.max(c+(d.length?1:0),Math.ceil(Math.sqrt(s.length*1.2)),1);let g=0;for(const _ of d){for(;Math.floor(g/p)<Math.max(0,l-1)&&g%p<c;)g++;r.set(_,{x:g%p*gt,y:Math.floor(g/p)*hs}),g++}return[...s].sort((_,x)=>+(x.id===t)-+(_.id===t)).map(_=>({page:_,...r.get(_.id)}))}function Ki(s,e,t=0){const o=(t%7-3)*7,i=e.x>=s.x,a={x:s.x+(i?J:0),y:s.y+ie/2+o},n=s.x===e.x,r={x:e.x+(i&&!n?0:J),y:e.y+ie/2+o},l=s.x+(i?J+90+o:-90+o),c=e.x+(i&&!n?-90+o:J+90+o);let d;if(n)d=[a,{x:l,y:a.y},{x:l,y:r.y},r];else if(s.y===e.y&&Math.abs(s.x-e.x)===gt)d=[a,r];else{const p=s.y+(e.y<s.y?-55:ie+55)+o;d=[a,{x:l,y:a.y},{x:l,y:p},{x:c,y:p},{x:c,y:r.y},r]}return d.filter((p,g)=>!g||p.x!==d[g-1].x||p.y!==d[g-1].y)}const J=300,ie=258,Bi=1440,Gi=900,Q=s=>ue(s.title.rendered)||u("(no title)");function Oe(s,e=location.origin){try{const t=new URL(s.link,e);return t.origin!==e||!/^https?:$/.test(t.protocol)||/\/wp-admin(?:\/|$)|\/wp-login\.php/.test(t.pathname)?null:(t.hash="",["publish","private"].includes(s.status)||t.searchParams.set("preview","true"),t.href)}catch{return null}}function fs(s){const e=s.searchParams.get("page_id")||s.searchParams.get("p");return e?`${s.origin}/#${e}`:`${s.origin}${s.pathname.replace(/\/+$/,"")}`}function gs(s){const e=new Map(s.map(i=>[i.id,i])),t=new Map;for(const i of s)try{t.set(fs(new URL(i.link)),i.id)}catch{}const o=new Map;for(const i of s){if(i.parent&&i.parent!==i.id&&e.has(i.parent)&&o.set(`parent:${i.parent}:${i.id}`,{from:i.parent,to:i.id,kind:"parent"}),!i.content?.rendered||i.content.protected)continue;const a=new DOMParser().parseFromString(i.content.rendered,"text/html");for(const n of a.querySelectorAll("a[href]"))try{const r=new URL(i.link),l=new URL(n.getAttribute("href"),r);if(l.origin!==r.origin)continue;const c=Number(l.searchParams.get("page_id")||l.searchParams.get("p")),d=c&&e.has(c)?c:t.get(fs(l));d&&d!==i.id&&o.set(`link:${i.id}:${d}`,{from:i.id,to:d,kind:"link"})}catch{}}return Array.from(o.values())}async function Zi(s,e){const t=[];let o=0,i=1;for(let n=1;n<=Math.min(i,5);n++){const r=new URLSearchParams({context:"edit",status:"publish,future,draft,pending,private",per_page:"100",page:String(n),orderby:"menu_order",order:"asc",_fields:"id,parent,title,link,slug,status,content"}),l=await s(`wp/v2/pages?${r}`,{signal:e});if(!l.ok)throw new Error(u("Pages could not be loaded. Try refreshing the atlas."));const c=await l.json();if(!Array.isArray(c))throw new Error(u("The page response was invalid."));t.push(...c),i=Math.max(1,Number(l.headers.get("X-WP-TotalPages"))||1),o=Number(l.headers.get("X-WP-Total"))||t.length}const a=Array.from(new Map(t.map(n=>[n.id,n])).values());return{pages:a,edges:gs(a),total:o}}function Xi(s,e,t=gs(s)){return ji(s,t,e)}function ae(s){const e=B(s,"--os-ui-surface","#ffffff",16777215);return{surface:e,raised:B(s,"--os-ui-surface-elevated","#ffffff",e),fg:B(s,"--os-ui-fg","#1d2327",e),muted:B(s,"--os-ui-fg-muted","#50575e",e),faint:B(s,"--os-ui-fg-faint","#b0b3b8",e),border:B(s,"--os-ui-border","#dcdcde",e),accent:B(s,"--os-ui-accent","#2271b1",e)}}function B(s,e,t,o=16777215){const i=document.createElement("span");i.hidden=!0,i.style.color=`var(${e}, ${t})`,s.append(i);const a=getComputedStyle(i).color;i.remove();const n=a.match(/[\d.]+/g)?.map(Number);if(!n||n.length<3)return parseInt(t.slice(1),16);const r=n[3]??1,l=a.startsWith("color(srgb");return[16,8,0].reduce((c,d,p)=>{const g=n[p]*(l?255:1),v=Math.floor(o/2**d)%256;return c+Math.round(g*r+v*(1-r))*2**d},0)}function Yi(s,e,t){let o=JSON.stringify([ae(s),t?.()]);const i=()=>{const n=JSON.stringify([ae(s),t?.()]);n!==o&&(o=n,e())},a=new MutationObserver(i);for(let n=s;n;n=n.parentElement)a.observe(n,{attributes:!0,attributeFilter:["style","class"]});return document.addEventListener("os-desktop-theme-changed",i),()=>{a.disconnect(),document.removeEventListener("os-desktop-theme-changed",i)}}function Ji(s,e,t,o){if(o<.4)return[];const i=new Set(s),a=e.filter(n=>i.has(n));return o<.5?a.slice(0,6):[...new Set([...t!==null&&i.has(t)?[t]:[],...a,...s])].slice(0,6)}async function Qi(s,e){const t=window.wp?.os;if(!t||typeof t.loadModules!="function")return s.textContent=`${e} ${u("Shell modules API missing.")}`,null;try{await t.loadModules(["pixijs"])}catch{return s.textContent=e,null}const o=window.PIXI;return o||(s.textContent=e),o??null}async function en(s,e,t){const o=new s.Application;await o.init({resizeTo:e,backgroundAlpha:0,antialias:!0,autoDensity:!0,resolution:Math.min(window.devicePixelRatio||1,2)}),e.appendChild(o.canvas),o.canvas.classList.add(t);const i=new s.Container;return i.x=e.clientWidth/2,i.y=e.clientHeight/2,o.stage.addChild(i),o.stage.eventMode="static",o.stage.hitArea=new s.Rectangle(0,0,e.clientWidth,e.clientHeight),{app:o,world:i}}function ms(s,e,t){try{s.ticker?.stop()}catch{}try{s.destroy({removeView:!0},{children:!0})}catch{}e.replaceChildren(),e.classList.remove(...t)}function bs(s){return Math.hypot(s.b.x-s.a.x,s.b.y-s.a.y)}function _s(s){return{x:(s.a.x+s.b.x)/2,y:(s.a.y+s.b.y)/2}}function tn(s,e,t,o){const i=bs(e),a=bs(t),n=i>0&&a>0?a/i:1,r=Math.max(o.min,Math.min(o.max,s.scale*n)),l=_s(e),c=_s(t),d=(l.x-s.x)/s.scale,p=(l.y-s.y)/s.scale;return{scale:r,x:c.x-d*r,y:c.y-p*r}}function sn(s,e){const t=s.ownerDocument.defaultView,o=new AbortController,i=new Map,a=s.style.touchAction;s.style.touchAction="none";let n=!1,r=0;const l=p=>{const g=s.getBoundingClientRect();return{x:p.clientX-g.left,y:p.clientY-g.top}},c={capture:!0,passive:!1,signal:o.signal};t.addEventListener("pointerdown",p=>{p.pointerType!=="touch"||!p.composedPath().includes(s)||(i.set(p.pointerId,l(p)),i.size>=2&&(p.preventDefault(),n||(n=!0,e.start())))},c),t.addEventListener("pointermove",p=>{if(!i.has(p.pointerId))return;if(!n){i.set(p.pointerId,l(p));return}const[g,v]=i.values();if(i.set(p.pointerId,l(p)),p.preventDefault(),v){const[_,x]=i.values();e.write(tn(e.read(),{a:g,b:v},{a:_,b:x},e.bounds))}},c);const d=p=>{i.delete(p.pointerId)&&n&&(p.preventDefault(),i.size||(n=!1,r=performance.now()+300,e.end()))};return t.addEventListener("pointerup",d,c),t.addEventListener("pointercancel",d,c),t.addEventListener("lostpointercapture",d,c),t.addEventListener("click",p=>{p.detail>0&&(n||performance.now()<r)&&p.composedPath().includes(s)&&(p.preventDefault(),p.stopImmediatePropagation())},c),{active:()=>n,dispose:()=>{o.abort(),i.clear(),n&&e.end(),n=!1,s.style.touchAction=a}}}function mt(s,e,t,o){const i=Math.min(1.8,Math.max(.08,e)),a=i/s.zoom;s.x=t-(t-s.x)*a,s.y=o-(o-s.y)*a,s.zoom=i}function on(s,e,t){const o=new Map,i=new AbortController,{signal:a}=i,n=sn(s,{read:()=>({x:e.x,y:e.y,scale:e.zoom}),write:c=>{e.x=c.x,e.y=c.y,e.zoom=c.scale,t()},bounds:{min:.08,max:1.8},start:()=>{o.clear(),s.classList.add("is-panning")},end:()=>s.classList.remove("is-panning")}),r=c=>{const d=s.getBoundingClientRect();return{x:c.clientX-d.left,y:c.clientY-d.top}};s.addEventListener("pointerdown",c=>{n.active()||c.button!==0||c.target.closest("os-button, a")||(o.set(c.pointerId,r(c)),s.setPointerCapture(c.pointerId),s.classList.add("is-panning"))},{signal:a}),s.addEventListener("pointermove",c=>{const d=o.get(c.pointerId);if(n.active()||!d)return;const p=r(c);o.set(c.pointerId,p),e.x+=p.x-d.x,e.y+=p.y-d.y,t()},{signal:a});const l=c=>{o.delete(c.pointerId),o.size||s.classList.remove("is-panning")};return s.addEventListener("pointerup",l,{signal:a}),s.addEventListener("pointercancel",l,{signal:a}),s.addEventListener("lostpointercapture",l,{signal:a}),s.addEventListener("wheel",c=>{c.preventDefault();const d=s.getBoundingClientRect();mt(e,e.zoom*Math.exp(-c.deltaY*.0015),c.clientX-d.left,c.clientY-d.top),t()},{signal:a,passive:!1}),s.addEventListener("keydown",c=>{if(c.target!==s)return;const d=70;if(c.key==="ArrowLeft")e.x+=d;else if(c.key==="ArrowRight")e.x-=d;else if(c.key==="ArrowUp")e.y+=d;else if(c.key==="ArrowDown")e.y-=d;else if(c.key==="+"||c.key==="="||c.key==="-")mt(e,e.zoom*(c.key==="-"?.8:1.25),s.clientWidth/2,s.clientHeight/2);else return;c.preventDefault(),t()},{signal:a}),()=>{i.abort(),n.dispose(),o.clear(),s.classList.remove("is-panning")}}async function nn(s,e,t,o,i,a){const n=document.createElement("div"),r=await Qi(n,u("The connection renderer is unavailable."));if(a.aborted)return null;if(!r)throw new Error(n.textContent||u("PixiJS could not load."));const{app:l,world:c}=await en(r,s,"os-page-atlas__canvas");if(a.aborted)return ms(l,s,[]),null;l.ticker?.stop();const d=new r.Graphics;c.addChild(d);const p=document.createElement("div");p.className="os-page-atlas__world",s.append(p);const g=Xi(e.pages,t,e.edges),v=new Map(g.map(S=>[S.page.id,S])),_=new Map,x=new Map,h={x:30,y:30,zoom:.8};let f=null,m="all",y="",w=!1,k=0,C=0,$=ae(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",ae(s).surface);for(const S of g){const A=document.createElement("article");A.className="os-page-atlas__sheet",A.dataset.pageId=String(S.page.id),A.style.left=`${S.x}px`,A.style.top=`${S.y}px`,Z(b`<header class="os-page-atlas__sheet-head"><span aria-hidden="true">${S.page.id===t?"⌂":"▤"}</span><os-button variant="ghost" title=${Q(S.page)} @click=${()=>o(S.page.id)}>${Q(S.page)}</os-button></header> | |
| 634 | + </div>`},mounted:h=>{const f=h.ui(Ie),m=[];f.stats=Ci(h.root,h.fetch,ls(h.extra)),f.stats.sync(),m.push(()=>f.stats?.dispose());const y=ft(h,f,o),w=new MutationObserver(()=>{V(h)?.toggleAttribute("loading",h.root.getAttribute("aria-busy")==="true")});w.observe(h.root,{attributes:!0,attributeFilter:["aria-busy"]}),m.push(()=>w.disconnect()),Ne(h,f).fetchAuthorOptions().then(z=>{f.filterData.authors=z,h.repaint()}),f.filterData.loadMoreTags=()=>void ds(h,f),ds(h,f),f.menu=Os(h.root,{section:u("Show columns"),prefix:s,items:ci(y),isChecked:z=>!pe(f,i).has(z),onToggle:z=>{const N=pe(f,i);N.has(z)?N.delete(z):N.add(z);const E=window.wp?.os;E&&typeof E.updateOsSettings=="function"&&E.updateOsSettings({[i]:Array.from(N).sort()},{windowId:h.windowId}),h.repaint()}}),m.push(()=>f.menu?.dispose());const k=window.wp?.os;if(k&&typeof k.subscribeOsSettings=="function"){let z=Array.from(pe(f,i)).sort().join(",");m.push(k.subscribeOsSettings(()=>{const N=Qt(i),E=Array.from(N).sort().join(",");E!==z&&(z=E,f.hidden=N,h.repaint(),f.menu?.refresh())}))}k&&typeof k.subscribe=="function"&&m.push(k.subscribe("os.term.changed",z=>{z?.taxonomy==="category"&&(Gt(y),Vo(y))}));const C=()=>h.repaint();document.addEventListener("os-mode-changed",C),m.push(()=>document.removeEventListener("os-mode-changed",C)),m.push(c(h,f));const $=dt(h,f),P=window.wp?.hooks;return P&&typeof P.doAction=="function"&&P.doAction(ni,$),document.dispatchEvent(new CustomEvent("os-posts-window-opened",{detail:$})),()=>{f.disposed=!0;for(const z of m)z();f.feed.dispose(),f.atlas?.(),f.editor?.(),f.editor=null,f.canvases.categories?.(),f.canvases.tags?.(),f.canvases={categories:null,tags:null},Gt(y)}},updated:h=>{Oi(h.root),_(h,h.ui(Ie));const f=V(h);if(!f)return;h.loading&&f.setAttribute("loading","");const m=h.ui(Ie);m.stats?.sync(),m.feed.observe(h.root);const{state:y,data:w}=h,k=ft(h,m,o),C=`${Array.from(pe(m,i)).sort().join(",")}|${Ui(m.filterData)}`;C!==m.columnsKey&&(m.columnsKey=C,m.cellCache.clear(),m.table.invalidateColumns());const $=m.feed.items;m.table.sync({table:f,rows:$,listKey:[y.perPage,y.search,y.status,y.orderby,y.order,y.author.join(","),y.tag.join(",")].join("|"),fingerprint:Hi($),columns:z=>(m.cellCache.clear(),ct(k,m.cellCache,m.filterData,z,pe(m,i))),wire:()=>Vi(h,m,f),onSelection:z=>{m.selected=z.length}}).dataChanged&&($.some(z=>z.id===m.desk.focused)||(m.desk.focused=null),queueMicrotask(()=>{m.disposed||h.repaint()}),m.cellCache.clear(),Zt(k,$),w&&yi(w))}})}const gt=480,hs=368;function ji(s,e,t){var v;const o=new Map(s.map(_=>[_.id,_])),i=new Map(s.map(_=>[_.id,new Set]));for(const _ of e)i.get(_.from)?.add(_.to),i.get(_.to)?.add(_.from);const a=new Set,n=[];for(const _ of s){if(a.has(_.id))continue;const x=[_.id];a.add(_.id);for(let h=0;h<x.length;h++)for(const f of i.get(x[h])||[])o.has(f)&&!a.has(f)&&(a.add(f),x.push(f));n.push(x)}n.sort((_,x)=>x.length-_.length||_[0]-x[0]);const r=new Map;let l=0,c=1;for(const _ of n.filter(x=>x.length>1)){const x=_.includes(t||0)?t:[..._].sort((k,C)=>(i.get(C)?.size||0)-(i.get(k)?.size||0)||k-C)[0],h=new Map([[x,0]]),f=[x];for(let k=0;k<f.length;k++)for(const C of i.get(f[k])||[])!h.has(C)&&o.has(C)&&(h.set(C,h.get(f[k])+1),f.push(C));const m=[];for(const k of f)(m[v=h.get(k)]??(m[v]=[])).push(k);for(let k=0;k<6;k++){const C=m.map(($,P)=>P);k%2&&C.reverse();for(const $ of C){const P=m[$+(k%2?1:-1)];if(!P)continue;const z=new Map(P.map((E,q)=>[E,q])),N=E=>{const q=Array.from(i.get(E)||[]).filter(ee=>z.has(ee)).map(ee=>z.get(ee));return q.length?q.reduce((ee,bt)=>ee+bt,0)/q.length:0};m[$].sort((E,q)=>N(E)-N(q)||E-q)}}const y=Math.min(6,Math.max(...m.map(k=>k.length)));let w=0;for(const k of m)k.forEach((C,$)=>r.set(C,{x:(w+Math.floor($/y))*gt,y:(l+$%y+Math.floor((y-Math.min(y,k.length))/2))*hs})),w+=Math.ceil(k.length/y);l+=y+1,c=Math.max(c,w)}const d=n.filter(_=>_.length===1).flat(),p=Math.max(c+(d.length?1:0),Math.ceil(Math.sqrt(s.length*1.2)),1);let g=0;for(const _ of d){for(;Math.floor(g/p)<Math.max(0,l-1)&&g%p<c;)g++;r.set(_,{x:g%p*gt,y:Math.floor(g/p)*hs}),g++}return[...s].sort((_,x)=>+(x.id===t)-+(_.id===t)).map(_=>({page:_,...r.get(_.id)}))}function Ki(s,e,t=0){const o=(t%7-3)*7,i=e.x>=s.x,a={x:s.x+(i?J:0),y:s.y+ie/2+o},n=s.x===e.x,r={x:e.x+(i&&!n?0:J),y:e.y+ie/2+o},l=s.x+(i?J+90+o:-90+o),c=e.x+(i&&!n?-90+o:J+90+o);let d;if(n)d=[a,{x:l,y:a.y},{x:l,y:r.y},r];else if(s.y===e.y&&Math.abs(s.x-e.x)===gt)d=[a,r];else{const p=s.y+(e.y<s.y?-55:ie+55)+o;d=[a,{x:l,y:a.y},{x:l,y:p},{x:c,y:p},{x:c,y:r.y},r]}return d.filter((p,g)=>!g||p.x!==d[g-1].x||p.y!==d[g-1].y)}const J=300,ie=258,Bi=1440,Gi=900,Q=s=>ae(s.title.rendered)||u("(no title)");function Oe(s,e=location.origin){try{const t=new URL(s.link,e);return t.origin!==e||!/^https?:$/.test(t.protocol)||/\/wp-admin(?:\/|$)|\/wp-login\.php/.test(t.pathname)?null:(t.hash="",["publish","private"].includes(s.status)||t.searchParams.set("preview","true"),t.href)}catch{return null}}function fs(s){const e=s.searchParams.get("page_id")||s.searchParams.get("p");return e?`${s.origin}/#${e}`:`${s.origin}${s.pathname.replace(/\/+$/,"")}`}function gs(s){const e=new Map(s.map(i=>[i.id,i])),t=new Map;for(const i of s)try{t.set(fs(new URL(i.link)),i.id)}catch{}const o=new Map;for(const i of s){if(i.parent&&i.parent!==i.id&&e.has(i.parent)&&o.set(`parent:${i.parent}:${i.id}`,{from:i.parent,to:i.id,kind:"parent"}),!i.content?.rendered||i.content.protected)continue;const a=new DOMParser().parseFromString(i.content.rendered,"text/html");for(const n of a.querySelectorAll("a[href]"))try{const r=new URL(i.link),l=new URL(n.getAttribute("href"),r);if(l.origin!==r.origin)continue;const c=Number(l.searchParams.get("page_id")||l.searchParams.get("p")),d=c&&e.has(c)?c:t.get(fs(l));d&&d!==i.id&&o.set(`link:${i.id}:${d}`,{from:i.id,to:d,kind:"link"})}catch{}}return Array.from(o.values())}async function Zi(s,e){const t=[];let o=0,i=1;for(let n=1;n<=Math.min(i,5);n++){const r=new URLSearchParams({context:"edit",status:"publish,future,draft,pending,private",per_page:"100",page:String(n),orderby:"menu_order",order:"asc",_fields:"id,parent,title,link,slug,status,content"}),l=await s(`wp/v2/pages?${r}`,{signal:e});if(!l.ok)throw new Error(u("Pages could not be loaded. Try refreshing the atlas."));const c=await l.json();if(!Array.isArray(c))throw new Error(u("The page response was invalid."));t.push(...c),i=Math.max(1,Number(l.headers.get("X-WP-TotalPages"))||1),o=Number(l.headers.get("X-WP-Total"))||t.length}const a=Array.from(new Map(t.map(n=>[n.id,n])).values());return{pages:a,edges:gs(a),total:o}}function Xi(s,e,t=gs(s)){return ji(s,t,e)}function re(s){const e=B(s,"--os-ui-surface","#ffffff",16777215);return{surface:e,raised:B(s,"--os-ui-surface-elevated","#ffffff",e),fg:B(s,"--os-ui-fg","#1d2327",e),muted:B(s,"--os-ui-fg-muted","#50575e",e),faint:B(s,"--os-ui-fg-faint","#b0b3b8",e),border:B(s,"--os-ui-border","#dcdcde",e),accent:B(s,"--os-ui-accent","#2271b1",e)}}function B(s,e,t,o=16777215){const i=document.createElement("span");i.hidden=!0,i.style.color=`var(${e}, ${t})`,s.append(i);const a=getComputedStyle(i).color;i.remove();const n=a.match(/[\d.]+/g)?.map(Number);if(!n||n.length<3)return parseInt(t.slice(1),16);const r=n[3]??1,l=a.startsWith("color(srgb");return[16,8,0].reduce((c,d,p)=>{const g=n[p]*(l?255:1),v=Math.floor(o/2**d)%256;return c+Math.round(g*r+v*(1-r))*2**d},0)}function Yi(s,e,t){let o=JSON.stringify([re(s),t?.()]);const i=()=>{const n=JSON.stringify([re(s),t?.()]);n!==o&&(o=n,e())},a=new MutationObserver(i);for(let n=s;n;n=n.parentElement)a.observe(n,{attributes:!0,attributeFilter:["style","class"]});return document.addEventListener("os-desktop-theme-changed",i),()=>{a.disconnect(),document.removeEventListener("os-desktop-theme-changed",i)}}function Ji(s,e,t,o){if(o<.4)return[];const i=new Set(s),a=e.filter(n=>i.has(n));return o<.5?a.slice(0,6):[...new Set([...t!==null&&i.has(t)?[t]:[],...a,...s])].slice(0,6)}async function Qi(s,e){const t=window.wp?.os;if(!t||typeof t.loadModules!="function")return s.textContent=`${e} ${u("Shell modules API missing.")}`,null;try{await t.loadModules(["pixijs"])}catch{return s.textContent=e,null}const o=window.PIXI;return o||(s.textContent=e),o??null}async function en(s,e,t){const o=new s.Application;await o.init({resizeTo:e,backgroundAlpha:0,antialias:!0,autoDensity:!0,resolution:Math.min(window.devicePixelRatio||1,2)}),e.appendChild(o.canvas),o.canvas.classList.add(t);const i=new s.Container;return i.x=e.clientWidth/2,i.y=e.clientHeight/2,o.stage.addChild(i),o.stage.eventMode="static",o.stage.hitArea=new s.Rectangle(0,0,e.clientWidth,e.clientHeight),{app:o,world:i}}function ms(s,e,t){try{s.ticker?.stop()}catch{}try{s.destroy({removeView:!0},{children:!0})}catch{}e.replaceChildren(),e.classList.remove(...t)}function bs(s){return Math.hypot(s.b.x-s.a.x,s.b.y-s.a.y)}function _s(s){return{x:(s.a.x+s.b.x)/2,y:(s.a.y+s.b.y)/2}}function tn(s,e,t,o){const i=bs(e),a=bs(t),n=i>0&&a>0?a/i:1,r=Math.max(o.min,Math.min(o.max,s.scale*n)),l=_s(e),c=_s(t),d=(l.x-s.x)/s.scale,p=(l.y-s.y)/s.scale;return{scale:r,x:c.x-d*r,y:c.y-p*r}}function sn(s,e){const t=s.ownerDocument.defaultView,o=new AbortController,i=new Map,a=s.style.touchAction;s.style.touchAction="none";let n=!1,r=0;const l=p=>{const g=s.getBoundingClientRect();return{x:p.clientX-g.left,y:p.clientY-g.top}},c={capture:!0,passive:!1,signal:o.signal};t.addEventListener("pointerdown",p=>{p.pointerType!=="touch"||!p.composedPath().includes(s)||(i.set(p.pointerId,l(p)),i.size>=2&&(p.preventDefault(),n||(n=!0,e.start())))},c),t.addEventListener("pointermove",p=>{if(!i.has(p.pointerId))return;if(!n){i.set(p.pointerId,l(p));return}const[g,v]=i.values();if(i.set(p.pointerId,l(p)),p.preventDefault(),v){const[_,x]=i.values();e.write(tn(e.read(),{a:g,b:v},{a:_,b:x},e.bounds))}},c);const d=p=>{i.delete(p.pointerId)&&n&&(p.preventDefault(),i.size||(n=!1,r=performance.now()+300,e.end()))};return t.addEventListener("pointerup",d,c),t.addEventListener("pointercancel",d,c),t.addEventListener("lostpointercapture",d,c),t.addEventListener("click",p=>{p.detail>0&&(n||performance.now()<r)&&p.composedPath().includes(s)&&(p.preventDefault(),p.stopImmediatePropagation())},c),{active:()=>n,dispose:()=>{o.abort(),i.clear(),n&&e.end(),n=!1,s.style.touchAction=a}}}function mt(s,e,t,o){const i=Math.min(1.8,Math.max(.08,e)),a=i/s.zoom;s.x=t-(t-s.x)*a,s.y=o-(o-s.y)*a,s.zoom=i}function on(s,e,t){const o=new Map,i=new AbortController,{signal:a}=i,n=sn(s,{read:()=>({x:e.x,y:e.y,scale:e.zoom}),write:c=>{e.x=c.x,e.y=c.y,e.zoom=c.scale,t()},bounds:{min:.08,max:1.8},start:()=>{o.clear(),s.classList.add("is-panning")},end:()=>s.classList.remove("is-panning")}),r=c=>{const d=s.getBoundingClientRect();return{x:c.clientX-d.left,y:c.clientY-d.top}};s.addEventListener("pointerdown",c=>{n.active()||c.button!==0||c.target.closest("os-button, a")||(o.set(c.pointerId,r(c)),s.setPointerCapture(c.pointerId),s.classList.add("is-panning"))},{signal:a}),s.addEventListener("pointermove",c=>{const d=o.get(c.pointerId);if(n.active()||!d)return;const p=r(c);o.set(c.pointerId,p),e.x+=p.x-d.x,e.y+=p.y-d.y,t()},{signal:a});const l=c=>{o.delete(c.pointerId),o.size||s.classList.remove("is-panning")};return s.addEventListener("pointerup",l,{signal:a}),s.addEventListener("pointercancel",l,{signal:a}),s.addEventListener("lostpointercapture",l,{signal:a}),s.addEventListener("wheel",c=>{c.preventDefault();const d=s.getBoundingClientRect();mt(e,e.zoom*Math.exp(-c.deltaY*.0015),c.clientX-d.left,c.clientY-d.top),t()},{signal:a,passive:!1}),s.addEventListener("keydown",c=>{if(c.target!==s)return;const d=70;if(c.key==="ArrowLeft")e.x+=d;else if(c.key==="ArrowRight")e.x-=d;else if(c.key==="ArrowUp")e.y+=d;else if(c.key==="ArrowDown")e.y-=d;else if(c.key==="+"||c.key==="="||c.key==="-")mt(e,e.zoom*(c.key==="-"?.8:1.25),s.clientWidth/2,s.clientHeight/2);else return;c.preventDefault(),t()},{signal:a}),()=>{i.abort(),n.dispose(),o.clear(),s.classList.remove("is-panning")}}async function nn(s,e,t,o,i,a){const n=document.createElement("div"),r=await Qi(n,u("The connection renderer is unavailable."));if(a.aborted)return null;if(!r)throw new Error(n.textContent||u("PixiJS could not load."));const{app:l,world:c}=await en(r,s,"os-page-atlas__canvas");if(a.aborted)return ms(l,s,[]),null;l.ticker?.stop();const d=new r.Graphics;c.addChild(d);const p=document.createElement("div");p.className="os-page-atlas__world",s.append(p);const g=Xi(e.pages,t,e.edges),v=new Map(g.map(S=>[S.page.id,S])),_=new Map,x=new Map,h={x:30,y:30,zoom:.8};let f=null,m="all",y="",w=!1,k=0,C=0,$=re(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",re(s).surface);for(const S of g){const A=document.createElement("article");A.className="os-page-atlas__sheet",A.dataset.pageId=String(S.page.id),A.style.left=`${S.x}px`,A.style.top=`${S.y}px`,Z(b`<header class="os-page-atlas__sheet-head"><span aria-hidden="true">${S.page.id===t?"⌂":"▤"}</span><os-button variant="ghost" title=${Q(S.page)} @click=${()=>o(S.page.id)}>${Q(S.page)}</os-button></header> | |
| 635 | 635 | <div class="os-page-atlas__viewport"><div class="os-page-atlas__placeholder">${u("Zoom closer for a live preview")}</div></div> |
| 636 | - <footer class="os-page-atlas__sheet-foot"><span>/${S.page.slug}</span><span>${Ze[S.page.status]||S.page.status}</span></footer>`,A),p.append(A),_.set(S.page.id,A)}const z=(S,A,M,j,T)=>{S.moveTo(A[0].x,A[0].y);for(let D=1;D<A.length-1;D++){const L=A[D-1],I=A[D],te=A[D+1],G=Math.hypot(I.x-L.x,I.y-L.y),_t=Math.hypot(te.x-I.x,te.y-I.y),qe=Math.min(14,G/2,_t/2),ys={x:I.x+(L.x-I.x)/G*qe,y:I.y+(L.y-I.y)/G*qe},ks={x:I.x+(te.x-I.x)/_t*qe,y:I.y+(te.y-I.y)/_t*qe};S.lineTo(ys.x,ys.y).bezierCurveTo(I.x,I.y,I.x,I.y,ks.x,ks.y)}const O=A[A.length-1];S.lineTo(O.x,O.y).stroke({color:M,width:j,alpha:T})},N=()=>{d.clear();const S=new Set;for(const[A,M]of e.edges.entries()){if(m!=="all"&&M.kind!==m)continue;const j=v.get(M.from),T=v.get(M.to);if(!j||!T)continue;const O=f===null||M.from===f||M.to===f;O&&(S.add(M.from),S.add(M.to));const D=M.kind==="parent"?$:P,L=Ki(j,T,A);z(d,L,D,O?10:4,O?.07:.025),z(d,L,D,O?2:1,O?.7:.14);const I=L[L.length-1],te=L[L.length-2],G=Math.sign(I.x-te.x)||1;d.moveTo(I.x-G*9,I.y-5).lineTo(I.x,I.y).lineTo(I.x-G*9,I.y+5).stroke({color:D,width:2,alpha:O?.9:.16}),d.circle(L[0].x,L[0].y,3).fill({color:D,alpha:O?.9:.16})}for(const A of g){const M=_.get(A.page.id);M.classList.toggle("is-selected",A.page.id===f),M.classList.toggle("is-muted",y?!`${Q(A.page)} ${A.page.slug}`.toLocaleLowerCase().includes(y):f!==null&&A.page.id!==f&&!S.has(A.page.id))}},E=()=>{if(w)return;const S=s.clientWidth,A=s.clientHeight,M=S&&A?g.filter(T=>h.x+(T.x+J)*h.zoom>0&&h.y+(T.y+ie)*h.zoom>0&&h.x+T.x*h.zoom<S&&h.y+T.y*h.zoom<A).sort((T,O)=>T.page.id===f?-1:O.page.id===f?1:Math.hypot(h.x+T.x*h.zoom-S/2,h.y+T.y*h.zoom-A/2)-Math.hypot(h.x+O.x*h.zoom-S/2,h.y+O.y*h.zoom-A/2)):[],j=new Set(Ji(M.filter(T=>Oe(T.page)).map(T=>T.page.id),[...x.keys()],f,h.zoom));for(const[T,O]of _){const D=O.querySelector(".os-page-atlas__placeholder");D.textContent=h.zoom<.5?u("Zoom closer for a live preview"):u("Select this page for a live preview"),Oe(v.get(T).page)||(D.textContent=u("Open the editor to preview this page."))}for(const[T,O]of x)j.has(T)||(O.remove(),x.delete(T));for(const T of M){if(!j.has(T.page.id)||x.has(T.page.id))continue;const O=_.get(T.page.id).querySelector(".os-page-atlas__viewport"),D=Oe(T.page);if(!D)continue;const L=document.createElement("iframe");L.title=`${u("Page preview")}: ${Q(T.page)}`,L.width=String(Bi),L.height=String(Gi),L.tabIndex=-1,L.setAttribute("aria-hidden","true"),L.setAttribute("inert",""),L.setAttribute("sandbox","allow-scripts allow-same-origin"),L.src=D,O.append(L),x.set(T.page.id,L)}},q=()=>{w||(c.x=h.x,c.y=h.y,c.scale.set(h.zoom),p.style.transform=`translate(${h.x}px, ${h.y}px) scale(${h.zoom})`,l.render(),i(h.zoom),clearTimeout(k),k=window.setTimeout(E,160))},ee=()=>{if(!s.clientWidth||!s.clientHeight)return;const S=Math.max(J,...g.map(M=>M.x+J)),A=Math.max(ie,...g.map(M=>M.y+ie));h.zoom=Math.max(.08,Math.min(1,(s.clientWidth-70)/S,(s.clientHeight-70)/A)),h.x=(s.clientWidth-S*h.zoom)/2,h.y=(s.clientHeight-A*h.zoom)/2,q()},bt=S=>{const A=v.get(S);if(!A)return;f=S,N();const M={...h},j=Math.min(1.1,(s.clientWidth-80)/J,(s.clientHeight-80)/ie),T={zoom:Math.max(.35,j),x:s.clientWidth/2-(A.x+J/2)*j,y:s.clientHeight/2-(A.y+ie/2)*j};cancelAnimationFrame(C);const O=window.matchMedia("(prefers-reduced-motion: reduce)").matches,D=performance.now(),L=I=>{if(w)return;const te=O?1:Math.min(1,(I-D)/330),G=1-Math.pow(1-te,3);h.x=M.x+(T.x-M.x)*G,h.y=M.y+(T.y-M.y)*G,h.zoom=M.zoom+(T.zoom-M.zoom)*G,q(),te<1&&(C=requestAnimationFrame(L))};C=requestAnimationFrame(L)},cn=Yi(s,()=>{$=ae(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",ae(s).surface),N(),l.render()},()=>B(s,"--os-ui-info-fg","#72aee6",ae(s).surface)),dn=on(s,h,q);let vs=!1;const xs=new ResizeObserver(()=>{w||(s.clientWidth&&s.clientHeight?(l.renderer.resize(s.clientWidth,s.clientHeight),vs?q():(ee(),vs=!0)):E())});return xs.observe(s),N(),ee(),{focus:bt,fit:()=>{cancelAnimationFrame(C),f=null,N(),ee()},filter:(S,A)=>{m=S,y=A.toLocaleLowerCase().trim(),N(),q()},zoom:S=>{cancelAnimationFrame(C),mt(h,h.zoom*S,s.clientWidth/2,s.clientHeight/2),q()},dispose:()=>{w=!0,cn(),clearTimeout(k),cancelAnimationFrame(C),dn(),xs.disconnect(),x.forEach(S=>S.remove()),ms(l,s,[])}}}const an=R` .os-page-atlas{display:flex;flex-direction:column;flex:1;min-inline-size:0;min-block-size:0;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface,#fff );container:page-atlas / inline-size}.os-page-atlas__head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 24px 16px}.os-page-atlas__head h2{font-size:29px;font-weight:500;line-height:1.1;letter-spacing:-.045em;margin:0 0 6px;color:inherit}.os-page-atlas__head p{font-size:11px;margin:0;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__totals{display:flex;gap:18px;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 );--os-ui-stat-value-size:26px}.os-page-atlas__tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 24px;border-block:1px solid var( --os-ui-border,#dcdcde )}.os-page-atlas__tools os-text-field{flex:1;min-inline-size:130px}.os-page-atlas__tools os-select{inline-size:152px}.os-page-atlas__main{display:flex;flex:1;min-block-size:0;position:relative;overflow:hidden}.os-page-atlas__stage{position:relative;flex:1;min-inline-size:0;min-block-size:0;overflow:hidden;touch-action:none;cursor:grab;background-color:var( --os-ui-surface-sunken,#f6f7f7 );background-image:radial-gradient(circle,var( --os-ui-border,#dcdcde ) .7px,transparent .9px);background-size:22px 22px;isolation:isolate}.os-page-atlas__surface{position:absolute;inset:0;overflow:hidden;touch-action:none}.os-page-atlas__surface:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-3px}.os-page-atlas__surface.is-panning{cursor:grabbing;user-select:none}.os-page-atlas__canvas{position:absolute;inset:0;pointer-events:none;z-index:0}.os-page-atlas__world{position:absolute;inset:0 auto auto 0;transform-origin:0 0;z-index:1}.os-page-atlas__sheet{position:absolute;box-sizing:border-box;inline-size:300px;block-size:258px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;background:var( --os-ui-surface,#fff );box-shadow:0 12px 25px -16px var( --os-ui-fg-muted,#646970 ),4px 5px 0 -1px var( --os-ui-surface,#fff ),4px 5px 0 0 var( --os-ui-border,#dcdcde )}.os-page-atlas__sheet.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px}.os-page-atlas__sheet.is-muted{opacity:.36}.os-page-atlas__sheet-head{display:flex;align-items:center;gap:7px;padding:6px 9px;block-size:30px}.os-page-atlas__sheet-head>span{color:var( --os-ui-accent,#2271b1 );font-size:13px}.os-page-atlas__sheet-head os-button{flex:1;min-inline-size:0;text-align:start;--os-ui-button-padding:3px 0}.os-page-atlas__sheet-head os-button::part(button){display:block;inline-size:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start}.os-page-atlas__viewport{position:relative;inline-size:288px;block-size:180px;margin-inline:5px;overflow:hidden;border-radius:3px;background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.os-page-atlas__viewport iframe{position:absolute;inset:0 auto auto 0;display:block;width:1440px !important;height:900px !important;max-width:none !important;max-height:none !important;border:0;transform:scale(.2);transform-origin:0 0;pointer-events:none}.os-page-atlas__placeholder{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 );background-image:repeating-linear-gradient(transparent 0 21px,var( --os-ui-border-subtle,#f0f0f1 ) 21px 22px)}.os-page-atlas__sheet-foot{display:flex;justify-content:space-between;gap:6px;padding:8px 10px;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__sheet-foot span:first-child{max-inline-size:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-page-atlas__directory{flex:0 0 215px;min-inline-size:0;padding:14px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );display:flex;flex-direction:column;gap:12px}.os-page-atlas__directory h3{margin:0;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list{overflow:auto;flex:1;min-block-size:0;display:flex;flex-direction:column;gap:5px}.os-page-atlas__list os-button{display:block;text-align:start;--os-ui-button-padding:8px 10px}.os-page-atlas__list os-button::part(button){inline-size:100%;justify-content:space-between;text-align:start}.os-page-atlas__list os-button span{font-variant-numeric:tabular-nums;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list os-button[aria-pressed="true"]{outline:1px solid var( --os-ui-accent,#2271b1 );border-radius:7px}.os-page-atlas__selection{font-size:12px;border-block-start:1px solid var( --os-ui-border,#dcdcde );padding-block-start:10px}.os-page-atlas__selection strong{display:block;margin-block-end:6px;overflow-wrap:anywhere}.os-page-atlas__selection p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );line-height:1.6}.os-page-atlas__selection os-button{margin-block:4px}.os-page-atlas__legend{display:flex;align-items:center;gap:14px;padding:9px 20px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );border-block-start:1px solid var( --os-ui-border,#dcdcde );flex-wrap:wrap}.os-page-atlas__legend span{display:inline-flex;align-items:center;gap:6px}.os-page-atlas__legend i{inline-size:20px;border-block-start:2px solid var( --os-ui-accent,#2271b1 )}.os-page-atlas__legend .is-link{border-color:var( --os-ui-info,#72aee6 )}.os-page-atlas__legend small{margin-inline-start:auto;font-size:inherit}.os-page-atlas__zoom{position:absolute;inset-block-end:14px;inset-inline-start:14px;z-index:3;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface,#fff )}.os-page-atlas__zoom output{min-inline-size:42px;font-size:10px;text-align:center}.os-page-atlas__message{padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__refresh .dashicons{inline-size:16px;block-size:16px;font-size:16px}.os-page-atlas__browse{display:none}@container page-atlas (max-width:720px){.os-page-atlas__head{padding:12px;gap:10px}.os-page-atlas__head h2{font-size:21px}.os-page-atlas__head p{display:none}.os-page-atlas__totals{gap:12px;--os-ui-stat-value-size:19px}.os-page-atlas__totals os-stat::part(label){font-size:8px}.os-page-atlas__tools{padding:6px 12px;gap:6px}.os-page-atlas__tools os-text-field{min-inline-size:85px}.os-page-atlas__refresh{--os-ui-button-padding:6px}.os-page-atlas__refresh-label{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}.os-page-atlas__tools os-select{inline-size:108px}.os-page-atlas__browse{display:block}.os-page-atlas__directory{display:none}.os-page-atlas.is-browsing .os-page-atlas__directory{display:flex;flex:1;border:0}.os-page-atlas.is-browsing .os-page-atlas__stage,.os-page-atlas.is-browsing .os-page-atlas__zoom{display:none}.os-page-atlas__legend{padding:7px 12px;gap:8px}.os-page-atlas__legend small{display:none}}`;function rn(s,e){let t=!1,o=new AbortController,i=null,a={pages:[],edges:[],total:0},n=null,r="",l="all";const c=()=>{g.classList.toggle("is-browsing")},d=k=>{n=k,g.classList.remove("is-browsing"),y(),requestAnimationFrame(()=>{t||i?.focus(k)})},p=()=>{i?.filter(l,r),y()};Z(b`<style>${an.cssText}</style><section class="os-page-atlas" aria-label=${u("Page atlas")}> | |
| 636 | + <footer class="os-page-atlas__sheet-foot"><span>/${S.page.slug}</span><span>${Ze[S.page.status]||S.page.status}</span></footer>`,A),p.append(A),_.set(S.page.id,A)}const z=(S,A,M,j,T)=>{S.moveTo(A[0].x,A[0].y);for(let D=1;D<A.length-1;D++){const L=A[D-1],I=A[D],te=A[D+1],G=Math.hypot(I.x-L.x,I.y-L.y),_t=Math.hypot(te.x-I.x,te.y-I.y),qe=Math.min(14,G/2,_t/2),ys={x:I.x+(L.x-I.x)/G*qe,y:I.y+(L.y-I.y)/G*qe},ks={x:I.x+(te.x-I.x)/_t*qe,y:I.y+(te.y-I.y)/_t*qe};S.lineTo(ys.x,ys.y).bezierCurveTo(I.x,I.y,I.x,I.y,ks.x,ks.y)}const O=A[A.length-1];S.lineTo(O.x,O.y).stroke({color:M,width:j,alpha:T})},N=()=>{d.clear();const S=new Set;for(const[A,M]of e.edges.entries()){if(m!=="all"&&M.kind!==m)continue;const j=v.get(M.from),T=v.get(M.to);if(!j||!T)continue;const O=f===null||M.from===f||M.to===f;O&&(S.add(M.from),S.add(M.to));const D=M.kind==="parent"?$:P,L=Ki(j,T,A);z(d,L,D,O?10:4,O?.07:.025),z(d,L,D,O?2:1,O?.7:.14);const I=L[L.length-1],te=L[L.length-2],G=Math.sign(I.x-te.x)||1;d.moveTo(I.x-G*9,I.y-5).lineTo(I.x,I.y).lineTo(I.x-G*9,I.y+5).stroke({color:D,width:2,alpha:O?.9:.16}),d.circle(L[0].x,L[0].y,3).fill({color:D,alpha:O?.9:.16})}for(const A of g){const M=_.get(A.page.id);M.classList.toggle("is-selected",A.page.id===f),M.classList.toggle("is-muted",y?!`${Q(A.page)} ${A.page.slug}`.toLocaleLowerCase().includes(y):f!==null&&A.page.id!==f&&!S.has(A.page.id))}},E=()=>{if(w)return;const S=s.clientWidth,A=s.clientHeight,M=S&&A?g.filter(T=>h.x+(T.x+J)*h.zoom>0&&h.y+(T.y+ie)*h.zoom>0&&h.x+T.x*h.zoom<S&&h.y+T.y*h.zoom<A).sort((T,O)=>T.page.id===f?-1:O.page.id===f?1:Math.hypot(h.x+T.x*h.zoom-S/2,h.y+T.y*h.zoom-A/2)-Math.hypot(h.x+O.x*h.zoom-S/2,h.y+O.y*h.zoom-A/2)):[],j=new Set(Ji(M.filter(T=>Oe(T.page)).map(T=>T.page.id),[...x.keys()],f,h.zoom));for(const[T,O]of _){const D=O.querySelector(".os-page-atlas__placeholder");D.textContent=h.zoom<.5?u("Zoom closer for a live preview"):u("Select this page for a live preview"),Oe(v.get(T).page)||(D.textContent=u("Open the editor to preview this page."))}for(const[T,O]of x)j.has(T)||(O.remove(),x.delete(T));for(const T of M){if(!j.has(T.page.id)||x.has(T.page.id))continue;const O=_.get(T.page.id).querySelector(".os-page-atlas__viewport"),D=Oe(T.page);if(!D)continue;const L=document.createElement("iframe");L.title=`${u("Page preview")}: ${Q(T.page)}`,L.width=String(Bi),L.height=String(Gi),L.tabIndex=-1,L.setAttribute("aria-hidden","true"),L.setAttribute("inert",""),L.setAttribute("sandbox","allow-scripts allow-same-origin"),L.src=D,O.append(L),x.set(T.page.id,L)}},q=()=>{w||(c.x=h.x,c.y=h.y,c.scale.set(h.zoom),p.style.transform=`translate(${h.x}px, ${h.y}px) scale(${h.zoom})`,l.render(),i(h.zoom),clearTimeout(k),k=window.setTimeout(E,160))},ee=()=>{if(!s.clientWidth||!s.clientHeight)return;const S=Math.max(J,...g.map(M=>M.x+J)),A=Math.max(ie,...g.map(M=>M.y+ie));h.zoom=Math.max(.08,Math.min(1,(s.clientWidth-70)/S,(s.clientHeight-70)/A)),h.x=(s.clientWidth-S*h.zoom)/2,h.y=(s.clientHeight-A*h.zoom)/2,q()},bt=S=>{const A=v.get(S);if(!A)return;f=S,N();const M={...h},j=Math.min(1.1,(s.clientWidth-80)/J,(s.clientHeight-80)/ie),T={zoom:Math.max(.35,j),x:s.clientWidth/2-(A.x+J/2)*j,y:s.clientHeight/2-(A.y+ie/2)*j};cancelAnimationFrame(C);const O=window.matchMedia("(prefers-reduced-motion: reduce)").matches,D=performance.now(),L=I=>{if(w)return;const te=O?1:Math.min(1,(I-D)/330),G=1-Math.pow(1-te,3);h.x=M.x+(T.x-M.x)*G,h.y=M.y+(T.y-M.y)*G,h.zoom=M.zoom+(T.zoom-M.zoom)*G,q(),te<1&&(C=requestAnimationFrame(L))};C=requestAnimationFrame(L)},cn=Yi(s,()=>{$=re(s).accent,P=B(s,"--os-ui-info-fg","#72aee6",re(s).surface),N(),l.render()},()=>B(s,"--os-ui-info-fg","#72aee6",re(s).surface)),dn=on(s,h,q);let vs=!1;const xs=new ResizeObserver(()=>{w||(s.clientWidth&&s.clientHeight?(l.renderer.resize(s.clientWidth,s.clientHeight),vs?q():(ee(),vs=!0)):E())});return xs.observe(s),N(),ee(),{focus:bt,fit:()=>{cancelAnimationFrame(C),f=null,N(),ee()},filter:(S,A)=>{m=S,y=A.toLocaleLowerCase().trim(),N(),q()},zoom:S=>{cancelAnimationFrame(C),mt(h,h.zoom*S,s.clientWidth/2,s.clientHeight/2),q()},dispose:()=>{w=!0,cn(),clearTimeout(k),cancelAnimationFrame(C),dn(),xs.disconnect(),x.forEach(S=>S.remove()),ms(l,s,[])}}}const an=R` .os-page-atlas{display:flex;flex-direction:column;flex:1;min-inline-size:0;min-block-size:0;color:var( --os-ui-fg,#1d2327 );background:var( --os-ui-surface,#fff );container:page-atlas / inline-size}.os-page-atlas__head{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:20px 24px 16px}.os-page-atlas__head h2{font-size:29px;font-weight:500;line-height:1.1;letter-spacing:-.045em;margin:0 0 6px;color:inherit}.os-page-atlas__head p{font-size:11px;margin:0;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__totals{display:flex;gap:18px;--os-ui-stat-padding:0;--os-ui-stat-border:transparent;--os-ui-stat-value-color:var( --os-ui-fg,#1d2327 );--os-ui-stat-value-size:26px}.os-page-atlas__tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 24px;border-block:1px solid var( --os-ui-border,#dcdcde )}.os-page-atlas__tools os-text-field{flex:1;min-inline-size:130px}.os-page-atlas__tools os-select{inline-size:152px}.os-page-atlas__main{display:flex;flex:1;min-block-size:0;position:relative;overflow:hidden}.os-page-atlas__stage{position:relative;flex:1;min-inline-size:0;min-block-size:0;overflow:hidden;touch-action:none;cursor:grab;background-color:var( --os-ui-surface-sunken,#f6f7f7 );background-image:radial-gradient(circle,var( --os-ui-border,#dcdcde ) .7px,transparent .9px);background-size:22px 22px;isolation:isolate}.os-page-atlas__surface{position:absolute;inset:0;overflow:hidden;touch-action:none}.os-page-atlas__surface:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-3px}.os-page-atlas__surface.is-panning{cursor:grabbing;user-select:none}.os-page-atlas__canvas{position:absolute;inset:0;pointer-events:none;z-index:0}.os-page-atlas__world{position:absolute;inset:0 auto auto 0;transform-origin:0 0;z-index:1}.os-page-atlas__sheet{position:absolute;box-sizing:border-box;inline-size:300px;block-size:258px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;background:var( --os-ui-surface,#fff );box-shadow:0 12px 25px -16px var( --os-ui-fg-muted,#646970 ),4px 5px 0 -1px var( --os-ui-surface,#fff ),4px 5px 0 0 var( --os-ui-border,#dcdcde )}.os-page-atlas__sheet.is-selected{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px}.os-page-atlas__sheet.is-muted{opacity:.36}.os-page-atlas__sheet-head{display:flex;align-items:center;gap:7px;padding:6px 9px;block-size:30px}.os-page-atlas__sheet-head>span{color:var( --os-ui-accent,#2271b1 );font-size:13px}.os-page-atlas__sheet-head os-button{flex:1;min-inline-size:0;text-align:start;--os-ui-button-padding:3px 0}.os-page-atlas__sheet-head os-button::part(button){display:block;inline-size:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:start}.os-page-atlas__viewport{position:relative;inline-size:288px;block-size:180px;margin-inline:5px;overflow:hidden;border-radius:3px;background:var( --os-ui-surface-sunken,#f6f7f7 );pointer-events:none}.os-page-atlas__viewport iframe{position:absolute;inset:0 auto auto 0;display:block;width:1440px !important;height:900px !important;max-width:none !important;max-height:none !important;border:0;transform:scale(.2);transform-origin:0 0;pointer-events:none}.os-page-atlas__placeholder{position:absolute;inset:0;display:grid;place-content:center;text-align:center;padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 );background-image:repeating-linear-gradient(transparent 0 21px,var( --os-ui-border-subtle,#f0f0f1 ) 21px 22px)}.os-page-atlas__sheet-foot{display:flex;justify-content:space-between;gap:6px;padding:8px 10px;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__sheet-foot span:first-child{max-inline-size:210px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-page-atlas__directory{flex:0 0 215px;min-inline-size:0;padding:14px;border-inline-start:1px solid var( --os-ui-border,#dcdcde );display:flex;flex-direction:column;gap:12px}.os-page-atlas__directory h3{margin:0;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list{overflow:auto;flex:1;min-block-size:0;display:flex;flex-direction:column;gap:5px}.os-page-atlas__list os-button{display:block;text-align:start;--os-ui-button-padding:8px 10px}.os-page-atlas__list os-button::part(button){inline-size:100%;justify-content:space-between;text-align:start}.os-page-atlas__list os-button span{font-variant-numeric:tabular-nums;font-size:10px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__list os-button[aria-pressed="true"]{outline:1px solid var( --os-ui-accent,#2271b1 );border-radius:7px}.os-page-atlas__selection{font-size:12px;border-block-start:1px solid var( --os-ui-border,#dcdcde );padding-block-start:10px}.os-page-atlas__selection strong{display:block;margin-block-end:6px;overflow-wrap:anywhere}.os-page-atlas__selection p{font-size:11px;color:var( --os-ui-fg-muted,#646970 );line-height:1.6}.os-page-atlas__selection os-button{margin-block:4px}.os-page-atlas__legend{display:flex;align-items:center;gap:14px;padding:9px 20px;font-size:10px;color:var( --os-ui-fg-muted,#646970 );border-block-start:1px solid var( --os-ui-border,#dcdcde );flex-wrap:wrap}.os-page-atlas__legend span{display:inline-flex;align-items:center;gap:6px}.os-page-atlas__legend i{inline-size:20px;border-block-start:2px solid var( --os-ui-accent,#2271b1 )}.os-page-atlas__legend .is-link{border-color:var( --os-ui-info,#72aee6 )}.os-page-atlas__legend small{margin-inline-start:auto;font-size:inherit}.os-page-atlas__zoom{position:absolute;inset-block-end:14px;inset-inline-start:14px;z-index:3;display:flex;align-items:center;gap:3px;padding:4px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:9px;background:var( --os-ui-surface,#fff )}.os-page-atlas__zoom output{min-inline-size:42px;font-size:10px;text-align:center}.os-page-atlas__message{padding:20px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-page-atlas__refresh .dashicons{inline-size:16px;block-size:16px;font-size:16px}.os-page-atlas__browse{display:none}@container page-atlas (max-width:720px){.os-page-atlas__head{padding:12px;gap:10px}.os-page-atlas__head h2{font-size:21px}.os-page-atlas__head p{display:none}.os-page-atlas__totals{gap:12px;--os-ui-stat-value-size:19px}.os-page-atlas__totals os-stat::part(label){font-size:8px}.os-page-atlas__tools{padding:6px 12px;gap:6px}.os-page-atlas__tools os-text-field{min-inline-size:85px}.os-page-atlas__refresh{--os-ui-button-padding:6px}.os-page-atlas__refresh-label{position:absolute;inline-size:1px;block-size:1px;overflow:hidden;clip-path:inset(50%)}.os-page-atlas__tools os-select{inline-size:108px}.os-page-atlas__browse{display:block}.os-page-atlas__directory{display:none}.os-page-atlas.is-browsing .os-page-atlas__directory{display:flex;flex:1;border:0}.os-page-atlas.is-browsing .os-page-atlas__stage,.os-page-atlas.is-browsing .os-page-atlas__zoom{display:none}.os-page-atlas__legend{padding:7px 12px;gap:8px}.os-page-atlas__legend small{display:none}}`;function rn(s,e){let t=!1,o=new AbortController,i=null,a={pages:[],edges:[],total:0},n=null,r="",l="all";const c=()=>{g.classList.toggle("is-browsing")},d=k=>{n=k,g.classList.remove("is-browsing"),y(),requestAnimationFrame(()=>{t||i?.focus(k)})},p=()=>{i?.filter(l,r),y()};Z(b`<style>${an.cssText}</style><section class="os-page-atlas" aria-label=${u("Page atlas")}> | |
| 637 | 637 | <header class="os-page-atlas__head"><div><h2>${u("Your site, unfolded.")}</h2><p>${u("Real pages. Real connections. A different perspective.")}</p></div> |
| 638 | 638 | <div class="os-page-atlas__totals"><os-stat data-atlas-total value="—" label=${u("Pages")}></os-stat><os-stat data-atlas-connections value="—" label=${u("Connections")}></os-stat></div></header> |
| 639 | 639 | <div class="os-page-atlas__tools"> |
| 640 | 640 | <os-text-field id=${`${e.windowId}-atlas-search`} aria-label=${u("Find a page in the atlas")} placeholder=${u("Find a page…")} @os-input-change=${k=>{r=String(k.detail.value),p()}}></os-text-field> |