PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.12
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.12
1.1.12 1.1.11 1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 All 36 releases
← All changes | assets/js/mobile.min.js +35 -34 1.1.7 → 1.1.12 View file →
@@ -1,5 +1,5 @@
1 -(function(){"use strict";function y(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function lt(o){return!!o&&o.__wpdHtml===!0}const ct="$$wpd$$",T=/\$\$wpd\$\$(\d+)\$\$/g,dt="$$wpd-node$$",ut=/^\$\$wpd-node\$\$(\d+)\$\$$/,ht=new Set(["style","script","textarea","title"]);function pt(o){let e="",t=!1,n=null,i=!1,r=null,s="",d=!1;for(let l=0;l<o.length;l++){const a=o[l];e+=a;for(let b=0;b<a.length;b++){const f=a[b];if(i){a.startsWith("-->",b)&&(i=!1,b+=2);continue}if(r!==null){f==="<"&&a[b+1]==="/"&&a.slice(b+2,b+2+r.length).toLowerCase()===r&&(b+=1+r.length,r=null,t=!0,d=!1,s="");continue}if(n!==null){f===n&&(n=null);continue}if(t){f==='"'||f==="'"?(n=f,d=!1):f===">"?(t=!1,d=!1,ht.has(s)&&(r=s),s=""):d&&(/[a-zA-Z0-9-]/.test(f)?s+=f.toLowerCase():d=!1);continue}if(a.startsWith("<!--",b)){i=!0,b+=3;continue}const c=a[b+1]??"";f==="<"&&/[a-zA-Z/!]/.test(c)&&(t=!0,s="",d=/[a-zA-Z]/.test(c))}l<o.length-1&&(e+=t||i||r!==null?`${ct}${l}$$`:`<!--${dt}${l}$$-->`)}return e}const xe=new WeakMap;function ye(o){const e=xe.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=pt(o);const n=[],i=(d,l)=>{if(d.nodeType===Node.ELEMENT_NODE){const f=d;for(const c of Array.from(f.attributes)){const h=c.name,p=c.value,x=h[0];if(T.test(p))if(T.lastIndex=0,x==="@"){const v=T.exec(p);T.lastIndex=0,n.push({path:l,kind:"event",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else if(x==="."){const v=T.exec(p);T.lastIndex=0,n.push({path:l,kind:"prop",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else if(x==="?"){const v=T.exec(p);T.lastIndex=0,n.push({path:l,kind:"bool",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else{const v=[],A=[];let I=0,M;for(T.lastIndex=0;(M=T.exec(p))!==null;)v.push(p.slice(I,M.index)),A.push(Number(M[1])),I=M.index+M[0].length;v.push(p.slice(I)),n.push({path:l,kind:"attr",name:h,template:v,valueIndices:A}),f.setAttribute(h,"")}}}const a=Array.from(d.childNodes);let b=0;for(let f=0;f<a.length;f++){const c=a[f],h=f+b;if(c.nodeType===Node.COMMENT_NODE){const p=ut.exec(c.data);if(p){const x=document.createTextNode("");c.parentNode.replaceChild(x,c),n.push({path:[...l,h],kind:"node",valueIndex:Number(p[1])})}continue}if(c.nodeType===Node.TEXT_NODE){const p=c.textContent||"";if(!T.test(p)){T.lastIndex=0;continue}T.lastIndex=0;const x=c.parentNode;let v=0,A;const I=[],M=[];for(T.lastIndex=0;(A=T.exec(p))!==null;){A.index>v&&I.push(document.createTextNode(p.slice(v,A.index)));const L=document.createTextNode("");I.push(L),M.push({path:[...l,h+I.length-1],kind:"node",valueIndex:Number(A[1])}),v=A.index+A[0].length}v<p.length&&I.push(document.createTextNode(p.slice(v)));for(const L of I)x.insertBefore(L,c);x.removeChild(c),b+=I.length-1,n.push(...M)}else i(c,[...l,h])}};i(t.content,[]);const s={template:t,buildParts:d=>{const l=[];for(const a of n){let b=d;for(const f of a.path)b=b.childNodes[f];a.kind==="node"?l.push({kind:"node",valueIndex:a.valueIndex,child:{anchor:b,state:null}}):a.kind==="attr"?l.push({kind:"attr",element:b,name:a.name,template:a.template,valueIndices:a.valueIndices}):a.kind==="event"?l.push({kind:"event",valueIndex:a.valueIndex,element:b,name:a.name}):a.kind==="prop"?l.push({kind:"prop",valueIndex:a.valueIndex,element:b,name:a.name}):a.kind==="bool"&&l.push({kind:"bool",valueIndex:a.valueIndex,element:b,name:a.name})}return l}};return xe.set(o,s),s}const _e=new WeakMap;function mt(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function bt(o,e){const t=_e.get(e);if(t&&t.strings===o.strings&&mt(t,e)){se(t.parts,o.values);return}const n=ye(o.strings),i=n.template.content.cloneNode(!0),r=n.buildParts(i),s=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),se(r,o.values),_e.set(e,{strings:o.strings,parts:r,nodes:s})}function se(o,e){for(const t of o)if(t.kind==="node")ae(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let n=t.template[0];for(let i=0;i<t.valueIndices.length;i++)n+=ke(e[t.valueIndices[i]]),n+=t.template[i+1];n!==t.last&&(t.last=n,n===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,n))}else if(t.kind==="event"){const n=e[t.valueIndex];n!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),n&&t.element.addEventListener(t.name,n),t.current=n)}else if(t.kind==="prop"){const n=e[t.valueIndex];n!==t.last&&(t.last=n,t.element[t.name]=n)}else if(t.kind==="bool"){const n=!!e[t.valueIndex];n!==t.last&&(t.last=n,n?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function ae(o,e){if(e==null||e===!1){o.state&&(Z(o.state),o.state=null);return}if(Array.isArray(e)){xt(o,e);return}if(lt(e)){vt(o,e);return}if(e instanceof Node){ft(o,e);return}gt(o,ke(e))}function ft(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&Z(t),F(o,[e]),o.state={shape:"node",node:e})}function gt(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&Z(t);const n=document.createTextNode(e);F(o,[n]),o.state={shape:"text",node:n,text:e}}function vt(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){se(t.parts,e.values);return}t&&Z(t);const n=ye(e.strings),i=n.template.content.cloneNode(!0),r=n.buildParts(i),s=Array.from(i.childNodes);F(o,[i]),se(r,e.values),o.state={shape:"template",strings:e.strings,parts:r,nodes:s}}function xt(o,e){const t=o.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let r=0;r<i;r++)ae(t.entries[r],e[r]);if(e.length<t.entries.length){for(let r=e.length;r<t.entries.length;r++){const s=t.entries[r];s.state&&Z(s.state),s.anchor.remove()}t.entries.length=e.length}else for(let r=t.entries.length;r<e.length;r++){const s=document.createTextNode("");F(o,[s]);const d={anchor:s,state:null};ae(d,e[r]),t.entries.push(d)}return}t&&Z(t);const n=[];for(const i of e){const r=document.createTextNode("");F(o,[r]);const s={anchor:r,state:null};ae(s,i),n.push(s)}o.state={shape:"array",entries:n}}function F(o,e){const t=o.anchor.parentNode;if(t)for(const n of e)t.insertBefore(n,o.anchor)}function Z(o){if(o.shape==="text"){o.node.remove();return}if(o.shape==="template"){for(const e of o.parts)e.kind==="node"&&e.child.state&&(Z(e.child.state),e.child.state=null);for(const e of o.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(o.shape==="node"){o.node.parentNode&&o.node.parentNode.removeChild(o.node);return}for(const e of o.entries)e.state&&Z(e.state),e.anchor.remove()}function ke(o){return o==null||o===!1?"":String(o)}const j=class j 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(we)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,n){if(t===n)return;const i=yt(e);this._propValues[i]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=n.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 n=we(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(n),set:i=>{let r;i==null||i===!1?r=null:i===!0?r="":r=String(i),this._propValues[t]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&bt(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const i=document.createElement("style");i.textContent=n.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!j._lightStylesAdopted.has(e)){j._lightStylesAdopted.add(e);for(const t of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=t.cssText,document.head.appendChild(n)}}}};j.props=[],j.styles=[],j.shadow=!0,j._lightStylesAdopted=new WeakSet;let X=j;function U(o,e){customElements.get(o)||customElements.define(o,e)}function we(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function yt(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const _t=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function $(o,...e){let t=o[0];for(let n=1;n<o.length;n++){const i=e[n-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=o[n]}if(_t){const n=new CSSStyleSheet;return n.replaceSync(t),{__wpdCss:!0,sheet:n,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function kt(o){const e=[],t=[];let n=null,i=o.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const s=i.id||"";if(s.startsWith("wp-window-")){n=s.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const d=i.getAttribute("for");d&&t.unshift(d)}i=i.parentElement}n&&e.push(ue(n));for(const s of t)e.push("tab-"+ue(s));const r=o.getAttribute("label");return r&&e.push(ue(r)),e.length===0?"os-unnamed":"os-"+e.filter(s=>s!=="").join("-")}function ue(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function wt(o){if(o.id)return o.id;const e=kt(o);return o.id=e,e}const Y=$`: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 ) )}`,Et=$` .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%}}`,Ee=$` .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%}}`,Ce=$` .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}}`,Ae=$` .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}}`,Ie=$` .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}}`,Ct=$` .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%}}`,Se=$` .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}}`,Ne=$` 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}}`,At=$` input[ type='checkbox' ],input[ type='radio' ]{appearance:none;-webkit-appearance:none;position:relative;flex:0 0 auto;box-sizing:border-box;width:16px;height:16px;margin:0;padding:0;border:1px solid var( --_holo-track-edge );border-radius:4px;background-color:var( --_holo-track );background-image:none;background-repeat:no-repeat;cursor:inherit;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='radio' ]{border-radius:50%}input[ type='checkbox' ]:hover:not(:disabled ),input[ type='radio' ]:hover:not(:disabled ){border-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:focus-visible,input[ type='radio' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked,input[ type='checkbox' ]:indeterminate,input[ type='radio' ]:checked{border-color:transparent;background-color:var( --os-ui-accent,#2271b1 )}input[ type='checkbox' ]:checked:focus-visible,input[ type='radio' ]:checked:focus-visible{box-shadow:var( --_holo-focus )}input[ type='checkbox' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:46%;width:3.5px;height:7.5px;border:solid var( --os-ui-fg-on-accent,#fff );border-width:0 2px 2px 0;transform:translate( -50%,-50% ) rotate( 45deg );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:indeterminate::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:8px;height:2px;border:0;border-radius:1px;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% )}input[ type='radio' ]:checked::after{content:'';position:absolute;inset-inline-start:50%;top:50%;width:6px;height:6px;border-radius:50%;background:var( --os-ui-fg-on-accent,#fff );transform:translate( -50%,-50% );animation:os-holo-tick 180ms cubic-bezier( 0.3,1.4,0.6,1 )}input[ type='checkbox' ]:disabled,input[ type='radio' ]:disabled{cursor:not-allowed}@keyframes os-holo-tick{from{opacity:0;transform:translate( -50%,-50% ) rotate( 45deg ) scale( 0.4 )}}@media ( prefers-reduced-motion:reduce ){input[ type='checkbox' ]:checked::after,input[ type='radio' ]:checked::after{animation:none}}`,Le=$` @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}}`;$` ${Y} ${Et} ${Ee} ${Ce} ${Ae} ${Ie} ${Ct} ${Se} ${Ne} ${At} ${Le} `;const It=$` ${Y} ${Ee} ${Ce} ${Ae} ${Ie} ${Le}:host{display:inline-flex}:host( [ fill-cell ] ){display:flex;width:100%}button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var( --os-ui-button-padding,6px 12px );border-radius:var( --os-ui-button-border-radius,6px );font:inherit;font-weight:500;cursor:pointer;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,transform 80ms ease;background:var( --os-ui-button-bg,transparent );background-image:var( --os-ui-button-bg-image,none );background-repeat:var( --os-ui-button-bg-image-repeat,repeat );background-size:var( --os-ui-button-bg-image-size,auto );background-position:var( --os-ui-button-bg-image-position,center );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ fill-cell ] ) button{width:100%;min-height:var( --os-ui-button-min-height,44px )}button:disabled{opacity:0.5;cursor:not-allowed}button:active:not(:disabled ){transform:translateY( 1px )}button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before,button:disabled::after,button:disabled .os-holo-glint{opacity:0 !important}:host( [ variant='primary' ] ) button{background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-button-fg,var( --os-ui-fg-on-accent,#fff ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 );background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --_holo-glow )}:host( [ variant='holo' ] ) button{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --os-ui-button-fg,var( --_holo-ink ) );border:var( --os-ui-button-border,1px solid transparent );box-shadow:var( --_holo-glow );font-weight:600;transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease,transform 80ms ease}:host( [ variant='holo' ] ) button:hover:not(:disabled ){background-color:transparent;background-position:74% 66%;box-shadow:var( --_holo-glow-strong )}:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:88% 82%;filter:brightness( 0.94 )}:host( [ variant='holo' ] ) button::before{display:none}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ] ) button:hover:not(:disabled ),:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:22% 28%}}:host( [ variant='secondary' ] ) button{background-color:var( --os-ui-button-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='secondary' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}:host( [ variant='danger' ] ) button{background-color:var( --os-ui-button-bg,transparent );color:var( --os-ui-button-fg,var( --os-ui-danger,#d63638 ) );border:var( --os-ui-button-border,1px solid currentColor )}:host( [ variant='danger' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}:host( [ variant='danger' ] ) button::after{display:none}:host( [ variant='link' ] ) button{background-color:transparent;background-image:none;color:var( --os-ui-button-fg,var( --wp-admin-theme-color,#2271b1 ) );border:0;padding:0;text-decoration:underline}:host( [ variant='link' ] ) button::before,:host( [ variant='link' ] ) button::after,:host( [ variant='link' ] ) .os-holo-glint,:host( [ variant='link' ] ) .os-holo-ring{display:none}:host( [ variant='link' ] ) button:active:not(:disabled ){transform:none}:host( [ busy ] ) button{pointer-events:none;opacity:0.75}:host( [ variant='holo' ][ busy ] ) button{animation:os-holo-drift 12s ease-in-out infinite}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ][ busy ] ) button{animation:none}}.os-button__spinner{box-sizing:border-box;display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:os-button-spin 0.6s linear infinite;flex-shrink:0}@keyframes os-button-spin{to{transform:rotate( 360deg )}}`,Q=class Q extends X{render(){const e=this.disabled!==null,t=this.busy!==null,n=this.type||"button";return y`
1 +(function(){"use strict";function y(o,...e){return{__wpdHtml:!0,strings:o,values:e}}function lt(o){return!!o&&o.__wpdHtml===!0}const ct="$$wpd$$",T=/\$\$wpd\$\$(\d+)\$\$/g,dt="$$wpd-node$$",ut=/^\$\$wpd-node\$\$(\d+)\$\$$/,ht=new Set(["style","script","textarea","title"]);function pt(o){let e="",t=!1,n=null,i=!1,r=null,s="",d=!1;for(let a=0;a<o.length;a++){const l=o[a];e+=l;for(let m=0;m<l.length;m++){const f=l[m];if(i){l.startsWith("-->",m)&&(i=!1,m+=2);continue}if(r!==null){f==="<"&&l[m+1]==="/"&&l.slice(m+2,m+2+r.length).toLowerCase()===r&&(m+=1+r.length,r=null,t=!0,d=!1,s="");continue}if(n!==null){f===n&&(n=null);continue}if(t){f==='"'||f==="'"?(n=f,d=!1):f===">"?(t=!1,d=!1,ht.has(s)&&(r=s),s=""):d&&(/[a-zA-Z0-9-]/.test(f)?s+=f.toLowerCase():d=!1);continue}if(l.startsWith("<!--",m)){i=!0,m+=3;continue}const c=l[m+1]??"";f==="<"&&/[a-zA-Z/!]/.test(c)&&(t=!0,s="",d=/[a-zA-Z]/.test(c))}a<o.length-1&&(e+=t||i||r!==null?`${ct}${a}$$`:`<!--${dt}${a}$$-->`)}return e}const xe=new WeakMap;function ye(o){const e=xe.get(o);if(e)return e;const t=document.createElement("template");t.innerHTML=pt(o);const n=[],i=(d,a)=>{if(d.nodeType===Node.ELEMENT_NODE){const f=d;for(const c of Array.from(f.attributes)){const h=c.name,p=c.value,x=h[0];if(T.test(p))if(T.lastIndex=0,x==="@"){const v=T.exec(p);T.lastIndex=0,n.push({path:a,kind:"event",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else if(x==="."){const v=T.exec(p);T.lastIndex=0,n.push({path:a,kind:"prop",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else if(x==="?"){const v=T.exec(p);T.lastIndex=0,n.push({path:a,kind:"bool",name:h.slice(1),valueIndex:v?Number(v[1]):0}),f.removeAttribute(h)}else{const v=[],C=[];let A=0,M;for(T.lastIndex=0;(M=T.exec(p))!==null;)v.push(p.slice(A,M.index)),C.push(Number(M[1])),A=M.index+M[0].length;v.push(p.slice(A)),n.push({path:a,kind:"attr",name:h,template:v,valueIndices:C}),f.setAttribute(h,"")}}}const l=Array.from(d.childNodes);let m=0;for(let f=0;f<l.length;f++){const c=l[f],h=f+m;if(c.nodeType===Node.COMMENT_NODE){const p=ut.exec(c.data);if(p){const x=document.createTextNode("");c.parentNode.replaceChild(x,c),n.push({path:[...a,h],kind:"node",valueIndex:Number(p[1])})}continue}if(c.nodeType===Node.TEXT_NODE){const p=c.textContent||"";if(!T.test(p)){T.lastIndex=0;continue}T.lastIndex=0;const x=c.parentNode;let v=0,C;const A=[],M=[];for(T.lastIndex=0;(C=T.exec(p))!==null;){C.index>v&&A.push(document.createTextNode(p.slice(v,C.index)));const P=document.createTextNode("");A.push(P),M.push({path:[...a,h+A.length-1],kind:"node",valueIndex:Number(C[1])}),v=C.index+C[0].length}v<p.length&&A.push(document.createTextNode(p.slice(v)));for(const P of A)x.insertBefore(P,c);x.removeChild(c),m+=A.length-1,n.push(...M)}else i(c,[...a,h])}};i(t.content,[]);const s={template:t,buildParts:d=>{const a=[];for(const l of n){let m=d;for(const f of l.path)m=m.childNodes[f];l.kind==="node"?a.push({kind:"node",valueIndex:l.valueIndex,child:{anchor:m,state:null}}):l.kind==="attr"?a.push({kind:"attr",element:m,name:l.name,template:l.template,valueIndices:l.valueIndices}):l.kind==="event"?a.push({kind:"event",valueIndex:l.valueIndex,element:m,name:l.name}):l.kind==="prop"?a.push({kind:"prop",valueIndex:l.valueIndex,element:m,name:l.name}):l.kind==="bool"&&a.push({kind:"bool",valueIndex:l.valueIndex,element:m,name:l.name})}return a}};return xe.set(o,s),s}const _e=new WeakMap;function bt(o,e){for(const t of o.nodes)if(t.parentNode!==e)return!1;return!0}function mt(o,e){const t=_e.get(e);if(t&&t.strings===o.strings&&bt(t,e)){se(t.parts,o.values);return}const n=ye(o.strings),i=n.template.content.cloneNode(!0),r=n.buildParts(i),s=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),se(r,o.values),_e.set(e,{strings:o.strings,parts:r,nodes:s})}function se(o,e){for(const t of o)if(t.kind==="node")ae(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let n=t.template[0];for(let i=0;i<t.valueIndices.length;i++)n+=ke(e[t.valueIndices[i]]),n+=t.template[i+1];n!==t.last&&(t.last=n,n===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,n))}else if(t.kind==="event"){const n=e[t.valueIndex];n!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),n&&t.element.addEventListener(t.name,n),t.current=n)}else if(t.kind==="prop"){const n=e[t.valueIndex];n!==t.last&&(t.last=n,t.element[t.name]=n)}else if(t.kind==="bool"){const n=!!e[t.valueIndex];n!==t.last&&(t.last=n,n?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function ae(o,e){if(e==null||e===!1){o.state&&(Z(o.state),o.state=null);return}if(Array.isArray(e)){xt(o,e);return}if(lt(e)){vt(o,e);return}if(e instanceof Node){ft(o,e);return}gt(o,ke(e))}function ft(o,e){const t=o.state;t?.shape==="node"&&t.node===e||(t&&Z(t),F(o,[e]),o.state={shape:"node",node:e})}function gt(o,e){const t=o.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&Z(t);const n=document.createTextNode(e);F(o,[n]),o.state={shape:"text",node:n,text:e}}function vt(o,e){const t=o.state;if(t?.shape==="template"&&t.strings===e.strings){se(t.parts,e.values);return}t&&Z(t);const n=ye(e.strings),i=n.template.content.cloneNode(!0),r=n.buildParts(i),s=Array.from(i.childNodes);F(o,[i]),se(r,e.values),o.state={shape:"template",strings:e.strings,parts:r,nodes:s}}function xt(o,e){const t=o.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let r=0;r<i;r++)ae(t.entries[r],e[r]);if(e.length<t.entries.length){for(let r=e.length;r<t.entries.length;r++){const s=t.entries[r];s.state&&Z(s.state),s.anchor.remove()}t.entries.length=e.length}else for(let r=t.entries.length;r<e.length;r++){const s=document.createTextNode("");F(o,[s]);const d={anchor:s,state:null};ae(d,e[r]),t.entries.push(d)}return}t&&Z(t);const n=[];for(const i of e){const r=document.createTextNode("");F(o,[r]);const s={anchor:r,state:null};ae(s,i),n.push(s)}o.state={shape:"array",entries:n}}function F(o,e){const t=o.anchor.parentNode;if(t)for(const n of e)t.insertBefore(n,o.anchor)}function Z(o){if(o.shape==="text"){o.node.remove();return}if(o.shape==="template"){for(const e of o.parts)e.kind==="node"&&e.child.state&&(Z(e.child.state),e.child.state=null);for(const e of o.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(o.shape==="node"){o.node.parentNode&&o.node.parentNode.removeChild(o.node);return}for(const e of o.entries)e.state&&Z(e.state),e.anchor.remove()}function ke(o){return o==null||o===!1?"":String(o)}const j=class j 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(we)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,n){if(t===n)return;const i=yt(e);this._propValues[i]=n,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const n=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=n.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 n=we(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(n),set:i=>{let r;i==null||i===!1?r=null:i===!0?r="":r=String(i),this._propValues[t]=r,r===null?this.removeAttribute(n):this.setAttribute(n,r),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&mt(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(n=>n.sheet).filter(n=>n!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const n of e.styles)if(!n.sheet){const i=document.createElement("style");i.textContent=n.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!j._lightStylesAdopted.has(e)){j._lightStylesAdopted.add(e);for(const t of e.styles){const n=document.createElement("style");n.dataset.osUi=this.tagName.toLowerCase(),n.textContent=t.cssText,document.head.appendChild(n)}}}};j.props=[],j.styles=[],j.shadow=!0,j._lightStylesAdopted=new WeakSet;let X=j;function U(o,e){customElements.get(o)||customElements.define(o,e)}function we(o){return o.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function yt(o){return o.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const _t=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function $(o,...e){let t=o[0];for(let n=1;n<o.length;n++){const i=e[n-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=o[n]}if(_t){const n=new CSSStyleSheet;return n.replaceSync(t),{__wpdCss:!0,sheet:n,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function kt(o){const e=[],t=[];let n=null,i=o.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const s=i.id||"";if(s.startsWith("wp-window-")){n=s.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const d=i.getAttribute("for");d&&t.unshift(d)}i=i.parentElement}n&&e.push(ue(n));for(const s of t)e.push("tab-"+ue(s));const r=o.getAttribute("label");return r&&e.push(ue(r)),e.length===0?"os-unnamed":"os-"+e.filter(s=>s!=="").join("-")}function ue(o){return o.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function wt(o){if(o.id)return o.id;const e=kt(o);return o.id=e,e}const Y=$`: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 ) )}`,Ct=$` .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%}}`,Ce=$` .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%}}`,Ee=$` .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}}`,Ae=$` .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}}`,Ie=$` .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}}`,Et=$` .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%}}`,Se=$` .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}}`,Le=$` 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}}`,At=$` 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}}`,Ne=$` @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}}`;$` ${Y} ${Ct} ${Ce} ${Ee} ${Ae} ${Ie} ${Et} ${Se} ${Le} ${At} ${Ne} `;const It=$` ${Y} ${Ce} ${Ee} ${Ae} ${Ie} ${Ne}:host{display:inline-flex}:host( [ fill-cell ] ){display:flex;width:100%}button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:var( --os-ui-button-padding,6px 12px );border-radius:var( --os-ui-button-border-radius,6px );font:inherit;font-weight:500;cursor:pointer;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,transform 80ms ease;background:var( --os-ui-button-bg,transparent );background-image:var( --os-ui-button-bg-image,none );background-repeat:var( --os-ui-button-bg-image-repeat,repeat );background-size:var( --os-ui-button-bg-image-size,auto );background-position:var( --os-ui-button-bg-image-position,center );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ fill-cell ] ) button{width:100%;min-height:var( --os-ui-button-min-height,44px )}button:disabled{opacity:0.5;cursor:not-allowed}button:active:not(:disabled ){transform:translateY( 1px )}button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before,button:disabled::after,button:disabled .os-holo-glint{opacity:0 !important}:host( [ variant='primary' ] ) button{background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-button-fg,var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 );background-color:var( --os-ui-button-bg,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --_holo-glow )}:host( [ variant='holo' ] ) button{background-color:transparent;background-image:var( --_holo-fill );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;color:var( --os-ui-button-fg,var( --_holo-ink ) );border:var( --os-ui-button-border,1px solid transparent );box-shadow:var( --_holo-glow );font-weight:600;transition:background-position var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,filter var( --_holo-t ) ease,transform 80ms ease}:host( [ variant='holo' ] ) button:hover:not(:disabled ){background-color:transparent;background-position:74% 66%;box-shadow:var( --_holo-glow-strong )}:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:88% 82%;filter:brightness( 0.94 )}:host( [ variant='holo' ] ) button::before{display:none}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ] ) button:hover:not(:disabled ),:host( [ variant='holo' ] ) button:active:not(:disabled ){background-position:22% 28%}}:host( [ variant='secondary' ] ) button{background-color:var( --os-ui-button-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-button-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-button-border,1px solid transparent )}:host( [ variant='secondary' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-button-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}:host( [ variant='danger' ] ) button{background-color:var( --os-ui-button-bg,transparent );color:var( --os-ui-button-fg,var( --os-ui-danger,#d63638 ) );border:var( --os-ui-button-border,1px solid currentColor )}:host( [ variant='danger' ] ) button:hover:not(:disabled ){background-color:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}:host( [ variant='danger' ] ) button::after{display:none}:host( [ variant='link' ] ) button{background-color:transparent;background-image:none;color:var( --os-ui-button-fg,var( --wp-admin-theme-color,#2271b1 ) );border:0;padding:0;text-decoration:underline}:host( [ variant='link' ] ) button::before,:host( [ variant='link' ] ) button::after,:host( [ variant='link' ] ) .os-holo-glint,:host( [ variant='link' ] ) .os-holo-ring{display:none}:host( [ variant='link' ] ) button:active:not(:disabled ){transform:none}:host( [ busy ] ) button{pointer-events:none;opacity:0.75}:host( [ variant='holo' ][ busy ] ) button{animation:os-holo-drift 12s ease-in-out infinite}@media ( prefers-reduced-motion:reduce ){:host( [ variant='holo' ][ busy ] ) button{animation:none}}.os-button__spinner{box-sizing:border-box;display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:os-button-spin 0.6s linear infinite;flex-shrink:0}@keyframes os-button-spin{to{transform:rotate( 360deg )}}`,Q=class Q extends X{static get observedAttributes(){return[...super.observedAttributes,"aria-label"]}render(){const e=this.disabled!==null,t=this.busy!==null,n=this.type||"button",i=this.getAttribute("aria-label")||"";return y`
2 2 <button
3 3 part="button"
4 4 class="os-holo-edge os-holo-sheen"
5 5 type=${n}
@@ -4,8 +4,9 @@
4 4 class="os-holo-edge os-holo-sheen"
5 5 type=${n}
6 6 ?disabled=${e||t}
7 7 aria-busy=${t?"true":"false"}
8 + aria-label=${i}
8 9 >
9 10 ${t?y`<span class="os-button__spinner" aria-hidden="true"></span>`:""}
10 11 <slot></slot>
11 12 <!--
@@ -17,9 +18,9 @@
17 18 -->
18 19 <span class="os-holo-glint" aria-hidden="true"></span>
19 20 <span class="os-holo-ring" aria-hidden="true"></span>
20 21 </button>
21 - `}};Q.props=["variant","disabled","type","busy","fill-cell"],Q.styles=[It],Q.help=void 0;let he=Q;U("os-button",he);const St=$` ${Y}:host{display:none;position:fixed;inset:0;align-items:center;justify-content:center;background:var( --os-ui-scrim,rgba( 0,0,0,0.45 ) );background-image:var( --os-ui-scrim-image,none );background-repeat:var( --os-ui-scrim-image-repeat,repeat );background-size:var( --os-ui-scrim-image-size,auto );background-position:var( --os-ui-scrim-image-position,center );backdrop-filter:blur( 2px );z-index:10000}:host( [ open ] ){display:flex;animation:os-confirm-scrim var( --_holo-t ) var( --_holo-ease )}:host( [ open ] ) .dialog{animation:os-confirm-dialog var( --_holo-t ) var( --_holo-spring )}@keyframes os-confirm-scrim{from{opacity:0}}@keyframes os-confirm-dialog{from{opacity:0;transform:scale( 0.96 ) translateY( 8px )}}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ),:host( [ open ] ) .dialog{animation:none}}.dialog{width:min( 420px,92vw );background-color:var( --os-ui-confirm-dialog-bg,#1d2327 );background-image:var( --os-ui-dialog-bg-image,none );background-repeat:var( --os-ui-dialog-bg-image-repeat,repeat );background-size:var( --os-ui-dialog-bg-image-size,auto );background-position:var( --os-ui-dialog-bg-image-position,center );color:var( --os-ui-confirm-dialog-fg,var( --os-fg,#fff ) );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.08 ) );border-radius:10px;box-shadow:0 20px 50px rgba( 0,0,0,0.6 );padding:20px 22px 18px;display:flex;flex-direction:column;gap:10px;position:relative}.close{position:absolute;top:8px;right:10px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:6px;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );cursor:pointer;font-size:22px;line-height:1;padding:0}.close:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.08 ) );color:inherit}.btn:focus,.close:focus{outline:none;box-shadow:var( --_holo-focus )}.dialog:focus,.dialog:focus-visible{outline:none}.title{margin:0 0 4px;font-size:16px;font-weight:600}.message{margin:0;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );line-height:1.45;white-space:pre-line}.remember{display:flex;align-items:center;gap:8px;margin-top:4px;font-size:12px;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );cursor:pointer;user-select:none}.remember__box{margin:0;accent-color:var( --os-ui-accent,#2271b1 );cursor:pointer}.remember__box:focus,.remember__box:focus-visible{outline:none;box-shadow:var( --_holo-focus )}.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}.btn{border:0;border-radius:6px;padding:8px 14px;font-size:13px;cursor:pointer;font-weight:500}.btn--secondary{background:var( --os-ui-hover,rgba( 255,255,255,0.08 ) );color:inherit}.btn--secondary:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.14 ) )}.btn--primary{background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-fg-on-accent,#fff )}.btn--primary:hover{filter:brightness( 1.08 )}.btn--danger{background:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}.btn--danger:hover{filter:brightness( 1.08 )}`,$e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Nt(o){let e=o?.activeElement??null;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e&&e!==o?.body?e:null}function Te(o){const e=o.composedPath(),t=e.length>0?e[0]:o.target;return t instanceof HTMLElement?t:null}function Me(o){return o!==null&&o.matches($e)}const J=class J extends X{constructor(){super(...arguments),this._prevFocus=null,this._focusTries=0,this._onKey=e=>{if(e.key==="Escape"){e.preventDefault(),this._cancel();return}if(e.key==="Tab"){this._trapTab(e);return}if(e.key==="Enter"&&!e.isComposing){if(Me(Te(e))||this.hasAttribute("danger"))return;e.preventDefault(),this._confirm()}},this._focusInitial=()=>{if(!this.hasAttribute("open"))return;const e=this.isConnected?this._initialFocusTarget():null;if(e){e.focus();return}if(this._focusTries++<5){queueMicrotask(this._focusInitial);return}this.isConnected&&this.focus()},this._onBackdrop=e=>{const t=e.composedPath();(t.length>0?t[0]:e.target)===this&&this._cancel()},this._confirm=()=>{this.emit("os-confirm",{confirmed:!0,remember:this._remembered()}),this.removeAttribute("open")},this._cancel=()=>{this.emit("os-cancel",{confirmed:!1}),this.removeAttribute("open")}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.addEventListener("keydown",this._onKey),this.addEventListener("click",this._onBackdrop)}disconnectedCallback(){this.removeEventListener("keydown",this._onKey),this.removeEventListener("click",this._onBackdrop),this._restoreFocus()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="open"&&(n!==null?(this._prevFocus=Nt(this.ownerDocument),this._focusTries=0,queueMicrotask(this._focusInitial)):this._restoreFocus())}_focusables(){const e=this.shadowRoot;return e?Array.from(e.querySelectorAll($e)):[]}_trapTab(e){const t=this._focusables();if(t.length===0)return;const n=t[0],i=t[t.length-1],r=Te(e),s=!Me(r);e.shiftKey&&(s||r===n)?(e.preventDefault(),i.focus()):!e.shiftKey&&(s||r===i)&&(e.preventDefault(),n.focus())}_initialFocusTarget(){const e=this.shadowRoot;if(!e)return null;const t=e.querySelector(".btn--secondary"),n=e.querySelector(".dialog");return this.hasAttribute("danger")?t??e.querySelector(".close")??n:e.querySelector(".btn--primary, .btn--danger")??t??n}_restoreFocus(){const e=this._prevFocus;this._prevFocus=null,!(!e||!e.isConnected)&&e.focus()}_remembered(){return this.shadowRoot?.querySelector(".remember__box")?.checked===!0}render(){const e=this.title??"",t=this.message??"",n=this["confirm-label"]||"Confirm",i=this["cancel-label"]||"Cancel",r=this.hasAttribute("danger"),s=this.hasAttribute("hide-cancel"),d=this.hasAttribute("dismissable"),l=this["remember-label"]??"";return y`
22 + `}};Q.props=["variant","disabled","type","busy","fill-cell"],Q.styles=[It],Q.help=void 0;let he=Q;U("os-button",he);const St=$` ${Y}:host{display:none;position:fixed;inset:0;align-items:center;justify-content:center;background:var( --os-ui-scrim,rgba( 0,0,0,0.45 ) );background-image:var( --os-ui-scrim-image,none );background-repeat:var( --os-ui-scrim-image-repeat,repeat );background-size:var( --os-ui-scrim-image-size,auto );background-position:var( --os-ui-scrim-image-position,center );backdrop-filter:blur( 2px );z-index:10000}:host( [ open ] ){display:flex;animation:os-confirm-scrim var( --_holo-t ) var( --_holo-ease )}:host( [ open ] ) .dialog{animation:os-confirm-dialog var( --_holo-t ) var( --_holo-spring )}@keyframes os-confirm-scrim{from{opacity:0}}@keyframes os-confirm-dialog{from{opacity:0;transform:scale( 0.96 ) translateY( 8px )}}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ),:host( [ open ] ) .dialog{animation:none}}.dialog{width:min( 420px,92vw );background-color:var( --os-ui-confirm-dialog-bg,#1d2327 );background-image:var( --os-ui-dialog-bg-image,none );background-repeat:var( --os-ui-dialog-bg-image-repeat,repeat );background-size:var( --os-ui-dialog-bg-image-size,auto );background-position:var( --os-ui-dialog-bg-image-position,center );color:var( --os-ui-confirm-dialog-fg,var( --os-fg,#fff ) );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.08 ) );border-radius:10px;box-shadow:0 20px 50px rgba( 0,0,0,0.6 );padding:20px 22px 18px;display:flex;flex-direction:column;gap:10px;position:relative}.close{position:absolute;top:8px;right:10px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;border-radius:6px;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );cursor:pointer;font-size:22px;line-height:1;padding:0}.close:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.08 ) );color:inherit}.btn:focus,.close:focus{outline:none;box-shadow:var( --_holo-focus )}.dialog:focus,.dialog:focus-visible{outline:none}.title{margin:0 0 4px;font-size:16px;font-weight:600}.message{margin:0;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );line-height:1.45;white-space:pre-line}.remember{display:flex;align-items:center;gap:8px;margin-top:4px;font-size:12px;color:var( --os-ui-confirm-dialog-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) ) );cursor:pointer;user-select:none}.remember__box{margin:0;accent-color:var( --os-ui-accent,#2271b1 );cursor:pointer}.remember__box:focus,.remember__box:focus-visible{outline:none;box-shadow:var( --_holo-focus )}.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:6px}.btn{border:0;border-radius:6px;padding:8px 14px;font-size:13px;cursor:pointer;font-weight:500}.btn--secondary{background:var( --os-ui-hover,rgba( 255,255,255,0.08 ) );color:inherit}.btn--secondary:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.14 ) )}.btn--primary{background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.btn--primary:hover{filter:brightness( 1.08 )}.btn--danger{background:var( --os-ui-danger,#d63638 );color:var( --os-ui-fg-on-accent,#fff )}.btn--danger:hover{filter:brightness( 1.08 )}`,$e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function Lt(o){let e=o?.activeElement??null;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e&&e!==o?.body?e:null}function Me(o){const e=o.composedPath(),t=e.length>0?e[0]:o.target;return t instanceof HTMLElement?t:null}function Te(o){return o!==null&&o.matches($e)}const J=class J extends X{constructor(){super(...arguments),this._prevFocus=null,this._focusTries=0,this._onKey=e=>{if(e.key==="Escape"){e.preventDefault(),this._cancel();return}if(e.key==="Tab"){this._trapTab(e);return}if(e.key==="Enter"&&!e.isComposing){if(Te(Me(e))||this.hasAttribute("danger"))return;e.preventDefault(),this._confirm()}},this._focusInitial=()=>{if(!this.hasAttribute("open"))return;const e=this.isConnected?this._initialFocusTarget():null;if(e){e.focus();return}if(this._focusTries++<5){queueMicrotask(this._focusInitial);return}this.isConnected&&this.focus()},this._onBackdrop=e=>{const t=e.composedPath();(t.length>0?t[0]:e.target)===this&&this._cancel()},this._confirm=()=>{this.emit("os-confirm",{confirmed:!0,remember:this._remembered()}),this.removeAttribute("open")},this._cancel=()=>{this.emit("os-cancel",{confirmed:!1}),this.removeAttribute("open")}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","-1"),this.addEventListener("keydown",this._onKey),this.addEventListener("click",this._onBackdrop)}disconnectedCallback(){this.removeEventListener("keydown",this._onKey),this.removeEventListener("click",this._onBackdrop),this._restoreFocus()}attributeChangedCallback(e,t,n){super.attributeChangedCallback(e,t,n),e==="open"&&(n!==null?(this._prevFocus=Lt(this.ownerDocument),this._focusTries=0,queueMicrotask(this._focusInitial)):this._restoreFocus())}_focusables(){const e=this.shadowRoot;return e?Array.from(e.querySelectorAll($e)):[]}_trapTab(e){const t=this._focusables();if(t.length===0)return;const n=t[0],i=t[t.length-1],r=Me(e),s=!Te(r);e.shiftKey&&(s||r===n)?(e.preventDefault(),i.focus()):!e.shiftKey&&(s||r===i)&&(e.preventDefault(),n.focus())}_initialFocusTarget(){const e=this.shadowRoot;if(!e)return null;const t=e.querySelector(".btn--secondary"),n=e.querySelector(".dialog");return this.hasAttribute("danger")?t??e.querySelector(".close")??n:e.querySelector(".btn--primary, .btn--danger")??t??n}_restoreFocus(){const e=this._prevFocus;this._prevFocus=null,!(!e||!e.isConnected)&&e.focus()}_remembered(){return this.shadowRoot?.querySelector(".remember__box")?.checked===!0}render(){const e=this.title??"",t=this.message??"",n=this["confirm-label"]||"Confirm",i=this["cancel-label"]||"Cancel",r=this.hasAttribute("danger"),s=this.hasAttribute("hide-cancel"),d=this.hasAttribute("dismissable"),a=this["remember-label"]??"";return y`
22 23 <div class="dialog" tabindex="-1">
23 24 ${d?y`<button
24 25 type="button"
25 26 class="close"
@@ -27,11 +28,11 @@
27 28 @click=${()=>this._cancel()}
28 29 >&times;</button>`:y``}
29 30 ${e?y`<h2 class="title">${e}</h2>`:y``}
30 31 ${t?y`<p class="message">${t}</p>`:y``}
31 - ${l?y`<label class="remember">
32 + ${a?y`<label class="remember">
32 33 <input type="checkbox" class="remember__box" />
33 - <span class="remember__label">${l}</span>
34 + <span class="remember__label">${a}</span>
34 35 </label>`:y``}
35 36 <div class="actions">
36 37 ${s?y``:y`<button
37 38 type="button"
@@ -48,16 +49,16 @@
48 49 ${n}
49 50 </button>
50 51 </div>
51 52 </div>
52 - `}};J.props=["open","title","message","confirm-label","cancel-label","danger","hide-cancel","dismissable","remember-label"],J.styles=[St],J.help=void 0;let pe=J;U("os-confirm-dialog",pe);function Lt(o){return new Promise(e=>{const t=document.createElement("os-confirm-dialog");t.setAttribute("open",""),o.title&&t.setAttribute("title",o.title),t.setAttribute("message",o.message),o.confirmLabel&&t.setAttribute("confirm-label",o.confirmLabel),o.cancelLabel&&t.setAttribute("cancel-label",o.cancelLabel),o.danger&&t.setAttribute("danger",""),o.hideCancel&&t.setAttribute("hide-cancel",""),o.dismissable&&t.setAttribute("dismissable",""),o.rememberLabel&&t.setAttribute("remember-label",o.rememberLabel);const n=i=>{t.remove(),e(i)};t.addEventListener("os-confirm",i=>{o.onRemember?.(i.detail?.remember===!0),n(!0)}),t.addEventListener("os-cancel",()=>n(!1)),document.body.appendChild(t)})}const $t=$` ${Y} ${Se}:host{display:none;position:fixed;min-width:180px;background-color:var( --os-ui-context-menu-bg,#1d2327 );background-image:var( --os-ui-menu-bg-image,none );background-repeat:var( --os-ui-menu-bg-image-repeat,repeat );background-size:var( --os-ui-menu-bg-image-size,auto );background-position:var( --os-ui-menu-bg-image-position,center );color:var( --os-ui-context-menu-fg,var( --os-fg,#fff ) );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.08 ) );border-radius:8px;box-shadow:0 8px 24px rgba( 0,0,0,0.45 );padding:4px;font-size:13px;line-height:1.3;z-index:9999}:host( [ open ] ){display:block;animation:os-holo-enter var( --_holo-t-fast ) var( --_holo-ease );transform-origin:top left;box-sizing:border-box;max-block-size:calc( 100vh - 16px );max-block-size:calc( 100dvh - 16px );overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}:host( [ open ]:dir( rtl ) ){transform-origin:top right}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ){animation:none}}`,Tt=$`:host{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:transparent;color:inherit;text-align:start;cursor:pointer;border-radius:4px;box-sizing:border-box;user-select:none}:host(:hover ),:host( [ active ] ){background:var( --os-ui-hover,rgba( 255,255,255,0.1 ) );outline:none}:host( [ disabled ] ){opacity:0.45;cursor:not-allowed}:host( [ danger ] ){color:var( --os-ui-danger-hover,#ff8a8a )}:host( [ danger ]:hover ){background:var( --os-ui-badge-danger-bg,rgba( 255,90,90,0.18 ) )}:host( [ heading ] ){padding:8px 10px 4px;font-size:10px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-context-menu-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.5 ) ) );pointer-events:none}.icon{display:inline-flex;align-items:center;justify-content:center;font-size:18px;width:20px;height:20px}.label{flex:1}.chevron{margin-inline-start:auto;padding-inline-start:8px;font-size:16px;line-height:1;opacity:0.7}.check{display:inline-flex;align-items:center;justify-content:center;width:14px;font-size:13px;line-height:1;opacity:0.95}`,ee=class ee extends X{render(){return y`
53 + `}};J.props=["open","title","message","confirm-label","cancel-label","danger","hide-cancel","dismissable","remember-label"],J.styles=[St],J.help=void 0;let pe=J;U("os-confirm-dialog",pe);function Nt(o){return new Promise(e=>{const t=document.createElement("os-confirm-dialog");t.setAttribute("open",""),o.title&&t.setAttribute("title",o.title),t.setAttribute("message",o.message),o.confirmLabel&&t.setAttribute("confirm-label",o.confirmLabel),o.cancelLabel&&t.setAttribute("cancel-label",o.cancelLabel),o.danger&&t.setAttribute("danger",""),o.hideCancel&&t.setAttribute("hide-cancel",""),o.dismissable&&t.setAttribute("dismissable",""),o.rememberLabel&&t.setAttribute("remember-label",o.rememberLabel);const n=i=>{t.remove(),e(i)};t.addEventListener("os-confirm",i=>{o.onRemember?.(i.detail?.remember===!0),n(!0)}),t.addEventListener("os-cancel",()=>n(!1)),document.body.appendChild(t)})}const $t=$` ${Y} ${Se}:host{display:none;position:fixed;min-width:180px;background-color:var( --os-ui-context-menu-bg,#1d2327 );background-image:var( --os-ui-menu-bg-image,none );background-repeat:var( --os-ui-menu-bg-image-repeat,repeat );background-size:var( --os-ui-menu-bg-image-size,auto );background-position:var( --os-ui-menu-bg-image-position,center );color:var( --os-ui-context-menu-fg,var( --os-fg,#fff ) );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.08 ) );border-radius:8px;box-shadow:0 8px 24px rgba( 0,0,0,0.45 );padding:4px;font-size:13px;line-height:1.3;z-index:9999}:host( [ open ] ){display:block;animation:os-holo-enter var( --_holo-t-fast ) var( --_holo-ease );transform-origin:top left;box-sizing:border-box;max-block-size:calc( 100vh - 16px );max-block-size:calc( 100dvh - 16px );overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}:host( [ open ]:dir( rtl ) ){transform-origin:top right}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ){animation:none}}`,Mt=$`:host{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;background:transparent;color:inherit;text-align:start;cursor:pointer;border-radius:4px;box-sizing:border-box;user-select:none}:host(:hover ),:host( [ active ] ){background:var( --os-ui-hover,rgba( 255,255,255,0.1 ) );outline:none}:host( [ disabled ] ){opacity:0.45;cursor:not-allowed}:host( [ danger ] ){color:var( --os-ui-danger-hover,#ff8a8a )}:host( [ danger ]:hover ){background:var( --os-ui-badge-danger-bg,rgba( 255,90,90,0.18 ) )}:host( [ heading ] ){padding:8px 10px 4px;font-size:10px;font-weight:700;letter-spacing:0.06em;text-transform:uppercase;color:var( --os-ui-context-menu-fg-muted,var( --os-ui-fg-muted,rgba( 255,255,255,0.5 ) ) );pointer-events:none}.icon{display:inline-flex;align-items:center;justify-content:center;font-size:18px;width:20px;height:20px}.label{flex:1}.chevron{margin-inline-start:auto;padding-inline-start:8px;font-size:16px;line-height:1;opacity:0.7}.check{display:inline-flex;align-items:center;justify-content:center;width:14px;font-size:13px;line-height:1;opacity:0.95}`,ee=class ee extends X{render(){return y`
53 54 <slot></slot>
54 - `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};ee.props=["open"],ee.styles=[$t],ee.help=void 0;let me=ee;U("os-context-menu",me);const te=class te extends X{constructor(){super(...arguments),this._onActivate=e=>{if(this.hasAttribute("disabled")||this.hasAttribute("heading"))return;const t=e.target;t&&t!==this&&t.closest("os-context-menu-option")!==this||this.emit("os-context-menu-pick",{id:this.dataset.menuItemId??this.id??"",value:this.getAttribute("value")??""})},this._onKey=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._onActivate(e))}}connectedCallback(){super.connectedCallback();const e=this.hasAttribute("heading");this.setAttribute("role",e?"presentation":"menuitem"),e||this.setAttribute("tabindex","0"),this.addEventListener("click",this._onActivate),this.addEventListener("keydown",this._onKey)}disconnectedCallback(){this.removeEventListener("click",this._onActivate),this.removeEventListener("keydown",this._onKey)}render(){const e=this.getAttribute("icon"),t=this.hasAttribute("has-children"),n=this.hasAttribute("checked");return y`
55 + `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};ee.props=["open"],ee.styles=[$t],ee.help=void 0;let be=ee;U("os-context-menu",be);const te=class te extends X{constructor(){super(...arguments),this._onActivate=e=>{if(this.hasAttribute("disabled")||this.hasAttribute("heading"))return;const t=e.target;t&&t!==this&&t.closest("os-context-menu-option")!==this||this.emit("os-context-menu-pick",{id:this.dataset.menuItemId??this.id??"",value:this.getAttribute("value")??""})},this._onKey=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._onActivate(e))}}connectedCallback(){super.connectedCallback();const e=this.hasAttribute("heading");this.setAttribute("role",e?"presentation":"menuitem"),e||this.setAttribute("tabindex","0"),this.addEventListener("click",this._onActivate),this.addEventListener("keydown",this._onKey)}disconnectedCallback(){this.removeEventListener("click",this._onActivate),this.removeEventListener("keydown",this._onKey)}render(){const e=this.getAttribute("icon"),t=this.hasAttribute("has-children"),n=this.hasAttribute("checked");return y`
55 56 ${n?y`<span class="check" aria-hidden="true">✓</span>`:y``}
56 57 ${e?y`<span class="icon dashicons ${e}" aria-hidden="true"></span>`:y``}
57 58 <span class="label"><slot></slot></span>
58 59 ${t?y`<span class="chevron" aria-hidden="true">›</span>`:y``}
59 - `}};te.props=["value","icon","disabled","danger","heading","has-children","checked"],te.styles=[Tt],te.help={title:"Context menu option",summary:"Single row inside <os-context-menu>. Use `icon` for a leading dashicon, `danger` for destructive items, `heading` for a non-interactive section header, `has-children` to render a trailing chevron.",status:"stable",props:[{name:"value",type:"string",description:"Forwarded as `detail.value` on activation."},{name:"icon",type:"string",description:"Dashicon class (e.g. `dashicons-trash`)."},{name:"disabled",type:"boolean attribute",description:"Renders the option dimmed; clicks are ignored."},{name:"danger",type:"boolean attribute",description:"Destructive styling — red text, red hover."},{name:"heading",type:"boolean attribute",description:"Non-interactive section header. Ignores clicks."},{name:"has-children",type:"boolean attribute",description:"Renders a trailing chevron to suggest a submenu."},{name:"checked",type:"boolean attribute",description:"Renders a leading check mark — for radio-style picks inside a submenu (e.g. the active Sort By order)."}],slots:[{name:"(default)",description:"Visible label."}],events:[{name:"os-context-menu-pick",description:"Bubbled on click / Enter for non-heading non-disabled options. Detail: `{ id, value }`."}],example:y`
60 + `}};te.props=["value","icon","disabled","danger","heading","has-children","checked"],te.styles=[Mt],te.help={title:"Context menu option",summary:"Single row inside <os-context-menu>. Use `icon` for a leading dashicon, `danger` for destructive items, `heading` for a non-interactive section header, `has-children` to render a trailing chevron.",status:"stable",props:[{name:"value",type:"string",description:"Forwarded as `detail.value` on activation."},{name:"icon",type:"string",description:"Dashicon class (e.g. `dashicons-trash`)."},{name:"disabled",type:"boolean attribute",description:"Renders the option dimmed; clicks are ignored."},{name:"danger",type:"boolean attribute",description:"Destructive styling — red text, red hover."},{name:"heading",type:"boolean attribute",description:"Non-interactive section header. Ignores clicks."},{name:"has-children",type:"boolean attribute",description:"Renders a trailing chevron to suggest a submenu."},{name:"checked",type:"boolean attribute",description:"Renders a leading check mark — for radio-style picks inside a submenu (e.g. the active Sort By order)."}],slots:[{name:"(default)",description:"Visible label."}],events:[{name:"os-context-menu-pick",description:"Bubbled on click / Enter for non-heading non-disabled options. Detail: `{ id, value }`."}],example:y`
60 61 <os-context-menu open style="position: relative; z-index: 0">
61 62 <os-context-menu-option heading>Every variant</os-context-menu-option>
62 63 <os-context-menu-option value="plain">Plain</os-context-menu-option>
63 64 <os-context-menu-option value="icon" icon="dashicons-admin-page">
@@ -73,36 +74,36 @@
73 74 <os-context-menu-option value="del" danger icon="dashicons-trash">
74 75 Danger
75 76 </os-context-menu-option>
76 77 </os-context-menu>
77 - `};let be=te;U("os-context-menu-option",be);const Mt=$` ${Y} ${Ne}:host{--_field-size:var( --os-ui-field-font-size,13px );--_field-radius:var( --os-ui-field-radius,6px );display:flex;flex-direction:column;gap:4px;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-text-field__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-text-field__row{position:relative;display:flex;align-items:center;width:100%}input{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:7px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:var( --_field-radius );font:inherit;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 )}.os-text-field__suffix{position:absolute;inset-inline-end:10px;top:50%;transform:translateY( -50% );pointer-events:none;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-text-field__row--has-reveal input{padding-inline-end:36px}.os-text-field__row--has-clear input{padding-inline-end:36px}.os-text-field__row--has-reveal.os-text-field__row--has-clear input{padding-inline-end:68px}.os-text-field__clear{position:absolute;inset-inline-end:0;top:0;bottom:0;width:34px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:0 6px 6px 0}.os-text-field__row--has-reveal .os-text-field__clear{inset-inline-end:34px;border-radius:0}.os-text-field__clear:hover{color:var( --os-ui-accent,#2271b1 )}.os-text-field__clear:focus-visible{outline:none;color:var( --os-ui-accent,#2271b1 );box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.os-text-field__clear:disabled{opacity:0.45;cursor:default}.os-text-field__reveal{position:absolute;inset-inline-end:0;top:0;bottom:0;width:34px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:0 6px 6px 0;transition:color 0.12s ease}.os-text-field__reveal:hover{color:var( --os-ui-accent,#2271b1 )}.os-text-field__reveal:focus-visible{outline:none;color:var( --os-ui-accent,#2271b1 );box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 );border-radius:0 6px 6px 0}.os-text-field__reveal:disabled{opacity:0.45;cursor:not-allowed}.os-text-field__input--masked{-webkit-text-security:disc;text-security:disc}@supports not ( ( -webkit-text-security:disc ) or ( text-security:disc ) ){.os-text-field__input--masked{font-family:text-security-disc,"password",monospace;letter-spacing:0.2em}}input:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}input[ aria-invalid='true' ],input[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}input[ aria-invalid='true' ]:focus,input[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}input[ type='number' ]::-webkit-inner-spin-button,input[ type='number' ]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[ type='number' ]{-moz-appearance:textfield}`,oe=class oe extends X{constructor(){super(...arguments),this._revealed=!1}connectedCallback(){super.connectedCallback(),wt(this)}render(){const e=this.label||"",t=this.value??"",n=this.placeholder||"",i=this.disabled!==null,r=this.readonly!==null,s=this.autocomplete,d=this.type||"text",l=d==="password";let a=s||"off";l&&(!s||a==="off")&&(a="new-password");const b=this.maxlength,f=this.minlength,c=this.pattern||"",h=this.name||"",p=this.suffix||"",x=this.invalid!==null,v=this.reveal!==null,A=this.clearable!==null,I=d==="password",M=I&&!(v&&this._revealed);let L;I||v&&this._revealed?L="text":L=d;const m=["os-text-field__row",v?"os-text-field__row--has-reveal":"",A?"os-text-field__row--has-clear":""].filter(Boolean).join(" "),_=M?"os-text-field__input os-text-field__input--masked":"os-text-field__input",N=`${this.id||"os-unnamed"}__input`;return y`
78 + `};let me=te;U("os-context-menu-option",me);const Tt=$` ${Y} ${Le}:host{--_field-size:var( --os-ui-field-font-size,13px );--_field-radius:var( --os-ui-field-radius,6px );display:flex;flex-direction:column;gap:4px;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-text-field__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-text-field__label--hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;white-space:nowrap;clip-path:inset( 50% )}.os-text-field__row{position:relative;display:flex;align-items:center;width:100%}input{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:7px 10px;background:var( --os-window-bg,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:var( --_field-radius );font:inherit;font-size:var( --_field-size );color:var( --os-ui-fg,#1d2327 )}input:is( [ type='date' ],[ type='datetime-local' ],[ type='month' ],[ type='week' ] )::-webkit-calendar-picker-indicator{--_calendar-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='1.5'%3E%3Cpath d='M4.75 7.25L4.75 18C4.75 18.6904 5.30964 19.25 6 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V7.25V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V7.25ZM19.25 7.25H4.75M7.25 10.75H9.25M11 10.75H13M14.75 10.75H16.75M7.25 14.5H9.25M11 14.5H13M14.75 14.5H16.75' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V7.25H19.25V6C19.25 5.30964 18.6904 4.75 18 4.75Z' fill='currentColor' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");background:var( --os-ui-fg-muted,#646970 );-webkit-mask:var( --_calendar-icon ) center / contain no-repeat;mask:var( --_calendar-icon ) center / contain no-repeat;width:16px;height:16px;cursor:pointer}@media ( forced-colors:active ){input:is( [ type='date' ],[ type='datetime-local' ],[ type='month' ],[ type='week' ] )::-webkit-calendar-picker-indicator{background:ButtonText;forced-color-adjust:none}}.os-text-field__suffix{position:absolute;inset-inline-end:10px;top:50%;transform:translateY( -50% );pointer-events:none;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-text-field__row--has-reveal input{padding-inline-end:36px}:host( [ clearable ] ) input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.os-text-field__row--has-clear input{padding-inline-end:36px}.os-text-field__row--has-reveal.os-text-field__row--has-clear input{padding-inline-end:68px}.os-text-field__clear{position:absolute;inset-inline-end:0;top:0;bottom:0;width:34px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:0 6px 6px 0}.os-text-field__row--has-reveal .os-text-field__clear{inset-inline-end:34px;border-radius:0}.os-text-field__clear:hover{color:var( --os-ui-accent,#2271b1 )}.os-text-field__clear:focus-visible{outline:none;color:var( --os-ui-accent,#2271b1 );box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.os-text-field__clear:disabled{opacity:0.45;cursor:default}.os-text-field__reveal{position:absolute;inset-inline-end:0;top:0;bottom:0;width:34px;display:flex;align-items:center;justify-content:center;padding:0;border:none;background:transparent;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:0 6px 6px 0;transition:color 0.12s ease}.os-text-field__reveal:hover{color:var( --os-ui-accent,#2271b1 )}.os-text-field__reveal:focus-visible{outline:none;color:var( --os-ui-accent,#2271b1 );box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 );border-radius:0 6px 6px 0}.os-text-field__reveal:disabled{opacity:0.45;cursor:not-allowed}.os-text-field__input--masked{-webkit-text-security:disc;text-security:disc}@supports not ( ( -webkit-text-security:disc ) or ( text-security:disc ) ){.os-text-field__input--masked{font-family:text-security-disc,"password",monospace;letter-spacing:0.2em}}input:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}input[ aria-invalid='true' ],input[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}input[ aria-invalid='true' ]:focus,input[ aria-invalid='true' ]:focus-visible{border-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px var( --os-ui-danger,#d63638 ),0 0 0 4px rgba( 214,54,56,0.18 )}input[ type='number' ]::-webkit-inner-spin-button,input[ type='number' ]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[ type='number' ]{-moz-appearance:textfield}`,oe=class oe extends X{constructor(){super(...arguments),this._revealed=!1}connectedCallback(){super.connectedCallback(),wt(this)}render(){const e=this.label||"",t=this.hideLabel!==null,n=this.value??"",i=this.placeholder||"",r=this.disabled!==null,s=this.readonly!==null,d=this.autocomplete,a=this.type||"text",l=a==="password";let m=d||"off";l&&(!d||m==="off")&&(m="new-password");const f=this.maxlength,c=this.minlength,h=this.pattern||"",p=this.name||"",x=this.suffix||"",v=this.invalid!==null,C=this.reveal!==null,A=this.clearable!==null,M=a==="password",P=M&&!(C&&this._revealed);let b;M||C&&this._revealed?b="text":b=a;const _=["os-text-field__row",C?"os-text-field__row--has-reveal":"",A?"os-text-field__row--has-clear":""].filter(Boolean).join(" "),w=P?"os-text-field__input os-text-field__input--masked":"os-text-field__input",S=`${this.id||"os-unnamed"}__input`;return y`
78 79 ${e?y`<label
79 - class="os-text-field__label"
80 - for=${N}
80 + class=${t?"os-text-field__label os-text-field__label--hidden":"os-text-field__label"}
81 + for=${S}
81 82 >${e}</label>`:y``}
82 - <span class=${m}>
83 + <span class=${_}>
83 84 <input
84 - id=${N}
85 - class=${_}
86 - type=${L}
87 - .value=${t}
88 - placeholder=${n}
89 - ?disabled=${i}
90 - ?readonly=${r}
91 - autocomplete=${a}
92 - maxlength=${b??""}
93 - minlength=${f??""}
94 - pattern=${c}
95 - name=${h}
96 - aria-invalid=${x?"true":"false"}
85 + id=${S}
86 + class=${w}
87 + type=${b}
88 + .value=${n}
89 + placeholder=${i}
90 + ?disabled=${r}
91 + ?readonly=${s}
92 + autocomplete=${m}
93 + maxlength=${f??""}
94 + minlength=${c??""}
95 + pattern=${h}
96 + name=${p}
97 + aria-invalid=${v?"true":"false"}
97 98 aria-label=${e||""}
98 - @input=${E=>this._onInput(E)}
99 - @change=${E=>this._onChange(E)}
100 - @keydown=${E=>this._onKeyDown(E)}
99 + @input=${N=>this._onInput(N)}
100 + @change=${N=>this._onChange(N)}
101 + @keydown=${N=>this._onKeyDown(N)}
101 102 />
102 - ${p?y`<span class="os-text-field__suffix">${p}</span>`:y``}
103 - ${A&&t!==""?this._renderClearButton(i):y``}
104 - ${v?this._renderRevealButton(i):y``}
103 + ${x?y`<span class="os-text-field__suffix">${x}</span>`:y``}
104 + ${A&&n!==""?this._renderClearButton(r):y``}
105 + ${C?this._renderRevealButton(r):y``}
105 106 </span>
106 107 `}_renderClearButton(e){return y`
107 108 <button
108 109 type="button"
@@ -123,11 +124,11 @@
123 124 ?disabled=${e}
124 125 tabindex="0"
125 126 @click=${()=>this._onToggleReveal()}
126 127 >
127 - ${this._revealed?Rt():zt()}
128 + ${this._revealed?Ht():zt()}
128 129 </button>
129 - `}_onToggleReveal(){this._revealed=!this._revealed,this.requestUpdate()}_onInput(e){const t=e.target;this.value=t.value,this.emit("os-input-change",{value:t.value})}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey){const t=e.target;this.emit("os-submit",{value:t.value})}}};oe.props=["label","value","placeholder","disabled","readonly","autocomplete","type","maxlength","minlength","pattern","name","suffix","invalid","reveal","clearable"],oe.styles=[Mt],oe.help=void 0;let fe=oe;U("os-text-field",fe);function Pt(){return y`
130 + `}_onToggleReveal(){this._revealed=!this._revealed,this.requestUpdate()}_onInput(e){const t=e.target;this.value=t.value,this.emit("os-input-change",{value:t.value})}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey){const t=e.target;this.emit("os-submit",{value:t.value})}}};oe.props=["label","hideLabel","value","placeholder","disabled","readonly","autocomplete","type","maxlength","minlength","pattern","name","suffix","invalid","reveal","clearable"],oe.styles=[Tt],oe.help=void 0;let fe=oe;U("os-text-field",fe);function Pt(){return y`
130 131 <svg
131 132 viewBox="0 0 16 16"
132 133 width="14"
133 134 height="14"
@@ -155,9 +156,9 @@
155 156 >
156 157 <path d="M1 8C1 8 3.5 3 8 3s7 5 7 5-2.5 5-7 5S1 8 1 8z" />
157 158 <circle cx="8" cy="8" r="2" />
158 159 </svg>
159 - `}function Rt(){return y`
160 + `}function Ht(){return y`
160 161 <svg
161 162 viewBox="0 0 16 16"
162 163 width="14"
163 164 height="14"
@@ -172,5 +173,5 @@
172 173 <path d="M1 8C1 8 3.5 3 8 3s7 5 7 5-2.5 5-7 5S1 8 1 8z" />
173 174 <circle cx="8" cy="8" r="2" />
174 175 <line x1="2" y1="2" x2="14" y2="14" />
175 176 </svg>
176 - `}function Pe(){const o=window.wp?.hooks;if(!o)throw new Error("[openstation] `window.wp.hooks` is not available. The plugin declares `wp-hooks` as a script dependency; if you are seeing this error, verify the enqueue order.");return o}function Ht(o,e,t,n){Pe().addAction(o,e,t,n)}function Dt(o,e){return Pe().removeAction(o,e)}const le={WINDOW_MINIMIZED:"os.window.minimized",WINDOW_RESTORED:"os.window.restored",WINDOW_TITLE_CHANGED:"os.window.title-changed",DESKTOP_SWITCHED:"os.os.switched"},Vt="desktop-mode";function ze(){return window.wp?.i18n}function C(o,e=Vt){return ze()?.__(o,e)??o}function Re(o,...e){const t=ze()?.sprintf;if(t)return t(o,...e);let n=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(i,r)=>{const s=r?Number.parseInt(r,10)-1:n++;return String(e[s]??"")})}const Ot=.35,Wt=.6,Bt=24,He=10,De=64,qt=44;function Zt(o){const{dx:e,dy:t,velocity:n,width:i}=o,r=Math.abs(e);return r<=Math.abs(t)?"cancel":i>0&&r>=i*Ot||Math.abs(n)>=Wt&&r>=Bt&&Math.sign(n)===Math.sign(e)?"commit":"cancel"}function Ve(o,e=De){return e<=0?o>0?1:0:Math.min(1,Math.max(0,o/e))}function jt(o,e){const t=e.threshold??De;let n=null,i=0,r=0,s=!1;const d=()=>{n=null,s=!1,e.onProgress?.(0)},l=c=>{if(!(n!==null||!c.isPrimary)){n=c.pointerId,i=c.clientX,r=c.clientY,s=!1;try{o.setPointerCapture(c.pointerId)}catch{}c.preventDefault()}},a=c=>{if(c.pointerId!==n||s)return;const h=c.clientX-i,p=c.clientY-r;if(Math.abs(p)>He&&Math.abs(p)>Math.abs(h)){s=!0,e.onProgress?.(0);return}e.onProgress?.(Ve(h,t))},b=c=>{if(c.pointerId!==n)return;const h=!s&&Ve(c.clientX-i,t)>=1;d(),h&&e.onCommit()},f=c=>{c.pointerId===n&&d()};return o.addEventListener("pointerdown",l),o.addEventListener("pointermove",a),o.addEventListener("pointerup",b),o.addEventListener("pointercancel",f),()=>{o.removeEventListener("pointerdown",l),o.removeEventListener("pointermove",a),o.removeEventListener("pointerup",b),o.removeEventListener("pointercancel",f)}}function Oe(o){const e=t=>{t.cancelable&&t.preventDefault()};return o.addEventListener("touchstart",e,{passive:!1}),()=>{o.removeEventListener("touchstart",e)}}function Xt(o,e){return We(o,"up",e)}function Kt(o,e){return We(o,"down",e)}function We(o,e,t){const n=t.threshold??qt,i=e==="up"?1:-1;let r=null,s=0,d=0,l=!1;const a=()=>{const h=p=>{p.stopPropagation(),p.preventDefault()};o.addEventListener("click",h,{capture:!0,once:!0}),setTimeout(()=>o.removeEventListener("click",h,{capture:!0}),350)},b=h=>{r!==null||!h.isPrimary||h.pointerType==="mouse"||(r=h.pointerId,s=h.clientX,d=h.clientY,l=!1)},f=h=>{if(h.pointerId!==r||l)return;const p=(d-h.clientY)*i,x=Math.abs(h.clientX-s);p>=n&&p>x&&(l=!0,a(),t.onCommit())},c=h=>{h.pointerId===r&&(r=null)};return o.addEventListener("pointerdown",b),o.addEventListener("pointermove",f),o.addEventListener("pointerup",c),o.addEventListener("pointercancel",c),()=>{o.removeEventListener("pointerdown",b),o.removeEventListener("pointermove",f),o.removeEventListener("pointerup",c),o.removeEventListener("pointercancel",c)}}const Ft=new Set(["os-mio-toggle","os-overview"]);function Be(o){return Ft.has(o.id)?!1:!!(o.windowId||o.tile||o.menu?.url||o.entry?.url)}function qe(o){if(!o)return{apps:[],system:[]};const e=new Set,t=r=>{const s=[];for(const d of r)for(const l of d)e.has(l.id)||o.ephemeral.has(l.id)||!Be(l)||(e.add(l.id),s.push(l));return s},n=t([o.dock.core,o.sidebar,o.dock.apps,o.desktop]),i=t([o.dock.controls]);return{apps:n,system:i}}function Ze(o,e){const t=e.trim().toLocaleLowerCase();return t?o.filter(n=>n.title.toLocaleLowerCase().includes(t)):o.slice()}function je(o){return o>99?"99+":String(o)}function Ut(o,e){const t=document.createElement("div");t.className="os-mobile-home",t.setAttribute("role","region"),t.setAttribute("aria-label",C("Home"));const n=document.createElement("div");n.className="os-mobile-home__search";const i=document.createElement("os-text-field");i.setAttribute("type","search"),i.setAttribute("placeholder",C("Search apps")),i.setAttribute("aria-label",C("Search apps")),i.setAttribute("autocomplete","off"),n.appendChild(i);const r=document.createElement("div");r.className="os-mobile-home__scroll";const s=document.createElement("div");s.className="os-mobile-home__content",r.appendChild(s),t.append(n,r),o.appendChild(t);let d={apps:[],system:[]},l="";const a=c=>{const h=document.createElement("div");h.className="os-mobile-grid__cell",h.setAttribute("role","listitem");const p=document.createElement("button");p.type="button",p.className="os-mobile-tile",p.dataset.navId=c.id;const x=document.createElement("span");x.className="os-mobile-tile__icon",x.appendChild(e.renderIcon(e.getArt?.(c)||c.icon,{title:c.title,className:"os-mobile-tile__glyph"}));const v=e.getBadge(c);if(v>0){const I=document.createElement("span");I.className="os-mobile-tile__badge",I.textContent=je(v),I.setAttribute("aria-hidden","true"),x.appendChild(I)}const A=document.createElement("span");return A.className="os-mobile-tile__label",A.textContent=c.title,p.append(x,A),p.setAttribute("aria-label",v>0?`${c.title}, ${je(v)}`:c.title),p.addEventListener("click",()=>e.onOpen(c)),h.appendChild(p),h},b=(c,h)=>{if(h.length===0)return null;const p=document.createElement("section");p.className="os-mobile-home__section";const x=document.createElement("h2");x.className="os-mobile-home__heading",x.textContent=c;const v=document.createElement("div");v.className="os-mobile-grid",v.setAttribute("role","list");for(const A of h)v.appendChild(a(A));return p.append(x,v),p},f=()=>{if(s.replaceChildren(),l.trim()){const p=Ze([...d.apps,...d.system],l),x=b(C("Results"),p);if(x)s.appendChild(x);else{const v=document.createElement("p");v.className="os-mobile-home__empty",v.textContent=C("Nothing matches."),s.appendChild(v)}return}const c=b(C("Apps"),d.apps),h=b(C("System"),d.system);if(c&&s.appendChild(c),h&&s.appendChild(h),!c&&!h){const p=document.createElement("p");p.className="os-mobile-home__empty",p.textContent=C("Nothing to show yet."),s.appendChild(p)}};return i.addEventListener("os-input-change",c=>{l=c.detail?.value??"",f()}),i.addEventListener("os-submit",()=>{const c=Ze([...d.apps,...d.system],l)[0];c&&e.onOpen(c)}),{el:t,render(c){d=qe(c),f()},setHidden(c){t.hidden=c},reset(){l&&(l="",i.setAttribute("value",""),i.value="",f()),r.scrollTop=0}}}const Xe={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 Ke(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Yt(o){return Object.prototype.hasOwnProperty.call(Xe,o)?Xe[o]:null}function Gt(o,e={}){const t=Yt(o);if(!t)return"";const{size:n=24,className:i,title:r,rotate:s}=e,d=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];n!=null&&d.push(`width="${n}"`,`height="${n}"`),d.push(t.a),i&&d.push(`class="${Ke(i)}"`),r?d.push('role="img"',`aria-label="${Ke(r)}"`):d.push('aria-hidden="true"','focusable="false"');const l=s?`<g transform="rotate(${s} 12 12)">${t.b}</g>`:t.b;return`<svg ${d.join(" ")}>${l}</svg>`}function G(o,e={}){const t=Gt(o,e),n=document.createElement("div");n.innerHTML=t;const i=n.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}function Qt(o,e){const t=document.createElement("div");t.className="os-mobile-switcher",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",C("Open apps")),t.hidden=!0;const n=document.createElement("div");n.className="os-mobile-switcher__backdrop",n.addEventListener("click",()=>e.onDismiss());const i=document.createElement("div");i.className="os-mobile-switcher__sheet";const r=document.createElement("header");r.className="os-mobile-switcher__header";const s=document.createElement("h2");s.className="os-mobile-switcher__title",s.textContent=C("Open apps");const d=document.createElement("button");d.type="button",d.className="os-mobile-switcher__close",d.setAttribute("aria-label",C("Close the switcher")),d.appendChild(G("close",{size:20})),d.addEventListener("click",()=>e.onDismiss()),r.append(s,d);const l=document.createElement("div");l.className="os-mobile-switcher__list";const a=document.createElement("footer");a.className="os-mobile-switcher__footer";const b=document.createElement("os-button");b.setAttribute("variant","secondary"),b.textContent=C("Close all"),b.addEventListener("click",()=>e.onCloseAll()),a.appendChild(b),i.append(r,l,a),t.append(n,i),o.appendChild(t);let f=!1,c=!1,h=null,p=null;const x=m=>{m.key==="Escape"&&(m.preventDefault(),e.onDismiss())},v=m=>{const _=document.createElement("div");_.className="os-mobile-card",_.dataset.cardId=m.id,m.active&&_.classList.add("os-mobile-card--active");const w=document.createElement("button");w.type="button",w.className="os-mobile-card__body",m.active&&w.setAttribute("aria-current","true"),w.setAttribute("aria-label",m.title);const N=document.createElement("span");N.className="os-mobile-card__icon",N.appendChild(e.renderIcon(m.icon,{title:m.title,className:"os-mobile-card__glyph"}));const E=document.createElement("span");E.className="os-mobile-card__text";const H=document.createElement("span");H.className="os-mobile-card__title",H.textContent=m.title;const O=document.createElement("span");if(O.className="os-mobile-card__subtitle",O.textContent=m.subtitle,E.append(H,O),m.active){const W=document.createElement("span");W.className="os-mobile-card__status",W.textContent=C("Active"),H.appendChild(W)}const B=document.createElement("span");B.className="os-mobile-card__bar",B.append(N,E);const P=document.createElement("span");P.className="os-mobile-card__preview",P.setAttribute("aria-hidden","true"),w.append(B,P),w.addEventListener("click",()=>e.onPick(m));const D=document.createElement("button");return D.type="button",D.className="os-mobile-card__close",D.setAttribute("aria-label",Re(C("Close %s"),m.title)),D.appendChild(G("close",{size:16})),D.addEventListener("click",W=>{W.stopPropagation(),A(_,m,1)}),_.append(w,D),I(_,m),_},A=(m,_,w)=>{m.classList.add("os-mobile-card--out"),m.style.setProperty("--os-mobile-card-dir",String(w));let N=!1;const E=()=>{N||(N=!0,e.onClose(_))};m.addEventListener("transitionend",E,{once:!0}),setTimeout(E,240)},I=(m,_)=>{let w=null,N=0,E=0,H=0,O=0,B=0,P=!1;const D=()=>{if(m.classList.remove("os-mobile-card--dragging"),m.style.transform="",m.style.opacity="",w=null,P=!1,c=!1,h){const S=h;h=null,L(S)}};m.addEventListener("pointerdown",S=>{!S.isPrimary||w!==null||(w=S.pointerId,N=H=S.clientX,E=S.clientY,O=S.timeStamp,B=0,P=!1)}),m.addEventListener("pointermove",S=>{if(S.pointerId!==w)return;const V=S.clientX-N,K=S.clientY-E;if(!P){if(Math.abs(V)<He)return;if(Math.abs(K)>Math.abs(V)){w=null;return}P=!0,c=!0,m.classList.add("os-mobile-card--dragging");try{m.setPointerCapture(S.pointerId)}catch{}}const q=Math.max(1,S.timeStamp-O);B=(S.clientX-H)/q,H=S.clientX,O=S.timeStamp,m.style.transform=`translateX(${V}px)`,m.style.opacity=String(Math.max(.35,1-Math.abs(V)/Math.max(1,m.offsetWidth)))});const W=S=>{if(S.pointerId!==w)return;if(!P){w=null;return}const V=S.clientX-N,K=S.clientY-E,q=Zt({dx:V,dy:K,velocity:B,width:m.offsetWidth}),ce=ne=>{ne.stopPropagation(),ne.preventDefault()};if(m.addEventListener("click",ce,{capture:!0,once:!0}),setTimeout(()=>m.removeEventListener("click",ce,{capture:!0}),300),q==="commit"){m.classList.remove("os-mobile-card--dragging"),w=null,P=!1,c=!1,A(m,_,V<0?-1:1);return}D()};m.addEventListener("pointerup",W),m.addEventListener("pointercancel",S=>{S.pointerId===w&&D()})},M=m=>{const _=document.createElement("section");_.className="os-mobile-deck";const w=document.createElement("div");return w.className="os-mobile-deck__cards",m.forEach((N,E)=>{const H=v(N);H.style.zIndex=String(m.length-E),w.appendChild(H)}),_.appendChild(w),_},L=m=>{if(l.replaceChildren(),m.length===0){const _=document.createElement("p");_.className="os-mobile-switcher__empty",_.textContent=C("Nothing open. Pick something from Home."),l.appendChild(_),a.hidden=!0;return}l.appendChild(M(m)),a.hidden=!1};return{el:t,isOpen:()=>f,open(m){if(f){this.update(m);return}f=!0;const _=t.ownerDocument.activeElement;p=_ instanceof HTMLElement?_:null,L(m),t.hidden=!1,document.addEventListener("keydown",x),(l.querySelector(".os-mobile-card__body")??d).focus()},update(m){if(f){if(c){h=m;return}L(m)}},close(){if(!f)return;f=!1,c=!1,h=null,t.hidden=!0,document.removeEventListener("keydown",x);const m=p;p=null,m&&m.isConnected&&m.focus()}}}const Jt=["post_type","page","taxonomy","path","post","c","tag_ID","item","p"],ge=[];function eo(o){if(!o.pathname.endsWith("/admin.php")||!o.searchParams.get("page"))return ge;const e=o.searchParams.get("action");return e==="edit"&&o.searchParams.get("id")?["id"]:e==="new"?["action"]:ge}function Fe(o){let e=o;try{e=decodeURIComponent(o)}catch{e=o}return e.replace(/\.php/g,"-php").replace(/[?&=/]/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"index"}function to(o,e){let t=null;try{t=new URL(o,e)}catch{t=null}if(t){const i=new URL(e).pathname,r=t.pathname.replace(i,"").replace(/^\/+/,""),s=new URLSearchParams,d=[...Jt,...eo(t)];for(const a of d){const b=t.searchParams.get(a);b&&s.set(a,b)}const l=s.toString();return Fe(l?`${r}?${l}`:r)}let n=o.replace(e,"");return n.startsWith("/")&&(n=n.substring(1)),Fe(n)}const oo=3;function Ue(o,e){if(o.windowId)return o.windowId;const t=o.menu?.url||o.entry?.url;if(!t)return null;try{return to(t,e)}catch{return null}}function no(o,e,t=oo){if(!o||t<=0)return[];const n=[...o.dock.core,...o.sidebar,...o.dock.apps,...o.desktop],i=new Map;for(const l of n)i.has(l.id)||i.set(l.id,l);const r=l=>!!l&&!l.locked&&!o.ephemeral.has(l.id)&&Be(l),s=[],d=new Set;for(const l of e){const a=i.get(l);if(r(a)&&!d.has(a.id)&&(d.add(a.id),s.push(a),s.length>=t))return s}if(s.length>0)return s;for(const l of n){if(s.length>=t)break;r(l)&&!d.has(l.id)&&(d.add(l.id),s.push(l))}return s}function io(o,e){const t=document.createElement("nav");t.className="os-mobile-tabs",t.setAttribute("aria-label",C("Primary")),o.appendChild(t);let n=[],i=null,r=null,s=null;const d=(a,b,f)=>{const c=document.createElement("button");c.type="button",c.className="os-mobile-tabs__item",c.dataset.tab=a;const h=document.createElement("span");h.className="os-mobile-tabs__icon",h.appendChild(f);const p=document.createElement("span");return p.className="os-mobile-tabs__label",p.textContent=b,c.append(h,p),c},l=a=>{for(const b of n)b.dataset.tab===a.active?b.setAttribute("aria-current","page"):b.removeAttribute("aria-current");i&&(i.hidden=a.openCount===0,i.textContent=i.hidden?"":String(Math.min(a.openCount,99))),s?.classList.toggle("os-mobile-tabs__icon--counted",a.openCount>0),r&&r.setAttribute("aria-label",Re(C("Open apps (%d)"),a.openCount))};return{el:t,render(a,b){t.replaceChildren(),n=[];const f=d("home",C("Home"),G("apps",{size:22}));f.addEventListener("click",e.onHome),n.push(f);for(const c of a){const h=d(c.id,c.title,e.renderIcon(c.icon,{title:c.title,className:"os-mobile-tabs__glyph"})),p=e.getBadge(c);if(p>0){const x=document.createElement("span");x.className="os-mobile-tabs__badge",x.textContent=p>99?"99+":String(p),x.setAttribute("aria-hidden","true"),h.querySelector(".os-mobile-tabs__icon")?.appendChild(x),h.setAttribute("aria-label",`${c.title}, ${p>99?"99+":p}`)}h.addEventListener("click",()=>e.onOpen(c)),n.push(h)}r=d("switcher",C("Open apps"),G("windows",{size:22})),s=r.querySelector(".os-mobile-tabs__icon"),i=document.createElement("span"),i.className="os-mobile-tabs__count",i.setAttribute("aria-hidden","true"),s?.appendChild(i),r.addEventListener("click",e.onSwitcher),n.push(r),t.append(...n),l(b)},setState:l}}function ro(o,e){const t=document.createElement("header");t.className="os-mobile-top",t.hidden=!0;const n=document.createElement("div");n.className="os-mobile-top__identity";const i=document.createElement("span");i.className="os-mobile-top__icon",i.setAttribute("aria-hidden","true");const r=document.createElement("h1");r.className="os-mobile-top__title",n.append(i,r);const s=document.createElement("div");s.className="os-mobile-top__controls";const d=document.createElement("button");d.type="button",d.className="os-mobile-top__button os-mobile-top__close",d.setAttribute("aria-label",C("Close app")),d.appendChild(G("close",{size:20})),d.addEventListener("click",e.onClose),s.append(d),t.append(n,s),o.appendChild(t);let l="";return{el:t,update(a){if(!a){r.textContent="",i.replaceChildren(),l="";return}r.textContent!==a.title&&(r.textContent=a.title),a.icon!==l&&(l=a.icon,i.replaceChildren(e.renderIcon(a.icon,{title:a.title,className:"os-mobile-top__glyph"})))},setHidden(a){t.hidden=a},setBackProgress(a){t.style.setProperty("--os-mobile-back-progress",String(a)),t.classList.toggle("os-mobile-top--peeking",a>0)}}}const Ye="openstation/mobile-layer",Ge="openstation/mobile",Qe="os-mobile-enter",Je="os-mobile-hero",so="os-overview",et="os-mobile-open-switcher",ao=800;function tt(o){const e=globalThis.CSS;return typeof e?.escape=="function"?e.escape(o):o.replace(/["\\]/g,"\\$&")}const lo={osMobile:"app"};function co(o){if(o.config.native)return C("App");try{const e=new URL(o.getCurrentUrl(),window.location.origin),t=e.pathname.split("/").pop()||e.pathname,n=e.searchParams.get("page")||e.searchParams.get("post_type");return n?`${t} · ${n}`:t}catch{return""}}function ot(o){return o.element.querySelector(".os-window__title")?.textContent?.trim()||o.config.title||""}function uo(o){const{manager:e,shell:t,area:n}=o,i=t.querySelector(".os-shell__body"),r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;t.classList.add("os-mobile"),o.wallpaper.suspend(Ge);const s=ro(t,{renderIcon:o.renderIcon,onClose:()=>go()});i&&t.insertBefore(s.el,i);const d=Ut(n,{renderIcon:o.renderIcon,getBadge:o.getBadge,getArt:o.getArt,onOpen:u=>K(u)}),l=io(t,{renderIcon:o.renderIcon,getBadge:o.getBadge,onHome:()=>q(),onSwitcher:()=>po(),onOpen:u=>K(u)}),a=Qt(t,{renderIcon:o.renderIcon,onPick:u=>mo(u),onClose:u=>bo(u),onCloseAll:()=>{fo()},onDismiss:()=>re()}),b=document.createElement("div");b.className="os-mobile-edge os-mobile-edge--start",b.setAttribute("aria-hidden","true"),n.appendChild(b);const f=document.createElement("div");f.className="os-mobile-edge os-mobile-edge--end",f.setAttribute("aria-hidden","true"),n.appendChild(f);const c=u=>{const g=e.getActiveDesktopId();return(u.config.desktopId??g)===g},h=()=>e.getAll().filter(c),p=()=>{const u=h();for(let g=u.length-1;g>=0;g--)if(!u[g].isMinimized())return u[g];return null},x=()=>a.isOpen()?"switcher":p()?"app":"home";let v=[],A=null,I=null,M=0,L=!1,m=!1,_=!1;const w=(u,g)=>{let k=null;if(u==="home")k="home";else if(u==="switcher")k="switcher";else if(g){const z=g.config.baseId||g.id;k=v.find(R=>Ue(R,o.adminUrl)===z)?.id??null}return{active:k,openCount:h().length}},N=()=>{m=!1;const u=h().length;a.isOpen()&&I==="switcher"&&u===0&&M>0&&a.close(),M=u;const g=p(),k=x();if(t.dataset.osMobileState=k,d.setHidden(k!=="home"),s.setHidden(!g),s.update(g?{title:ot(g),icon:g.config.icon}:null),l.setState(w(k,g)),k==="home"&&I!=="home"&&d.reset(),g&&g.id!==A&&!r&&!_&&(g.element.classList.add(Qe),g.element.addEventListener("animationend",()=>g.element.classList.remove(Qe),{once:!0})),k==="app"&&!L)try{history.pushState(lo,""),L=!0}catch{}a.isOpen()&&a.update(ne()),A=g?.id??null,I=k},E=()=>{m||(m=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(N):setTimeout(N,0))},H=()=>Array.from(l.el.querySelectorAll(".os-mobile-tabs__item")).map(u=>u.dataset.tab??""),O=u=>{for(const g of l.el.querySelectorAll(".os-mobile-tabs__item"))if(u){const k=(g.dataset.tab??"").replace(/[^a-zA-Z0-9_-]/g,"_");g.style.setProperty("view-transition-name",`os-tab-${k}`),g.style.setProperty("view-transition-class","os-tab")}else g.style.removeProperty("view-transition-name"),g.style.removeProperty("view-transition-class")},B=u=>{const g=w(x(),p()),k=document,z=H(),R=["home",...u.map(ve=>ve.id),"switcher"];if(z.length===R.length&&z.every((ve,Eo)=>ve===R[Eo])||z.length===0||r||typeof k.startViewTransition!="function"||_){l.render(u,g);return}_=!0,O(!0),k.startViewTransition(()=>{l.render(u,g),O(!0)}).finished.catch(()=>{}).then(()=>{O(!1),_=!1})},P=()=>{const u=o.getNav();d.render(u),v=no(u,o.getPinnedTabIds()),B(v)},D=u=>d.el.querySelector(`.os-mobile-tile[data-nav-id="${tt(u)}"] .os-mobile-tile__icon`),W=u=>{const g=u.config.baseId||u.id,k=o.getNav();if(!k)return null;const{apps:z,system:R}=qe(k),de=[...z,...R].find(at=>Ue(at,o.adminUrl)===g);return de?D(de.id):null},S=(u=["os-window-opened","os-window-reopened","os-window-focused"])=>new Promise(g=>{let k=0;const z=()=>{for(const R of u)document.removeEventListener(R,z);clearTimeout(k),g()};for(const R of u)document.addEventListener(R,z);k=window.setTimeout(z,ao)}),V=(u,g,k)=>{const z=document;if(r||typeof z.startViewTransition!="function"||_){Promise.resolve(g()).then(N);return}_=!0,u?.style.setProperty("view-transition-name",Je);let R=null;z.startViewTransition(async()=>{u?.style.removeProperty("view-transition-name"),await g(),N(),R=k(),R?.style.setProperty("view-transition-name",Je)}).finished.catch(()=>{}).then(()=>{R?.style.removeProperty("view-transition-name"),_=!1})},K=u=>{if(u.id===so){ie();return}a.close();const g=x()==="home";V(g?D(u.id):null,async()=>{o.openNavItem(u)&&await S()},()=>p()?.element??null)},q=()=>{a.close();const u=p();V(u?.element??null,()=>{e.minimizeAll()},()=>u?W(u):null)},ce=()=>{if(a.isOpen()){re();return}if(L&&history.state&&history.state.osMobile==="app"){history.back();return}q()},ne=()=>{const u=p();return h().slice().reverse().map(g=>({id:g.id,title:ot(g),icon:g.config.icon,subtitle:co(g),active:g===u}))},ie=()=>{a.open(ne()),E()},re=()=>{a.close(),E()},po=()=>{a.isOpen()?re():ie()},mo=u=>{if(u.active){re();return}const g=a.el.querySelector(`.os-mobile-card[data-card-id="${tt(u.id)}"]`),k=e.getById(u.id);V(g,()=>{a.close(),k&&(k.isMinimized()&&k.restore(),e.focus(k))},()=>k?.element??null)},bo=u=>{e.getById(u.id)?.close(),E()},fo=async()=>{h().length===0||!await Lt({title:C("Close all apps?"),message:C("Anything unsaved in them will ask before it goes."),confirmLabel:C("Close all"),danger:!0})||(e.closeAll(),a.close(),E())},go=()=>{const u=p();u&&V(u.element,()=>{u.minimize(),u.close()},()=>W(u))},nt=["os-window-opened","os-window-closed","os-window-focused","os-window-blurred","os-window-changed","os-window-reopened"];for(const u of nt)document.addEventListener(u,E);const it=[le.WINDOW_MINIMIZED,le.WINDOW_RESTORED,le.WINDOW_TITLE_CHANGED,le.DESKTOP_SWITCHED];for(const u of it)Ht(u,Ye,E);const rt=()=>{history.state?.osMobile!=="app"&&L&&(L=!1,x()!=="home"&&q())};window.addEventListener("popstate",rt);const st=()=>ie();document.addEventListener(et,st);const vo=jt(b,{onProgress:u=>s.setBackProgress(u),onCommit:()=>ce()}),xo=[Oe(b),Oe(f)],yo=Xt(l.el,{onCommit:()=>ie()}),_o=Kt(s.el,{onCommit:()=>q()}),ko=o.subscribeNav(P),wo=o.subscribeArt?.(P)??(()=>{});return P(),N(),{unmount(){for(const u of nt)document.removeEventListener(u,E);for(const u of it)Dt(u,Ye);window.removeEventListener("popstate",rt),document.removeEventListener(et,st),vo();for(const u of xo)u();yo(),_o(),ko(),wo(),a.close(),s.el.remove(),d.el.remove(),l.el.remove(),a.el.remove(),b.remove(),f.remove(),delete t.dataset.osMobileState,t.classList.remove("os-mobile"),o.wallpaper.resume(Ge)},refresh:P,goHome:q,openSwitcher:ie,closeSwitcher:re,getState:x}}const ho={mount:uo};window.openStationMobile=ho})();
177 + `}function Pe(){const o=window.wp?.hooks;if(!o)throw new Error("[openstation] `window.wp.hooks` is not available. The plugin declares `wp-hooks` as a script dependency; if you are seeing this error, verify the enqueue order.");return o}function Rt(o,e,t,n){Pe().addAction(o,e,t,n)}function Dt(o,e){return Pe().removeAction(o,e)}const le={WINDOW_MINIMIZED:"os.window.minimized",WINDOW_RESTORED:"os.window.restored",WINDOW_TITLE_CHANGED:"os.window.title-changed",DESKTOP_SWITCHED:"os.os.switched"},Vt="desktop-mode";function ze(){return window.wp?.i18n}function E(o,e=Vt){return ze()?.__(o,e)??o}function He(o,...e){const t=ze()?.sprintf;if(t)return t(o,...e);let n=0;return o.replace(/%(?:(\d+)\$)?[sd]/g,(i,r)=>{const s=r?Number.parseInt(r,10)-1:n++;return String(e[s]??"")})}const Bt=.35,Ot=.6,Wt=24,Re=10,De=64,qt=44;function Zt(o){const{dx:e,dy:t,velocity:n,width:i}=o,r=Math.abs(e);return r<=Math.abs(t)?"cancel":i>0&&r>=i*Bt||Math.abs(n)>=Ot&&r>=Wt&&Math.sign(n)===Math.sign(e)?"commit":"cancel"}function Ve(o,e=De){return e<=0?o>0?1:0:Math.min(1,Math.max(0,o/e))}function jt(o,e){const t=e.threshold??De;let n=null,i=0,r=0,s=!1;const d=()=>{n=null,s=!1,e.onProgress?.(0)},a=c=>{if(!(n!==null||!c.isPrimary)){n=c.pointerId,i=c.clientX,r=c.clientY,s=!1;try{o.setPointerCapture(c.pointerId)}catch{}c.preventDefault()}},l=c=>{if(c.pointerId!==n||s)return;const h=c.clientX-i,p=c.clientY-r;if(Math.abs(p)>Re&&Math.abs(p)>Math.abs(h)){s=!0,e.onProgress?.(0);return}e.onProgress?.(Ve(h,t))},m=c=>{if(c.pointerId!==n)return;const h=!s&&Ve(c.clientX-i,t)>=1;d(),h&&e.onCommit()},f=c=>{c.pointerId===n&&d()};return o.addEventListener("pointerdown",a),o.addEventListener("pointermove",l),o.addEventListener("pointerup",m),o.addEventListener("pointercancel",f),()=>{o.removeEventListener("pointerdown",a),o.removeEventListener("pointermove",l),o.removeEventListener("pointerup",m),o.removeEventListener("pointercancel",f)}}function Be(o){const e=t=>{t.cancelable&&t.preventDefault()};return o.addEventListener("touchstart",e,{passive:!1}),()=>{o.removeEventListener("touchstart",e)}}function Xt(o,e){return Oe(o,"up",e)}function Kt(o,e){return Oe(o,"down",e)}function Oe(o,e,t){const n=t.threshold??qt,i=e==="up"?1:-1;let r=null,s=0,d=0,a=!1;const l=()=>{const h=p=>{p.stopPropagation(),p.preventDefault()};o.addEventListener("click",h,{capture:!0,once:!0}),setTimeout(()=>o.removeEventListener("click",h,{capture:!0}),350)},m=h=>{r!==null||!h.isPrimary||h.pointerType==="mouse"||(r=h.pointerId,s=h.clientX,d=h.clientY,a=!1)},f=h=>{if(h.pointerId!==r||a)return;const p=(d-h.clientY)*i,x=Math.abs(h.clientX-s);p>=n&&p>x&&(a=!0,l(),t.onCommit())},c=h=>{h.pointerId===r&&(r=null)};return o.addEventListener("pointerdown",m),o.addEventListener("pointermove",f),o.addEventListener("pointerup",c),o.addEventListener("pointercancel",c),()=>{o.removeEventListener("pointerdown",m),o.removeEventListener("pointermove",f),o.removeEventListener("pointerup",c),o.removeEventListener("pointercancel",c)}}const Ft=new Set(["os-mio-toggle","os-overview","os-site-assistant"]);function We(o){return Ft.has(o.id)?!1:!!(o.windowId||o.tile||o.menu?.url||o.entry?.url)}function qe(o){if(!o)return{apps:[],system:[]};const e=new Set,t=r=>{const s=[];for(const d of r)for(const a of d)e.has(a.id)||o.ephemeral.has(a.id)||!We(a)||(e.add(a.id),s.push(a));return s},n=t([o.dock.core,o.sidebar,o.dock.apps,o.desktop]),i=t([o.dock.controls]);return{apps:n,system:i}}function Ze(o,e){const t=e.trim().toLocaleLowerCase();return t?o.filter(n=>n.title.toLocaleLowerCase().includes(t)):o.slice()}function je(o){return o>99?"99+":String(o)}function Ut(o,e){const t=document.createElement("div");t.className="os-mobile-home",t.setAttribute("role","region"),t.setAttribute("aria-label",E("Home"));const n=document.createElement("div");n.className="os-mobile-home__search";const i=document.createElement("os-text-field");i.setAttribute("type","search"),i.setAttribute("placeholder",E("Search apps")),i.setAttribute("aria-label",E("Search apps")),i.setAttribute("autocomplete","off"),n.appendChild(i);const r=document.createElement("div");r.className="os-mobile-home__scroll";const s=document.createElement("div");s.className="os-mobile-home__content",r.appendChild(s),t.append(n,r),o.appendChild(t);let d={apps:[],system:[]},a="";const l=c=>{const h=document.createElement("div");h.className="os-mobile-grid__cell",h.setAttribute("role","listitem");const p=document.createElement("button");p.type="button",p.className="os-mobile-tile",p.dataset.navId=c.id;const x=document.createElement("span");x.className="os-mobile-tile__icon",x.appendChild(e.renderIcon(e.getArt?.(c)||c.icon,{title:c.title,className:"os-mobile-tile__glyph"}));const v=e.getBadge(c);if(v>0){const A=document.createElement("span");A.className="os-mobile-tile__badge",A.textContent=je(v),A.setAttribute("aria-hidden","true"),x.appendChild(A)}const C=document.createElement("span");return C.className="os-mobile-tile__label",C.textContent=c.title,p.append(x,C),p.setAttribute("aria-label",v>0?`${c.title}, ${je(v)}`:c.title),p.addEventListener("click",()=>e.onOpen(c)),h.appendChild(p),h},m=(c,h)=>{if(h.length===0)return null;const p=document.createElement("section");p.className="os-mobile-home__section";const x=document.createElement("h2");x.className="os-mobile-home__heading",x.textContent=c;const v=document.createElement("div");v.className="os-mobile-grid",v.setAttribute("role","list");for(const C of h)v.appendChild(l(C));return p.append(x,v),p},f=()=>{if(s.replaceChildren(),a.trim()){const p=Ze([...d.apps,...d.system],a),x=m(E("Results"),p);if(x)s.appendChild(x);else{const v=document.createElement("p");v.className="os-mobile-home__empty",v.textContent=E("Nothing matches."),s.appendChild(v)}return}const c=m(E("Apps"),d.apps),h=m(E("System"),d.system);if(c&&s.appendChild(c),h&&s.appendChild(h),!c&&!h){const p=document.createElement("p");p.className="os-mobile-home__empty",p.textContent=E("Nothing to show yet."),s.appendChild(p)}};return i.addEventListener("os-input-change",c=>{a=c.detail?.value??"",f()}),i.addEventListener("os-submit",()=>{const c=Ze([...d.apps,...d.system],a)[0];c&&e.onOpen(c)}),{el:t,render(c){d=qe(c),f()},setHidden(c){t.hidden=c},reset(){a&&(a="",i.setAttribute("value",""),i.value="",f()),r.scrollTop=0}}}const Xe={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 Ke(o){return o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Yt(o){return Object.prototype.hasOwnProperty.call(Xe,o)?Xe[o]:null}function Gt(o,e={}){const t=Yt(o);if(!t)return"";const{size:n=24,className:i,title:r,rotate:s}=e,d=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];n!=null&&d.push(`width="${n}"`,`height="${n}"`),d.push(t.a),i&&d.push(`class="${Ke(i)}"`),r?d.push('role="img"',`aria-label="${Ke(r)}"`):d.push('aria-hidden="true"','focusable="false"');const a=s?`<g transform="rotate(${s} 12 12)">${t.b}</g>`:t.b;return`<svg ${d.join(" ")}>${a}</svg>`}function G(o,e={}){const t=Gt(o,e),n=document.createElement("div");n.innerHTML=t;const i=n.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}function Qt(o,e){const t=document.createElement("div");t.className="os-mobile-switcher",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",E("Open apps")),t.hidden=!0;const n=document.createElement("div");n.className="os-mobile-switcher__backdrop",n.addEventListener("click",()=>e.onDismiss());const i=document.createElement("div");i.className="os-mobile-switcher__sheet";const r=document.createElement("header");r.className="os-mobile-switcher__header";const s=document.createElement("h2");s.className="os-mobile-switcher__title",s.textContent=E("Open apps");const d=document.createElement("button");d.type="button",d.className="os-mobile-switcher__close",d.setAttribute("aria-label",E("Close the switcher")),d.appendChild(G("close",{size:20})),d.addEventListener("click",()=>e.onDismiss()),r.append(s,d);const a=document.createElement("div");a.className="os-mobile-switcher__list";const l=document.createElement("footer");l.className="os-mobile-switcher__footer";const m=document.createElement("os-button");m.setAttribute("variant","secondary"),m.textContent=E("Close all"),m.addEventListener("click",()=>e.onCloseAll()),l.appendChild(m),i.append(r,a,l),t.append(n,i),o.appendChild(t);let f=!1,c=!1,h=null,p=null;const x=b=>{b.key==="Escape"&&(b.preventDefault(),e.onDismiss())},v=b=>{const _=document.createElement("div");_.className="os-mobile-card",_.dataset.cardId=b.id,b.active&&_.classList.add("os-mobile-card--active");const w=document.createElement("button");w.type="button",w.className="os-mobile-card__body",b.active&&w.setAttribute("aria-current","true"),w.setAttribute("aria-label",b.title);const L=document.createElement("span");L.className="os-mobile-card__icon",L.appendChild(e.renderIcon(b.icon,{title:b.title,className:"os-mobile-card__glyph"}));const S=document.createElement("span");S.className="os-mobile-card__text";const N=document.createElement("span");N.className="os-mobile-card__title",N.textContent=b.title;const B=document.createElement("span");if(B.className="os-mobile-card__subtitle",B.textContent=b.subtitle,S.append(N,B),b.active){const O=document.createElement("span");O.className="os-mobile-card__status",O.textContent=E("Active"),N.appendChild(O)}const W=document.createElement("span");W.className="os-mobile-card__bar",W.append(L,S);const z=document.createElement("span");z.className="os-mobile-card__preview",z.setAttribute("aria-hidden","true"),w.append(W,z),w.addEventListener("click",()=>e.onPick(b));const D=document.createElement("button");return D.type="button",D.className="os-mobile-card__close",D.setAttribute("aria-label",He(E("Close %s"),b.title)),D.appendChild(G("close",{size:16})),D.addEventListener("click",O=>{O.stopPropagation(),C(_,b,1)}),_.append(w,D),A(_,b),_},C=(b,_,w)=>{b.classList.add("os-mobile-card--out"),b.style.setProperty("--os-mobile-card-dir",String(w));let L=!1;const S=()=>{L||(L=!0,e.onClose(_))};b.addEventListener("transitionend",S,{once:!0}),setTimeout(S,240)},A=(b,_)=>{let w=null,L=0,S=0,N=0,B=0,W=0,z=!1;const D=()=>{if(b.classList.remove("os-mobile-card--dragging"),b.style.transform="",b.style.opacity="",w=null,z=!1,c=!1,h){const I=h;h=null,P(I)}};b.addEventListener("pointerdown",I=>{!I.isPrimary||w!==null||(w=I.pointerId,L=N=I.clientX,S=I.clientY,B=I.timeStamp,W=0,z=!1)}),b.addEventListener("pointermove",I=>{if(I.pointerId!==w)return;const V=I.clientX-L,K=I.clientY-S;if(!z){if(Math.abs(V)<Re)return;if(Math.abs(K)>Math.abs(V)){w=null;return}z=!0,c=!0,b.classList.add("os-mobile-card--dragging");try{b.setPointerCapture(I.pointerId)}catch{}}const q=Math.max(1,I.timeStamp-B);W=(I.clientX-N)/q,N=I.clientX,B=I.timeStamp,b.style.transform=`translateX(${V}px)`,b.style.opacity=String(Math.max(.35,1-Math.abs(V)/Math.max(1,b.offsetWidth)))});const O=I=>{if(I.pointerId!==w)return;if(!z){w=null;return}const V=I.clientX-L,K=I.clientY-S,q=Zt({dx:V,dy:K,velocity:W,width:b.offsetWidth}),ce=ne=>{ne.stopPropagation(),ne.preventDefault()};if(b.addEventListener("click",ce,{capture:!0,once:!0}),setTimeout(()=>b.removeEventListener("click",ce,{capture:!0}),300),q==="commit"){b.classList.remove("os-mobile-card--dragging"),w=null,z=!1,c=!1,C(b,_,V<0?-1:1);return}D()};b.addEventListener("pointerup",O),b.addEventListener("pointercancel",I=>{I.pointerId===w&&D()})},M=b=>{const _=document.createElement("section");_.className="os-mobile-deck";const w=document.createElement("div");return w.className="os-mobile-deck__cards",b.forEach((L,S)=>{const N=v(L);N.style.zIndex=String(b.length-S),w.appendChild(N)}),_.appendChild(w),_},P=b=>{if(a.replaceChildren(),b.length===0){const _=document.createElement("p");_.className="os-mobile-switcher__empty",_.textContent=E("Nothing open. Pick something from Home."),a.appendChild(_),l.hidden=!0;return}a.appendChild(M(b)),l.hidden=!1};return{el:t,isOpen:()=>f,open(b){if(f){this.update(b);return}f=!0;const _=t.ownerDocument.activeElement;p=_ instanceof HTMLElement?_:null,P(b),t.hidden=!1,document.addEventListener("keydown",x),(a.querySelector(".os-mobile-card__body")??d).focus()},update(b){if(f){if(c){h=b;return}P(b)}},close(){if(!f)return;f=!1,c=!1,h=null,t.hidden=!0,document.removeEventListener("keydown",x);const b=p;p=null,b&&b.isConnected&&b.focus()}}}const Jt=["post_type","page","taxonomy","path","post","c","tag_ID","item","p"],ge=[];function eo(o){if(!o.pathname.endsWith("/admin.php")||!o.searchParams.get("page"))return ge;const e=o.searchParams.get("action");return e==="edit"&&o.searchParams.get("id")?["id"]:e==="new"?["action"]:ge}function Fe(o){let e=o;try{e=decodeURIComponent(o)}catch{e=o}return e.replace(/\.php/g,"-php").replace(/[?&=/]/g,"-").replace(/[^a-zA-Z0-9_-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"index"}function to(o,e){let t=null;try{t=new URL(o,e)}catch{t=null}if(t){const i=new URL(e).pathname,r=t.pathname.replace(i,"").replace(/^\/+/,""),s=new URLSearchParams,d=[...Jt,...eo(t)];for(const l of d){const m=t.searchParams.get(l);m&&s.set(l,m)}const a=s.toString();return Fe(a?`${r}?${a}`:r)}let n=o.replace(e,"");return n.startsWith("/")&&(n=n.substring(1)),Fe(n)}const oo=3;function Ue(o,e){if(o.windowId)return o.windowId;const t=o.menu?.url||o.entry?.url;if(!t)return null;try{return to(t,e)}catch{return null}}function no(o,e,t=oo){if(!o||t<=0)return[];const n=[...o.dock.core,...o.sidebar,...o.dock.apps,...o.desktop],i=new Map;for(const a of n)i.has(a.id)||i.set(a.id,a);const r=a=>!!a&&!a.locked&&!o.ephemeral.has(a.id)&&We(a),s=[],d=new Set;for(const a of e){const l=i.get(a);if(r(l)&&!d.has(l.id)&&(d.add(l.id),s.push(l),s.length>=t))return s}if(s.length>0)return s;for(const a of n){if(s.length>=t)break;r(a)&&!d.has(a.id)&&(d.add(a.id),s.push(a))}return s}function io(o,e){const t=document.createElement("nav");t.className="os-mobile-tabs",t.setAttribute("aria-label",E("Primary")),o.appendChild(t);let n=[],i=null,r=null,s=null;const d=(l,m,f)=>{const c=document.createElement("button");c.type="button",c.className="os-mobile-tabs__item",c.dataset.tab=l;const h=document.createElement("span");h.className="os-mobile-tabs__icon",h.appendChild(f);const p=document.createElement("span");return p.className="os-mobile-tabs__label",p.textContent=m,c.append(h,p),c},a=l=>{for(const m of n)m.dataset.tab===l.active?m.setAttribute("aria-current","page"):m.removeAttribute("aria-current");i&&(i.hidden=l.openCount===0,i.textContent=i.hidden?"":String(Math.min(l.openCount,99))),s?.classList.toggle("os-mobile-tabs__icon--counted",l.openCount>0),r&&r.setAttribute("aria-label",He(E("Open apps (%d)"),l.openCount))};return{el:t,render(l,m){t.replaceChildren(),n=[];const f=d("home",E("Home"),G("apps",{size:22}));f.addEventListener("click",e.onHome),n.push(f);for(const c of l){const h=d(c.id,c.title,e.renderIcon(c.icon,{title:c.title,className:"os-mobile-tabs__glyph"})),p=e.getBadge(c);if(p>0){const x=document.createElement("span");x.className="os-mobile-tabs__badge",x.textContent=p>99?"99+":String(p),x.setAttribute("aria-hidden","true"),h.querySelector(".os-mobile-tabs__icon")?.appendChild(x),h.setAttribute("aria-label",`${c.title}, ${p>99?"99+":p}`)}h.addEventListener("click",()=>e.onOpen(c)),n.push(h)}r=d("switcher",E("Open apps"),G("windows",{size:22})),s=r.querySelector(".os-mobile-tabs__icon"),i=document.createElement("span"),i.className="os-mobile-tabs__count",i.setAttribute("aria-hidden","true"),s?.appendChild(i),r.addEventListener("click",e.onSwitcher),n.push(r),t.append(...n),a(m)},setState:a}}function ro(o,e){const t=document.createElement("header");t.className="os-mobile-top",t.hidden=!0;const n=document.createElement("div");n.className="os-mobile-top__identity";const i=document.createElement("span");i.className="os-mobile-top__icon",i.setAttribute("aria-hidden","true");const r=document.createElement("h1");r.className="os-mobile-top__title",n.append(i,r);const s=document.createElement("div");s.className="os-mobile-top__controls";const d=document.createElement("button");d.type="button",d.className="os-mobile-top__button os-mobile-top__close",d.setAttribute("aria-label",E("Close app")),d.appendChild(G("close",{size:20})),d.addEventListener("click",e.onClose),s.append(d),t.append(n,s),o.appendChild(t);let a="";return{el:t,update(l){if(!l){r.textContent="",i.replaceChildren(),a="";return}r.textContent!==l.title&&(r.textContent=l.title),l.icon!==a&&(a=l.icon,i.replaceChildren(e.renderIcon(l.icon,{title:l.title,className:"os-mobile-top__glyph"})))},setHidden(l){t.hidden=l},setBackProgress(l){t.style.setProperty("--os-mobile-back-progress",String(l)),t.classList.toggle("os-mobile-top--peeking",l>0)}}}const Ye="openstation/mobile-layer",Ge="openstation/mobile",Qe="os-mobile-enter",Je="os-mobile-hero",so="os-overview",et="os-mobile-open-switcher",ao=800;function tt(o){const e=globalThis.CSS;return typeof e?.escape=="function"?e.escape(o):o.replace(/["\\]/g,"\\$&")}const lo={osMobile:"app"};function co(o){if(o.config.native)return E("App");try{const e=new URL(o.getCurrentUrl(),window.location.origin),t=e.pathname.split("/").pop()||e.pathname,n=e.searchParams.get("page")||e.searchParams.get("post_type");return n?`${t} · ${n}`:t}catch{return""}}function ot(o){return o.element.querySelector(".os-window__title")?.textContent?.trim()||o.config.title||""}function uo(o){const{manager:e,shell:t,area:n}=o,i=t.querySelector(".os-shell__body"),r=typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;t.classList.add("os-mobile"),o.wallpaper.suspend(Ge);const s=ro(t,{renderIcon:o.renderIcon,onClose:()=>go()});i&&t.insertBefore(s.el,i);const d=Ut(n,{renderIcon:o.renderIcon,getBadge:o.getBadge,getArt:o.getArt,onOpen:u=>K(u)}),a=io(t,{renderIcon:o.renderIcon,getBadge:o.getBadge,onHome:()=>q(),onSwitcher:()=>po(),onOpen:u=>K(u)}),l=Qt(t,{renderIcon:o.renderIcon,onPick:u=>bo(u),onClose:u=>mo(u),onCloseAll:()=>{fo()},onDismiss:()=>re()}),m=document.createElement("div");m.className="os-mobile-edge os-mobile-edge--start",m.setAttribute("aria-hidden","true"),n.appendChild(m);const f=document.createElement("div");f.className="os-mobile-edge os-mobile-edge--end",f.setAttribute("aria-hidden","true"),n.appendChild(f);const c=u=>{const g=e.getActiveDesktopId();return(u.config.desktopId??g)===g},h=()=>e.getAll().filter(c),p=()=>{const u=h();for(let g=u.length-1;g>=0;g--)if(!u[g].isMinimized())return u[g];return null},x=()=>l.isOpen()?"switcher":p()?"app":"home";let v=[],C=null,A=null,M=0,P=!1,b=!1,_=!1;const w=(u,g)=>{let k=null;if(u==="home")k="home";else if(u==="switcher")k="switcher";else if(g){const H=g.config.baseId||g.id;k=v.find(R=>Ue(R,o.adminUrl)===H)?.id??null}return{active:k,openCount:h().length}},L=()=>{b=!1;const u=h().length;l.isOpen()&&A==="switcher"&&u===0&&M>0&&l.close(),M=u;const g=p(),k=x();if(t.dataset.osMobileState=k,d.setHidden(k!=="home"),s.setHidden(!g),s.update(g?{title:ot(g),icon:g.config.icon}:null),a.setState(w(k,g)),k==="home"&&A!=="home"&&d.reset(),g&&g.id!==C&&!r&&!_&&(g.element.classList.add(Qe),g.element.addEventListener("animationend",()=>g.element.classList.remove(Qe),{once:!0})),k==="app"&&!P)try{history.pushState(lo,""),P=!0}catch{}l.isOpen()&&l.update(ne()),C=g?.id??null,A=k},S=()=>{b||(b=!0,typeof requestAnimationFrame=="function"?requestAnimationFrame(L):setTimeout(L,0))},N=()=>Array.from(a.el.querySelectorAll(".os-mobile-tabs__item")).map(u=>u.dataset.tab??""),B=u=>{for(const g of a.el.querySelectorAll(".os-mobile-tabs__item"))if(u){const k=(g.dataset.tab??"").replace(/[^a-zA-Z0-9_-]/g,"_");g.style.setProperty("view-transition-name",`os-tab-${k}`),g.style.setProperty("view-transition-class","os-tab")}else g.style.removeProperty("view-transition-name"),g.style.removeProperty("view-transition-class")},W=u=>{const g=w(x(),p()),k=document,H=N(),R=["home",...u.map(ve=>ve.id),"switcher"];if(H.length===R.length&&H.every((ve,Co)=>ve===R[Co])||H.length===0||r||typeof k.startViewTransition!="function"||_){a.render(u,g);return}_=!0,B(!0),k.startViewTransition(()=>{a.render(u,g),B(!0)}).finished.catch(()=>{}).then(()=>{B(!1),_=!1})},z=()=>{const u=o.getNav();d.render(u),v=no(u,o.getPinnedTabIds()),W(v)},D=u=>d.el.querySelector(`.os-mobile-tile[data-nav-id="${tt(u)}"] .os-mobile-tile__icon`),O=u=>{const g=u.config.baseId||u.id,k=o.getNav();if(!k)return null;const{apps:H,system:R}=qe(k),de=[...H,...R].find(at=>Ue(at,o.adminUrl)===g);return de?D(de.id):null},I=(u=["os-window-opened","os-window-reopened","os-window-focused"])=>new Promise(g=>{let k=0;const H=()=>{for(const R of u)document.removeEventListener(R,H);clearTimeout(k),g()};for(const R of u)document.addEventListener(R,H);k=window.setTimeout(H,ao)}),V=(u,g,k)=>{const H=document;if(r||typeof H.startViewTransition!="function"||_){Promise.resolve(g()).then(L);return}_=!0,u?.style.setProperty("view-transition-name",Je);let R=null;H.startViewTransition(async()=>{u?.style.removeProperty("view-transition-name"),await g(),L(),R=k(),R?.style.setProperty("view-transition-name",Je)}).finished.catch(()=>{}).then(()=>{R?.style.removeProperty("view-transition-name"),_=!1})},K=u=>{if(u.id===so){ie();return}l.close();const g=x()==="home";V(g?D(u.id):null,async()=>{o.openNavItem(u)&&await I()},()=>p()?.element??null)},q=()=>{l.close();const u=p();V(u?.element??null,()=>{e.minimizeAll()},()=>u?O(u):null)},ce=()=>{if(l.isOpen()){re();return}if(P&&history.state&&history.state.osMobile==="app"){history.back();return}q()},ne=()=>{const u=p();return h().slice().reverse().map(g=>({id:g.id,title:ot(g),icon:g.config.icon,subtitle:co(g),active:g===u}))},ie=()=>{l.open(ne()),S()},re=()=>{l.close(),S()},po=()=>{l.isOpen()?re():ie()},bo=u=>{if(u.active){re();return}const g=l.el.querySelector(`.os-mobile-card[data-card-id="${tt(u.id)}"]`),k=e.getById(u.id);V(g,()=>{l.close(),k&&(k.isMinimized()&&k.restore(),e.focus(k))},()=>k?.element??null)},mo=u=>{e.getById(u.id)?.close(),S()},fo=async()=>{h().length===0||!await Nt({title:E("Close all apps?"),message:E("Anything unsaved in them will ask before it goes."),confirmLabel:E("Close all"),danger:!0})||(e.closeAll(),l.close(),S())},go=()=>{const u=p();u&&V(u.element,()=>{u.minimize(),u.close()},()=>O(u))},nt=["os-window-opened","os-window-closed","os-window-focused","os-window-blurred","os-window-changed","os-window-reopened"];for(const u of nt)document.addEventListener(u,S);const it=[le.WINDOW_MINIMIZED,le.WINDOW_RESTORED,le.WINDOW_TITLE_CHANGED,le.DESKTOP_SWITCHED];for(const u of it)Rt(u,Ye,S);const rt=()=>{history.state?.osMobile!=="app"&&P&&(P=!1,x()!=="home"&&q())};window.addEventListener("popstate",rt);const st=()=>ie();document.addEventListener(et,st);const vo=jt(m,{onProgress:u=>s.setBackProgress(u),onCommit:()=>ce()}),xo=[Be(m),Be(f)],yo=Xt(a.el,{onCommit:()=>ie()}),_o=Kt(s.el,{onCommit:()=>q()}),ko=o.subscribeNav(z),wo=o.subscribeArt?.(z)??(()=>{});return z(),L(),{unmount(){for(const u of nt)document.removeEventListener(u,S);for(const u of it)Dt(u,Ye);window.removeEventListener("popstate",rt),document.removeEventListener(et,st),vo();for(const u of xo)u();yo(),_o(),ko(),wo(),l.close(),s.el.remove(),d.el.remove(),a.el.remove(),l.el.remove(),m.remove(),f.remove(),delete t.dataset.osMobileState,t.classList.remove("os-mobile"),o.wallpaper.resume(Ge)},refresh:z,goHome:q,openSwitcher:ie,closeSwitcher:re,getState:x}}const ho={mount:uo};window.openStationMobile=ho})();