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
desktop-mode / assets / js / apps / os-settings.min.js

os-settings.min.js in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.12, at assets/js/apps/os-settings.min.js

2,487 lines 530.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var openStationApp_osSettings=function(qs){"use strict";const al="desktop-mode";function ln(){return window.wp?.i18n}function d(s,e=al){return ln()?.__(s,e)??s}function F(s,...e){const t=ln()?.sprintf;if(t)return t(s,...e);let o=0;return s.replace(/%(?:(\d+)\$)?[sd]/g,(i,n)=>{const r=n?Number.parseInt(n,10)-1:o++;return String(e[r]??"")})}const ll="desktop-mode-os-settings",Fs=1920,Vs=1080,cl=40,dl=300,gs="custom-gradient",ne="custom-image",ul="galaxy",Te="custom",cn=[{id:"pulse",label:"Pulse",value:"#f252fc"},{id:"nebula",label:"Nebula",value:"#ec9bff"},{id:"sirius",label:"Sirius",value:"#9af2ff"},{id:"lagoon",label:"Lagoon",value:"#9f98ff"},{id:"starlight",label:"Starlight",value:"#fffbff"},{id:"wp-blue",label:"WordPress Blue",value:"#2271b1"},{id:"indigo",label:"Indigo",value:"#3858e9"},{id:"teal",label:"Teal",value:"#04a4cc"},{id:"emerald",label:"Emerald",value:"#059669"},{id:"amber",label:"Amber",value:"#d97706"},{id:"rose",label:"Rose",value:"#e11d48"}];function De(){const e=window.wp?.os?.config?.accentColors;if(!Array.isArray(e)||e.length===0)return cn;const t=[];for(const o of e)o&&typeof o=="object"&&typeof o.id=="string"&&typeof o.label=="string"&&typeof o.value=="string"&&o.id!==""&&o.label!==""&&/^#[0-9a-f]{3,8}$/i.test(o.value)&&t.push({id:o.id,label:o.label,value:o.value});return t.length>0?t:cn}function dn(){const e=window.wp?.os?.config?.defaultWallpaper;return typeof e=="string"&&e!==""?e:ul}const un=[{id:"compact",label:"Compact",width:48,icon:18},{id:"default",label:"Default",width:56,icon:20},{id:"large",label:"Large",width:72,icon:26}],hn=[{id:"sharp",label:"Sharp",value:0},{id:"default",label:"Default",value:8},{id:"round",label:"Round",value:16}],pn=[{id:"static",label:"Static"},{id:"dynamic",label:"Dynamic"},{id:"hidden",label:"Hidden"}],js=[{id:"static",label:"Static"},{id:"dynamic",label:"Dynamic"}],gn=[{id:"bottom",label:"Bottom"},{id:"left",label:"Left"},{id:"right",label:"Right"}],hl=[{id:"unified",label:"Unified"},{id:"classic",label:"Split"}],Ks=ll;function ge(){return window.wp?.os}function P(){return ge().getOsSettings()}function E(s){ge()?.updateOsSettings(s,{windowId:Ks})}function pl(){ge()?.resetOsSettings({windowId:Ks})}function fn(s){return ge()?.subscribeOsSettings(s)??(()=>{})}function bn(s){const e=ge()?.desktopThemes?.applyRecommendedOsSettings(s)??{};return Object.keys(e).length>0}function mn(){try{ge()?.refreshMenu?.()}catch{}}function gl(s,e,t="dashicons-admin-settings"){const o=ge();if(o?.windowManager?.open){o.windowManager.open({id:o.deriveWindowId?o.deriveWindowId(s):s,url:s,title:e,icon:t});return}window.open(s,"_blank","noopener")}function Bs(){return window.openStationConfig??{}}const vn="__openStationSharedStores";function fl(){const s=window;let e=s[vn];return e||(e=new Map,s[vn]=e),e}function J(s,e){const t=fl();let o=t.get(s);o||(o={state:e(),listeners:new Set,rebuild:e},t.set(s,o));const i={get state(){return o.state},set state(n){o.state=n},getState(){return o.state},notify(){for(const n of Array.from(o.listeners))try{n(o.state)}catch(r){console.error(`[desktop-mode/shared-store:${s}] subscriber threw:`,r)}},subscribe(n){return o.listeners.add(n),()=>{o.listeners.delete(n)}},setState(n){const r=o.state;if(typeof r!="object"||r===null){console.warn(`[desktop-mode/shared-store:${s}] setState called on a primitive store; use the state setter instead.`);return}Object.assign(r,n),i.notify()},reset(){const n=o.rebuild(),r=o.state;if(typeof r=="object"&&r!==null&&typeof n=="object"&&n!==null){const a=r;for(const l of Object.keys(a))delete a[l];Object.assign(a,n)}else o.state=n;o.listeners.clear()}};return i}const _n="X-WP-Nonce";function bl(s,e){const t=ml();if(!t)return e;const o=vl(s);if(!o||!_l(o))return e;const i=e?.headers??(typeof Request<"u"&&s instanceof Request?s.headers:void 0),n=new Headers(i??{});return n.has(_n)?e:(n.set(_n,t),{...e??{},headers:n})}function ml(){if(typeof window>"u")return;const e=window.openStationConfig?.restNonce;return typeof e=="string"&&e.length>0?e:void 0}function vl(s){try{const e=typeof window<"u"&&window.location?window.location.href:void 0;return typeof s=="string"?new URL(s,e):s instanceof URL?s:typeof Request<"u"&&s instanceof Request?new URL(s.url,e):null}catch{return null}}function _l(s){return typeof window>"u"||!window.location||s.origin!==window.location.origin?!1:!!(s.pathname.includes("/wp-json/")||s.searchParams.has("rest_route"))}function wn(s,e,t={}){const o=window.wp?.os?.fetch;if(typeof o=="function")return o(s,e,t);const i=bl(s,e);return fetch(s,i)}class yn extends Error{constructor(e,t){super(e||t.serverMessage||`HTTP ${t.status}`),this.name="RestError",this.status=t.status,this.code=t.code,this.data=t.data,this.serverMessage=t.serverMessage??""}}function xn(s){return s instanceof yn}function wl(s){const e=typeof s=="object"&&s!==null?s:void 0;return{code:typeof e?.code=="string"?e.code:void 0,data:e?.data,serverMessage:typeof e?.message=="string"?e.message:""}}function yl(s,e,t=""){return new yn(t,{status:s,...wl(e)})}async function xe(s,e=""){let t=null;try{t=await s.json()}catch{t=null}return yl(s.status,t,e)}const kn=J("desktop-mode/dock-rail-registry",()=>({registry:new Map,listeners:new Set,activeId:"default"})),$n=kn.state.registry,An=kn.state.listeners;function xl(s){return $n.get(s)}function Gs(){return Array.from($n.values())}function kl(s){return An.add(s),()=>{An.delete(s)}}function En(){const s=window.wp?.hooks;if(!s)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 s}function fe(s,e,...t){return En().applyFilters(s,e,...t)}function be(s,...e){En().doAction(s,...e)}const V={INIT:"os.init",WALLPAPERS:"os.wallpapers",GAMES:"os.games",UNFOCUS_EFFECTS:"os.unfocus-effects",WINDOW_REVEALS:"os.window-reveals",WALLPAPER_MOUNTING:"os.wallpaper.mounting",WALLPAPER_MOUNTED:"os.wallpaper.mounted",WALLPAPER_UNMOUNTING:"os.wallpaper.unmounting",WALLPAPER_MOUNT_FAILED:"os.wallpaper.mount-failed",WALLPAPER_VISIBILITY:"os.wallpaper.visibility",WALLPAPER_SUSPEND:"os.wallpaper.suspend",WALLPAPER_PREVIEW_PARAMS:"os.wallpaper.preview-params",WALLPAPER_SETTINGS_CHANGED:"os.wallpaper.settings-changed",IFRAME_READY:"os.iframe.ready",IFRAME_ERROR:"os.iframe.error",IFRAME_NETWORK_COMPLETED:"os.iframe.network-completed",SHELL_ERROR:"os.shell.error",BROADCAST:"os.broadcast",MONITOR_ENTRY:"os.monitor.entry",WALLPAPER_SURFACES:"os.wallpaper.surfaces",DESKTOP_THEME_CHANGED:"os.os-theme.changed",DESKTOP_THEME_ICON:"os.os-theme.icon",DESKTOP_THEME_ICON_COLOR:"os.os-theme.icon-color",WALLPAPERS_SERVER_CHANGED:"os.wallpapers.server-changed",EXTENDED_OPTIONS_CHANGED:"os.extended-options.changed",WINDOW_GEOMETRY:"os.window.geometry",WINDOW_OPENED:"os.window.opened",WINDOW_CONTENT_LOADING:"os.window.content-loading",WINDOW_CONTENT_LOADED:"os.window.content-loaded",WINDOW_LOADING_OVERLAY:"os.window.loading-overlay",WINDOW_REOPENED:"os.window.reopened",WINDOW_MENU_OPENED:"os.window.menu-opened",WINDOW_CLOSING:"os.window.closing",WINDOW_CLOSED:"os.window.closed",WINDOW_FOCUSED:"os.window.focused",WINDOW_BLURRED:"os.window.blurred",WINDOW_MINIMIZED:"os.window.minimized",WINDOW_RESTORED:"os.window.restored",WINDOW_CHILD_BLOCKED:"os.window.child-blocked",WINDOW_MAXIMIZED:"os.window.maximized",WINDOW_UNMAXIMIZED:"os.window.unmaximized",WINDOW_FULLSCREEN_ENTERED:"os.window.fullscreen-entered",WINDOW_FULLSCREEN_EXITED:"os.window.fullscreen-exited",WINDOW_AUTO_EXIT_FULLSCREEN:"os.window.auto-exit-fullscreen",WINDOW_FOCUS_ON_DRAG_HOVER:"os.window.focus-on-drag-hover",WINDOW_BOUNDS_CHANGED:"os.window.bounds-changed",WINDOW_MOVED:"os.window.moved",WINDOW_RESIZED:"os.window.resized",WINDOW_DRAG_START:"os.window.drag-start",WINDOW_DRAG_END:"os.window.drag-end",WINDOW_RESIZE_START:"os.window.resize-start",WINDOW_RESIZE_END:"os.window.resize-end",WINDOW_DETACHED:"os.window.detached",WINDOW_RELOADED:"os.window.reloaded",WINDOW_TITLE_CHANGED:"os.window.title-changed",WINDOW_HIGHLIGHT_CHANGED:"os.window.highlight-changed",WINDOW_BODY_RESIZED:"os.window.body-resized",NATIVE_WINDOW_BEFORE_RENDER:"os.native-window.before-render",NATIVE_WINDOW_AFTER_RENDER:"os.native-window.after-render",NATIVE_WINDOW_BEFORE_CLOSE:"os.native-window.before-close",WINDOW_CHROME_THEME:"os.window.chrome.theme",WINDOW_CHROME_CONTROLS:"os.window.chrome.controls",WINDOW_CHROME_SLOT:"os.window.chrome.slot",WINDOW_CHROME_RENDER:"os.window.chrome.render",WINDOW_CHROME_APPLIED:"os.window.chrome.applied",WINDOW_CHROME_THEME_CHANGED:"os.window.chrome.theme-changed",DESKTOP_ICON_CLICKED:"os.os-icon.clicked",DESKTOP_ICONS_RENDERED:"os.os-icons.rendered",ICON_BADGE_CHANGED:"os.icon.badge-changed",COMPONENTS_REGISTERED:"os.components.registered",DOCK_ITEM_APPENDED:"os.dock.item-appended",DOCK_ITEM_REMOVED:"os.dock.item-removed",DOCK_BEFORE_RENDER:"os.dock.before-render",DOCK_AFTER_RENDER:"os.dock.after-render",DOCK_REFRESH_ACTIVE:"os.dock.refresh-active",DOCK_TILE_CLASS:"os.dock.tile-class",DOCK_TILE_ELEMENT:"os.dock.tile-element",DOCK_TILE_RENDERED:"os.dock.tile-rendered",DOCK_TILE_TOOLTIP:"os.dock.tile-tooltip",DOCK_PEEK_CARD_CONTENT:"os.dock.peek-card-content",DOCK_PEEK_CARD_ELEMENT:"os.dock.peek-card-element",CONSTELLATION_PANEL:"os.constellation.panel",CONSTELLATION_OPENED:"os.constellation.opened",CONSTELLATION_CLOSED:"os.constellation.closed",OVERVIEW_ENTERING:"os.overview.entering",OVERVIEW_ENTERED:"os.overview.entered",OVERVIEW_EXITING:"os.overview.exiting",OVERVIEW_EXITED:"os.overview.exited",OVERVIEW_WINDOW_HOVER:"os.overview.window-hover",OVERVIEW_WINDOW_UNHOVER:"os.overview.window-unhover",OVERVIEW_WINDOW_CLICK:"os.overview.window-click",WORK_AREA_CHANGED:"os.work-area.changed",ARRANGE_CASCADE_STARTING:"os.arrange.cascade.starting",ARRANGE_CASCADE_APPLIED:"os.arrange.cascade.applied",ARRANGE_TILE_STARTING:"os.arrange.tile.starting",ARRANGE_TILE_APPLIED:"os.arrange.tile.applied",ARRANGE_TILE_DIMENSIONS:"os.arrange.tile.dimensions",ARRANGE_COLUMNS_STARTING:"os.arrange.columns.starting",ARRANGE_COLUMNS_APPLIED:"os.arrange.columns.applied",ARRANGE_FOCUS_SPLIT:"os.arrange.focus.split",ARRANGE_FOCUS_STARTING:"os.arrange.focus.starting",ARRANGE_FOCUS_APPLIED:"os.arrange.focus.applied",ARRANGE_SNAP_CHANGED:"os.arrange.snap.changed",ARRANGE_SNAP_CELL_SIZE:"os.arrange.snap.cell-size",POINTER_SHAKE:"os.pointer.shake",GRID_SNAP_DIMENSIONS:"os.grid-snap.dimensions",GRID_SNAP_ARMED:"os.grid-snap.armed",GRID_SNAP_CHANGED:"os.grid-snap.changed",GRID_SNAP_ANCHOR_RESET:"os.grid-snap.anchor-reset",GRID_SNAP_CANCELED:"os.grid-snap.canceled",GRID_SNAP_COMMITTED:"os.grid-snap.committed",GRID_SNAP_REFLOWED:"os.grid-snap.reflowed",SNAP_ZONE_PENDING:"os.snap.zone-pending",SNAP_ZONE_CANCELED:"os.snap.zone-canceled",SNAP_ZONE_COMMITTED:"os.snap.zone-committed",SNAP_SPLIT_FILLED:"os.snap.split-filled",WIDGETS:"os.widgets",WIDGET_MOUNTING:"os.widget.mounting",WIDGET_MOUNTED:"os.widget.mounted",WIDGET_UNMOUNTING:"os.widget.unmounting",WIDGET_MOUNT_FAILED:"os.widget.mount-failed",WIDGET_ADDED:"os.widget.added",WIDGET_REMOVED:"os.widget.removed",DESKTOP_CREATED:"os.os.created",DESKTOP_CLOSED:"os.os.closed",DESKTOP_SWITCHED:"os.os.switched",DESKTOP_RENAMED:"os.os.renamed",WINDOW_DESKTOP_CHANGED:"os.os.window-moved",PRIMARY_DESKTOP_ID:"os.primary-desktop-id",WORKSPACE_PRESETS:"os.workspaces.presets",WORKSPACE_PROFILE:"os.workspaces.profile",WORKSPACE_UPDATED:"os.workspaces.updated",WORKSPACE_PROVISIONED:"os.workspaces.provisioned",WINDOWS_BEFORE_CLOSE_ALL:"os.windows.before-close-all",WINDOWS_CLOSE_ALL:"os.windows.close-all",WINDOWS_AFTER_CLOSE_ALL:"os.windows.after-close-all",COMMAND_BEFORE_RUN:"os.command.before-run",COMMAND_AFTER_RUN:"os.command.after-run",COMMAND_ERROR:"os.command.error",SHELL_RESIZED:"os.shell.resized",SHELL_VISIBILITY:"os.shell.visibility",CONNECTION_OPENED:"os.connection.opened",CONNECTION_CLOSED:"os.connection.closed",CONNECTION_MESSAGE:"os.connection.message",IFRAME_CONNECTION_REQUEST:"os.iframe.connection-request",WINDOW_CONTENT_CHANGED:"os.window-links.content-changed",WINDOW_LINK_GROUPS_CHANGED:"os.window-links.groups-changed",WINDOW_LINKS_CONTENT:"os.window-links.content",WINDOW_LINK_GROUPS:"os.window-links.groups",WINDOW_LINK_EDGES:"os.window-links.edges",RELATED_ENTITIES_ITEMS:"os.related-entities.items",WINDOW_LINK_RENDERERS:"os.window-links.renderers",WINDOW_LINK_RENDERER:"os.window-links.renderer",EDITOR_PREVIEW_WINDOW_CONFIG:"os.editor-preview.window-config",EDITOR_PREVIEW_LIVE:"os.editor-preview.live",EDITOR_PREVIEW_OPENED:"os.editor-preview.opened",EDITOR_PREVIEW_CLOSED:"os.editor-preview.closed",REVISIONS_WINDOW_CONFIG:"os.revisions.window-config",REVISIONS_OPENED:"os.revisions.opened",FILE_DROP_FILES_DETECTED:"os.drop.files-detected",FILE_DROP_FILES_REJECTED:"os.drop.files-rejected",FILE_DROP_DIALOG_FIELDS:"os.drop.dialog-fields",FILE_DROP_BEFORE_UPLOAD:"os.drop.before-upload",FILE_DROP_UPLOAD_STARTED:"os.drop.upload-started",FILE_DROP_UPLOAD_PROGRESS:"os.drop.upload-progress",FILE_DROP_AFTER_UPLOAD:"os.drop.after-upload",FILE_DROP_UPLOAD_FAILED:"os.drop.upload-failed",AUTH_LOST:"os.auth.lost",AUTH_RESTORED:"os.auth.restored",MODE_CHANGED:"os.mode.changed",SESSION_SNAPSHOT:"os.session.snapshot"};function Sn(s,e){if(!s||typeof s!="object")return["def (not an object)"];const t=s,o=[];for(const i of e)i.valid(t)||o.push(`${i.field} (${i.message})`);return o}class $l extends Error{constructor(e,t,o){super(`[openstation] ${e} registration rejected — fields: `+t.join(", ")+"."),this.name="RegistrationError",this.kind=e,this.errors=t,this.def=o}}function Xs(s,e,t){if(e.length!==0)throw new $l(s,e,t)}const re=[[0,0],[100,0],[100,100],[0,100]],Al=48,El=80,Zs=6,Ys=8,Cn=4,In=3,Rn=64,Js=105,ae=2;function Ln(s){return`${Math.round(s*1e3)/1e3}%`}function le(s){return s.slice().reverse()}function Pe(s,e,t,o){return[[s,e],[t,e],[t,o],[s,o]]}function Sl(s,e,t,o){const i=[];for(let n=0;n<o;n++){const r=n/o*Math.PI*2;i.push([s+Math.cos(r)*t,e+Math.sin(r)*t])}return i}function Q(s,e=[]){const t=[],o=i=>{t.push(`${Ln(i[0])} ${Ln(i[1])}`)};for(const i of s)o(i);if(e.length>0){o(s[0]);for(const i of e){for(const n of i)o(n);o(i[0]),o(s[0])}}return`polygon( ${t.join(", ")} )`}function Tn(s){return Q(re,[le(Sl(50,50,s,Al))])}function Dn(s){return Q(re,[le(Pe(50-s,-ae,50+s,100+ae))])}function Pn(s){const e=100/Zs,t=[];for(let o=0;o<Zs;o++){const i=o*e;t.push(le(Pe(-ae,i,100+ae,i+s)))}return Q(re,t)}function Nn(s){return Q(re,[le(Pe(-ae,50-s,100+ae,50+s))])}function Mn(s){const e=100/Ys,t=[];for(let o=0;o<Ys;o++){const i=o*e;t.push(le(Pe(i,-ae,i+s,100+ae)))}return Q(re,t)}function zn(s){return Q(re,[le([[50,50-s],[50+s,50],[50,50+s],[50-s,50]])])}function On(s){const e=100/Cn,t=100/In,o=[];for(let i=0;i<In;i++)for(let n=0;n<Cn;n++){const r=n*e+e/2,a=i*t+t/2,l=e/2*s,u=t/2*s;o.push(le(Pe(r-l,a-u,r+l,a+u)))}return Q(re,o)}function Wn(s){const e=-Math.PI/2,t=s/180*Math.PI,o=[[50,50]];for(let i=0;i<Rn;i++){const n=e+i/(Rn-1)*t;o.push([50+Math.cos(n)*Js,50+Math.sin(n)*Js])}return Q(re,[le(o)])}function Cl(){return{from:Tn(0),to:Tn(El)}}function Il(){return{from:Dn(0),to:Dn(52)}}function Rl(){return{from:Pn(0),to:Pn(100/Zs+.5)}}function Ll(){return{from:Nn(0),to:Nn(52)}}function Tl(){return{from:Mn(0),to:Mn(100/Ys+.5)}}function Dl(){return{from:zn(0),to:zn(Js)}}function Pl(){return{from:On(0),to:On(1.04)}}function Nl(){return{from:Wn(0),to:Wn(360)}}function Ml(){return{from:"inset( 0% 0% 0% 0% )",to:"inset( 0% 0% 100% 0% )"}}function zl(){return{from:"inset( 0% 0% 0% 0% )",to:"inset( 0% 0% 0% 100% )"}}function Ol(){return{from:Q([[-60,0],[100,0],[100,100],[0,100]]),to:Q([[100,0],[260,0],[260,100],[160,100]])}}const Qs=6,eo=100,ke=eo/2,fs=200,Hn=90,Un=["#5c5c6d","#525261","#484855","#3e3e49","#34343d","#2a2a31"],Wl="#101014",Hl=1.25,$e="http://www.w3.org/2000/svg";let Ul=0;function bs(s){return Math.round(s*1e3)/1e3}function to(s){return s/Qs*Math.PI*2-Math.PI/2}function ql(s){const t=to(s)+Math.PI/Qs+Math.PI/2;return{x:Math.cos(t),y:Math.sin(t)}}function Fl(s){const e=to(s),t=to(s+1);return[[ke,ke],[ke+Math.cos(e)*fs,ke+Math.sin(e)*fs],[ke+Math.cos(t)*fs,ke+Math.sin(t)*fs]]}function qn(s,e){const t=Fl(s),o=document.createElementNS($e,"path");return o.setAttribute("d",`M ${t.map(([i,n])=>`${bs(i)} ${bs(n)}`).join(" L ")} Z`),e?o.setAttribute("fill","#fff"):(o.setAttribute("fill",Un[s%Un.length]),o.setAttribute("stroke",Wl),o.setAttribute("stroke-width",String(Hl)),o.setAttribute("vector-effect","non-scaling-stroke"),o.setAttribute("stroke-linejoin","round")),o}function Vl(){const s=`os-iris-${++Ul}`,e=document.createElementNS($e,"svg");e.setAttribute("viewBox",`0 0 ${eo} ${eo}`),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.style.width="100%",e.style.height="100%",e.style.display="block";const t=document.createElementNS($e,"defs"),o=document.createElementNS($e,"mask");o.setAttribute("id",s);const i=document.createElementNS($e,"g"),n=document.createElementNS($e,"g");n.setAttribute("mask",`url(#${s})`);const r=[];for(let l=0;l<Qs;l++){const u=qn(l,!0),h=qn(l,!1);i.appendChild(u),n.appendChild(h),r.push({el:u,index:l},{el:h,index:l})}o.appendChild(i),t.appendChild(o),e.appendChild(t),e.appendChild(n);const a=document.createElement("div");return a.appendChild(e),{element:a,play:l=>r.map(({el:u,index:h})=>{const p=ql(h),g=bs(p.x*Hn),b=bs(p.y*Hn);return u.animate([{transform:"translate( 0px, 0px )"},{transform:`translate( ${g}px, ${b}px )`}],{duration:l.duration,easing:l.easing,delay:l.delay,fill:"both"})})}}const ms="none",Fn=J("desktop-mode/window-reveal-registry",()=>({registry:new Map,listeners:new Set})),so=Fn.state.registry,oo=Fn.state.listeners,Vn=/^[a-z0-9_/-]+$/;function jn(s){const e=/^\s*([a-zA-Z-]+)\s*\(/.exec(s);return e?e[1].toLowerCase():""}const jl=0;function Kn(s,e){const t=[],o=typeof s.from=="string"&&s.from.trim()!=="",i=typeof s.to=="string"&&s.to.trim()!=="";if(o||t.push(`${e}.from (missing — the clip-path covering the window)`),i||t.push(`${e}.to (missing — the clip-path uncovering the window)`),o&&i){const n=jn(s.from),r=jn(s.to);n===""||r===""?t.push(`${e}.from|to (must be shape functions, e.g. \`inset( … )\` or \`polygon( … )\` — bare keywords like \`none\` cannot be animated)`):n!==r&&t.push(`${e}.from|to (must use the same shape function to interpolate — got \`${n}()\` and \`${r}()\`)`)}return t}function Kl(s){if(typeof KeyframeEffect!="function")return!0;try{return new KeyframeEffect(null,null,{easing:s}),!0}catch{return!1}}function G(s){const e=[];if(!s||typeof s!="object")e.push("def (not an object)");else{typeof s.id!="string"||s.id.trim()===""?e.push("id (missing)"):Vn.test(s.id.trim().toLowerCase())?s.id.trim().toLowerCase()===ms&&e.push('id ("none" is reserved)'):e.push(`id (must match ${Vn} — lowercase alphanum, hyphens, underscores, slashes for vendor/sub-id)`),(typeof s.label!="string"||s.label.trim()==="")&&e.push("label (missing)");const o=s.render!==void 0,i=Array.isArray(s.layers),n=s.from!==void 0||s.to!==void 0;o&&typeof s.render!="function"?e.push("render (not a function)"):o&&(i||n)?e.push("render|layers|from|to (supply exactly one of: a from/to pair, a layers array, or a render function)"):o||(i&&n?e.push("layers|from|to (supply EITHER a single from/to pair OR a layers array, not both)"):i?(s.layers.length===0&&e.push("layers (empty — supply at least one matched pair)"),s.layers.forEach((r,a)=>{if(!r||typeof r!="object"){e.push(`layers[ ${a} ] (not an object)`);return}e.push(...Kn(r,`layers[ ${a} ]`))})):e.push(...Kn(s,"").map(r=>r.replace(/^\./,"")))),s.easing!==void 0&&(typeof s.easing!="string"||s.easing.trim()===""?e.push("easing (not a non-empty string)"):Kl(s.easing)||e.push("easing (not an easing the browser can parse — `Element.animate()` would throw at play time, with the covering surface already over the window)"))}Xs("WindowReveal",e,s);const t=s.id.trim().toLowerCase();so.set(t,{...s,id:t}),Xl()}function io(){const s=Array.from(so.values()),e=fe(V.WINDOW_REVEALS,s);return Array.isArray(e)?e:(typeof console<"u"&&console.warn("[openstation] `os.window-reveals` filter returned a non-array; falling back to registry list."),s)}function Bl(s){return so.has(s)}function Gl(s){return oo.add(s),()=>{oo.delete(s)}}function Xl(){const s=Array.from(oo);for(const e of s)try{e()}catch(t){typeof console<"u"&&console.error("[openstation] window-reveal registry listener threw:",t)}}G({id:"sweep",label:d("Sweep"),description:d("A straight edge travels across the window, uncovering the page behind it."),...zl(),duration:420}),G({id:"iris",label:d("Iris"),description:d("The page opens out from the centre of the window, like a camera shutter."),...Cl(),duration:520}),G({id:"curtain",label:d("Curtain"),description:d("Two panels part from the middle of the window and slide off the sides."),...Il(),duration:480}),G({id:"blinds",label:d("Blinds"),description:d("Six horizontal slats retract at once, letting the page through between them."),...Rl(),duration:560}),G({id:"diagonal",label:d("Diagonal"),description:d("A slanted edge sweeps off the trailing corner of the window."),...Ol(),duration:460}),G({id:"rise",label:d("Rise"),description:d("The page rises into the window from the bottom edge upward."),...Ml(),duration:440}),G({id:"shutter",label:d("Shutter"),description:d("Two panels part from the middle of the window and slide off the top and bottom."),...Ll(),duration:480}),G({id:"slats",label:d("Slats"),description:d("Eight vertical slats retract at once, letting the page through between them."),...Tl(),duration:560}),G({id:"diamond",label:d("Diamond"),description:d("The page opens out from the centre of the window through a growing rhombus."),...Dl(),duration:520}),G({id:"mosaic",label:d("Mosaic"),description:d("The page arrives as a grid of tiles, each opening out from its own centre."),...Pl(),duration:600}),G({id:"obturator",label:d("Camera shutter"),description:d("Six wedges slide aside in unison, opening a hexagonal aperture from the centre like the iris of a camera lens."),render:Vl,duration:720,edgeLag:0}),G({id:"radar",label:d("Radar"),description:d("A spoke sweeps a full turn around the centre of the window, uncovering the page behind it."),...Nl(),duration:760});const Bn={dockSize:["compact","default","large"],desktopLayout:["classic","unified"],dockPlacement:["bottom","left","right"],windowRadius:["sharp","default","round"],adminBarMode:["static","dynamic","hidden"]},Gn=["dockRailRenderer","windowReveal","accent"],Xn={windowRevealDuration:{min:80,max:4e3}},Zl=/^[a-z0-9_-]+$/;[...Object.keys(Bn),...Gn,...Object.keys(Xn)];function Zn(s){if(!s||typeof s!="object"||Array.isArray(s))return{};const e=s,t={},o={};for(const[i,n]of Object.entries(Bn)){const r=e[i];typeof r=="string"&&n.includes(r)&&(t[i]=r)}for(const i of Gn){const n=e[i];typeof n=="string"&&Zl.test(n)&&(t[i]=n)}for(const[i,n]of Object.entries(Xn)){const r=e[i];typeof r=="number"&&Number.isFinite(r)&&(o[i]=Math.min(n.max,Math.max(n.min,Math.round(r))))}return{...t,...o}}function Yn(s){const e=Zn(s);return typeof e.dockRailRenderer=="string"&&xl(e.dockRailRenderer)===void 0&&delete e.dockRailRenderer,typeof e.windowReveal=="string"&&e.windowReveal!==ms&&!Bl(e.windowReveal)&&delete e.windowReveal,typeof e.accent=="string"&&!De().some(t=>t.id===e.accent)&&delete e.accent,e}const Yl=/^[a-z0-9_-]+$/,Jn=128;function Jl(s){return typeof s!="string"||s===""||s.length>2048?!1:s.startsWith("dashicons-")||s.startsWith("https://")||s.startsWith("http://")||s.startsWith("data:image/")}function Qn(s){if(!s||typeof s!="object")return null;const e=s,t=typeof e.slug=="string"?e.slug:"";if(!Yl.test(t))return null;const o={};if(e.icons&&typeof e.icons=="object"){let l=0;for(const[u,h]of Object.entries(e.icons)){if(l>=Jn)break;u===""||!Jl(h)||(o[u]=h,l+=1)}}const i={};if(e.tokens&&typeof e.tokens=="object")for(const[l,u]of Object.entries(e.tokens))typeof u=="string"&&(i[l]=u);const n=[];if(Array.isArray(e.fonts))for(const l of e.fonts)typeof l=="string"&&l!==""&&n.push(l);const r={};if(e.iconColors&&typeof e.iconColors=="object"){let l=0;for(const[u,h]of Object.entries(e.iconColors)){if(l>=Jn)break;u===""||typeof h!="string"||h===""||(r[u]=h,l+=1)}}const a=l=>typeof e[l]=="string"?e[l]:"";return{id:a("id")||t,slug:t,name:a("name")||t,version:a("version"),author:a("author"),description:a("description"),previewUrl:a("previewUrl"),cssUrl:a("cssUrl"),cssText:a("cssText"),tokens:i,fonts:n,icons:o,iconColors:r,recommendedOsSettings:Zn(e.recommendedOsSettings),installedAt:typeof e.installedAt=="number"?e.installedAt:0,source:e.source==="code"?"code":"upload",cssDeferred:e.cssDeferred===!0}}function Ql(){const e=window.openStationConfig?.serverDesktopThemes,t=[];if(Array.isArray(e))for(const o of e){const i=Qn(o);i&&t.push(i)}return{themes:t,activeId:null,activeIcons:null,activeIconColors:null}}const oe=J("desktop-mode/desktop-themes",Ql);function er(){return oe}function no(){return oe.getState().themes.slice()}function ec(s){if(typeof s!="string"||s==="")return null;const e=s.replace(/\//g,"-");return oe.getState().themes.find(t=>t.slug===e||t.id===s)??null}function tr(s){const e=Qn(s);if(!e)return null;const t=oe.state.themes.slice(),o=t.findIndex(i=>i.slug===e.slug);return o>=0?t[o]=e:t.push(e),t.sort((i,n)=>i.name.localeCompare(n.name)),oe.setState({themes:t}),e}let Ne=null;function tc(){if(Ne)return Ne;const s=window.openStationConfig?.desktopThemesUrl;return s?(Ne=wn(s,{method:"GET",credentials:"same-origin"},{source:"desktop-mode/desktop-themes"}).then(async e=>{if(!e.ok)throw await xe(e);return e.json()}).then(e=>{for(const t of e?.themes??[])tr(t)}).catch(()=>{Ne=null}),Ne):Promise.resolve()}function sc(s){const e=oe.state.themes.filter(t=>t.slug!==s);e.length!==oe.state.themes.length&&oe.setState({themes:e})}function oc(s){return oe.subscribe(s)}const ic="data-os-mode";function nc(s=typeof document<"u"?document.documentElement:null){return!!s&&s.getAttribute(ic)==="mobile"}function rc(s){s.style.setProperty("--os-file-tile-enter-delay",`${(Math.random()*.25).toFixed(3)}s`),s.style.setProperty("--os-file-tile-enter-duration",`${(.3+Math.random()*.25).toFixed(3)}s`)}function sr(s){if(!s)return 214;let e=5381;for(let t=0;t<s.length;t++)e=Math.imul(e,33)+s.charCodeAt(t);return(e%360+360)%360}function ac(s){const e=er().state;if(e.activeIcons===null||!s)return null;const t=e.activeIcons[s];if(typeof t!="string"||t==="")return null;const o=fe(V.DESKTOP_THEME_ICON,t,{slot:s,themeId:e.activeId??""});return typeof o=="string"&&o!==""?o:null}function lc(s){const e=er().state;if(e.activeIconColors===null||!s)return null;const t=e.activeIconColors[s];if(typeof t!="string"||t==="")return null;const o=fe(V.DESKTOP_THEME_ICON_COLOR,t,{slot:s,themeId:e.activeId??""});return typeof o=="string"&&o!==""?cc(o):null}function cc(s){const e=s.trim();if(e===""||e.length>64||/[;{}<>"'\\]/.test(e))return null;let t=0;for(const o of e)if(o==="(")t+=1;else if(o===")"&&(t-=1,t<0))return null;return t===0?e:null}function dc(s){return typeof s!="string"||s===""||s.length>4096||!/^(https?:\/\/|data:image\/)/i.test(s)?!1:!/['"()\\<>\s]/.test(s)}function or(s,e,t){if(!dc(e))return!1;const o=`url("${e}") center / contain no-repeat`;return s.style.backgroundImage="none",s.style.backgroundColor=t,s.style.setProperty("-webkit-mask",o),s.style.setProperty("mask",o),!0}const Me={OS_SETTINGS:"OS_SETTINGS",RECYCLE_BIN:"RECYCLE_BIN",BUG_REPORT:"BUG_REPORT",EXIT_OPENSTATION:"EXIT_OPENSTATION",PWA_INSTALL:"PWA_INSTALL"},uc={"desktop-mode-os-settings":Me.OS_SETTINGS,"desktop-mode-recycle-bin":Me.RECYCLE_BIN,"desktop-mode-bug-report":Me.BUG_REPORT,"os-exit":Me.EXIT_OPENSTATION,"os-pwa-install":Me.PWA_INSTALL};function hc(s){if(typeof s!="string"||s==="")return"";const e=uc[s];if(e)return e;const t=s.toLowerCase().replace(/[^a-z0-9_-]/g,"");return t===""?"":`APP:${t}`}function ir(s){let e,t;try{const i=new URL(s,document.baseURI);e=i.origin,t=i.pathname}catch{return null}if(!t)return null;const o=document.querySelectorAll("script[src]");for(const i of Array.from(o))try{const n=new URL(i.src,document.baseURI);if(n.origin===e&&n.pathname===t)return i}catch{}return null}const nr=new Map;function pc(s){const e=nr.get(s);if(e)return e;let t=[];try{const o=new URL(s,document.baseURI);if(o.pathname.endsWith("/load-scripts.php")){const i=[];o.searchParams.forEach((n,r)=>{if(r!=="load"&&!r.startsWith("load["))return;const a=/(\d+)/.exec(r);i.push({order:a?Number(a[1]):i.length,value:n})}),i.sort((n,r)=>n.order-r.order),t=i.map(n=>n.value).join("").split(",").map(n=>n.trim()).filter(Boolean)}}catch{}return nr.set(s,t),t}function gc(){const s=new Set,e=document.querySelectorAll('script[src*="load-scripts.php"]');for(const t of Array.from(e))for(const o of pc(t.src))s.add(o);return s}const fc=["-js","-js-before","-js-after","-js-extra","-js-translations"];function bc(s){return s?fc.some(e=>{const t=document.getElementById(s+e);return!!t&&t.tagName==="SCRIPT"}):!1}function rr(s){return s.url&&ir(s.url)?!0:s.handle?gc().has(s.handle)||bc(s.handle):!1}const vs=new Map,ar=new Set;function ro(s,e){const t=vs.get(s);if(t)return t;const o=e?.deps;if(o&&o.length>0){const n=a=>rr(a)?Promise.resolve():a.url?ro(a.url,{...a,deps:void 0}):(mc(a),Promise.resolve()),r=o.reduce((a,l)=>a.then(()=>n(l)),Promise.resolve(void 0)).then(()=>lr(s,e));return vs.set(s,r),r}const i=lr(s,e);return vs.set(s,i),i}function mc(s){if(s.handle){if(ar.has(s.handle))return;ar.add(s.handle)}for(const e of s.l10n??[])me(e);for(const e of s.before??[])me(e);for(const e of s.after??[])me(e)}function lr(s,e){return new Promise((t,o)=>{const i=`script[data-os-vendor="${vc(s)}"]`,n=document.querySelector(i);if(n){if(n.dataset.loaded==="1"){t();return}n.addEventListener("load",()=>t(),{once:!0}),n.addEventListener("error",()=>o(new Error(`Failed to load ${s}`)),{once:!0});return}const r=ir(s);if(r){r.dataset.osVendor=s,r.dataset.loaded="1",t();return}if(rr({handle:e?.handle})){t();return}e?.translations&&me(e.translations);for(const l of e?.l10n??[])me(l);for(const l of e?.before??[])me(l);const a=document.createElement("script");a.src=s,a.async=!0,a.dataset.osVendor=s,a.addEventListener("load",()=>{a.dataset.loaded="1";for(const l of e?.after??[])me(l);t()},{once:!0}),a.addEventListener("error",()=>{vs.delete(s),a.remove(),o(new Error(`Failed to load ${s}`))},{once:!0}),document.head.appendChild(a)})}function me(s){if(!s)return;const e=document.createElement("script");e.textContent=s,e.dataset.osVendorInline="1",document.head.appendChild(e)}function vc(s){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(s):s.replace(/["\\]/g,"\\$&")}J("desktop-mode/native-url-remap",()=>({remaps:[],deps:null}));const _c={core:"rail",plugin:"rail",app:"desktop",control:"rail"};function wc(s,e){return s==="core"&&e==="classic"?"sidebar":"dock"}function yc(s,e){return s.locked?"rail":e[s.id]??s.defaultPlacement??_c[s.kind]}function xc(s){return s.map((e,t)=>({item:e,index:t})).sort((e,t)=>(e.item.order??0)-(t.item.order??0)||e.index-t.index).map(e=>e.item)}function kc(){return window.wp?.os??null}function ao(){return kc()?.getNavItems?.()??[]}const lo="none",cr=J("desktop-mode/unfocus-effect-registry",()=>({registry:new Map,listeners:new Set})),dr=cr.state.registry,co=cr.state.listeners,ur=/^[a-z0-9_/-]+$/;function uo(s){const e=[];!s||typeof s!="object"?e.push("def (not an object)"):(typeof s.id!="string"||s.id.trim()===""?e.push("id (missing)"):ur.test(s.id.trim().toLowerCase())?s.id.trim().toLowerCase()===lo&&e.push('id ("none" is reserved)'):e.push(`id (must match ${ur} — lowercase alphanum, hyphens, underscores, slashes for vendor/sub-id)`),(typeof s.label!="string"||s.label.trim()==="")&&e.push("label (missing)"),typeof s.className!="string"&&typeof s.apply!="function"&&e.push("className|apply (at least one must be provided — a CSS class to toggle or an apply callback)")),Xs("UnfocusEffect",e,s);const t=s.id.trim().toLowerCase();dr.set(t,{...s,id:t}),Ac()}function ho(){const s=Array.from(dr.values()),e=fe(V.UNFOCUS_EFFECTS,s);return Array.isArray(e)?e:(typeof console<"u"&&console.warn("[openstation] `os.unfocus-effects` filter returned a non-array; falling back to registry list."),s)}function $c(s){return co.add(s),()=>{co.delete(s)}}function Ac(){const s=Array.from(co);for(const e of s)try{e()}catch(t){typeof console<"u"&&console.error("[openstation] unfocus-effect registry listener threw:",t)}}uo({id:"darken",label:d("Darken"),description:d("Dim unfocused windows so the focused one stands out."),className:"os-window--fx-darken"}),uo({id:"frost",label:d("Frost"),description:d("Throw unfocused windows out of focus — a soft, frosted-glass blur, as if you were looking at them through an iced-over pane."),className:"os-window--fx-frost"}),uo({id:"grayscale",label:d("Grayscale"),description:d("Drain the colour from unfocused windows so the focused one is the only thing still in colour — your eye snaps right to it."),className:"os-window--fx-grayscale"});const hr="none",pr=J("desktop-mode/window-link-renderer-registry",()=>({registry:new Map,listeners:new Set})),Ec=pr.state.registry,gr=pr.state.listeners;function po(){const s=Array.from(Ec.values()),e=fe(V.WINDOW_LINK_RENDERERS,s);return Array.isArray(e)?e:(typeof console<"u"&&console.warn("[openstation] `os.window-links.renderers` filter returned a non-array; falling back to registry list."),s)}function Sc(s){return gr.add(s),()=>{gr.delete(s)}}const fr=J("desktop-mode/wallpaper-registry",()=>({seed:[],listeners:new Set})),_s=fr.state.seed,go=fr.state.listeners;function br(s){Xs("Wallpaper",Sn(s,mr),s);const e=_s.findIndex(t=>t.id===s.id);e>=0?_s[e]=s:_s.push(s),Ic()}function Cc(s){return go.add(s),()=>{go.delete(s)}}function Ic(){const s=Array.from(go);for(const e of s)try{e()}catch(t){typeof console<"u"&&console.error("[openstation] wallpaper registry listener threw:",t)}}function Ae(){const s=_s.slice(),e=fe(V.WALLPAPERS,s);return Array.isArray(e)?e.filter(Rc):(typeof console<"u"&&console.warn("[openstation] `os.wallpapers` filter returned a non-array; falling back to seed list."),s)}function ze(s){return Ae().find(e=>e.id===s)}const mr=[{field:"id",message:"missing or not a non-empty string",valid:s=>typeof s.id=="string"&&s.id!==""},{field:"label",message:"missing or not a non-empty string",valid:s=>typeof s.label=="string"&&s.label!==""},{field:"preview",message:"missing or not a non-empty string",valid:s=>typeof s.preview=="string"&&s.preview!==""},{field:"type",message:'must be "css" or "canvas"',valid:s=>s.type==="css"||s.type==="canvas"},{field:"value/resolveValue/mount",message:"css types need `value` or `resolveValue`; canvas types need `mount`",valid:s=>s.type==="css"?typeof s.value=="string"||typeof s.resolveValue=="function":s.type==="canvas"?typeof s.mount=="function":!0}];function Rc(s){return Sn(s,mr).length===0}const Lc={desktopLayout:["unified","classic"],dockPlacement:["bottom","left","right"],dockBehavior:["static","dynamic"],sideDockBehavior:["static","dynamic"],dockSize:["compact","default","large"],windowRadius:["sharp","default","round"],adminBarMode:["static","dynamic","hidden"],windowLinkVisibility:["always","focus","off"],mobileLayout:["auto","desktop","mobile"],heartbeatRate:[15,30,45,60]},Tc=["mioApiEnabled","mioShowOnWallpaper","windowLinksEnabled","windowLinkRaiseOnFocus","windowLinkHighlight","showDesktopOnWallpaperClick","showPostStatusRibbons","developerModeEnabled","foldersSharingEnabled","stationHomeEnabled","nativePostsEnabled","nativePagesEnabled","nativeUsersEnabled","nativePluginsEnabled","nativeCommentsEnabled","confirmCloseAllWindows","libraryHdOnly"];function fo(){return{...Lc,accent:[...De().map(s=>s.id),"custom"],desktopTheme:["",...no().map(s=>s.slug)],wallpaper:Ae().map(s=>s.id),dockRailRenderer:Gs().map(s=>s.id),unfocusEffect:["none",...ho().map(s=>s.id)],windowReveal:["none",...io().map(s=>s.id)],windowLinkRenderer:["none",...po().map(s=>s.id)]}}function vr(){return ao().filter(s=>!s.locked&&!s.transient&&(s.menu||s.entry||s.tile?.placeable))}function _r(){return ao().filter(s=>!s.locked&&!s.transient&&!!(s.windowId||s.tile||s.menu?.url||s.entry?.url))}async function Dc(){return await tc(),{choices:fo(),themes:[{id:"",name:"OpenStation",description:"Built-in dark OpenStation palette.",surface:"#15151e"},...no().map(s=>({id:s.slug,name:s.name,description:s.description,surfaces:Object.fromEntries(Object.entries(s.tokens).filter(([e])=>/(?:surface|bg|backstop)$/.test(e)).slice(0,12)),recommendations:s.recommendedOsSettings}))],accents:De(),wallpapers:Ae().map(s=>({id:s.id,label:s.label,configurable:!!s.renderConfig})),dockRenderers:Gs().map(s=>({id:s.id,label:s.label})),unfocusEffects:ho().map(s=>({id:s.id,label:s.label})),reveals:io().map(s=>({id:s.id,label:s.label})),linkRenderers:po().map(s=>({id:s.id,label:s.label})),navigation:vr().map(s=>({id:s.id,title:s.title})),phonePins:_r().map(s=>({id:s.id,title:s.title}))}}function wr(s,e,t){const o=JSON.parse(JSON.stringify(P()));return new Promise((i,n)=>{let r=!1;const a=p=>{if(!r)if(r=!0,clearTimeout(h),document.removeEventListener("os-settings-save-lifecycle",u),e.removeEventListener("abort",l),p)n(p);else{const g=P(),b=Object.keys(g).flatMap(m=>{const x=m;return JSON.stringify(o[x])===JSON.stringify(g[x])?[]:[{setting:x,before:o[x],after:g[x]}]});i({saved:!0,changed:b.length>0,changes:b,settings:t})}},l=()=>a(new DOMException("Cancelled; a submitted save may still finish.","AbortError")),u=p=>{const g=p.detail;if(g.phase==="failed")a(new Error(g.error||"Preferences could not be saved."));else if(g.phase==="saved"){const b=P(),m=!t||Object.entries(t).every(([k,f])=>JSON.stringify(b[k])===JSON.stringify(f)),x=g.savedSettings,y=x&&Object.entries(t??b).every(([k,f])=>JSON.stringify(x[k])===JSON.stringify(f));if(m&&!y)return;a(m?void 0:new Error("The setting changed during this request. Review Preferences."))}},h=setTimeout(()=>a(new Error("Save confirmation timed out. Changes may still be saving; review Preferences.")),2e4);if(document.addEventListener("os-settings-save-lifecycle",u),e.addEventListener("abort",l,{once:!0}),e.aborted){l();return}try{s()}catch(p){a(p instanceof Error?p:new Error(String(p)))}})}const Pc={wind:{min:0,max:80},particleCount:{min:100,max:2e3},flakeSize:{min:6,max:40}},yr=J("desktop-mode/wallpaper-settings",()=>({values:{}}));function xr(s){return{...yr.state.values[s]??{}}}function kr(s,e){yr.state.values[s]={...e},be(V.WALLPAPER_SETTINGS_CHANGED,{id:s,settings:{...e}})}function c(s,...e){return{__wpdHtml:!0,strings:s,values:e}}function Nc(s){return!!s&&s.__wpdHtml===!0}const Mc="$$wpd$$",U=/\$\$wpd\$\$(\d+)\$\$/g,zc="$$wpd-node$$",Oc=/^\$\$wpd-node\$\$(\d+)\$\$$/,Wc=new Set(["style","script","textarea","title"]);function Hc(s){let e="",t=!1,o=null,i=!1,n=null,r="",a=!1;for(let l=0;l<s.length;l++){const u=s[l];e+=u;for(let h=0;h<u.length;h++){const p=u[h];if(i){u.startsWith("-->",h)&&(i=!1,h+=2);continue}if(n!==null){p==="<"&&u[h+1]==="/"&&u.slice(h+2,h+2+n.length).toLowerCase()===n&&(h+=1+n.length,n=null,t=!0,a=!1,r="");continue}if(o!==null){p===o&&(o=null);continue}if(t){p==='"'||p==="'"?(o=p,a=!1):p===">"?(t=!1,a=!1,Wc.has(r)&&(n=r),r=""):a&&(/[a-zA-Z0-9-]/.test(p)?r+=p.toLowerCase():a=!1);continue}if(u.startsWith("<!--",h)){i=!0,h+=3;continue}const g=u[h+1]??"";p==="<"&&/[a-zA-Z/!]/.test(g)&&(t=!0,r="",a=/[a-zA-Z]/.test(g))}l<s.length-1&&(e+=t||i||n!==null?`${Mc}${l}$$`:`<!--${zc}${l}$$-->`)}return e}const $r=new WeakMap;function Ar(s){const e=$r.get(s);if(e)return e;const t=document.createElement("template");t.innerHTML=Hc(s);const o=[],i=(a,l)=>{if(a.nodeType===Node.ELEMENT_NODE){const p=a;for(const g of Array.from(p.attributes)){const b=g.name,m=g.value,x=b[0];if(U.test(m))if(U.lastIndex=0,x==="@"){const y=U.exec(m);U.lastIndex=0,o.push({path:l,kind:"event",name:b.slice(1),valueIndex:y?Number(y[1]):0}),p.removeAttribute(b)}else if(x==="."){const y=U.exec(m);U.lastIndex=0,o.push({path:l,kind:"prop",name:b.slice(1),valueIndex:y?Number(y[1]):0}),p.removeAttribute(b)}else if(x==="?"){const y=U.exec(m);U.lastIndex=0,o.push({path:l,kind:"bool",name:b.slice(1),valueIndex:y?Number(y[1]):0}),p.removeAttribute(b)}else{const y=[],k=[];let f=0,A;for(U.lastIndex=0;(A=U.exec(m))!==null;)y.push(m.slice(f,A.index)),k.push(Number(A[1])),f=A.index+A[0].length;y.push(m.slice(f)),o.push({path:l,kind:"attr",name:b,template:y,valueIndices:k}),p.setAttribute(b,"")}}}const u=Array.from(a.childNodes);let h=0;for(let p=0;p<u.length;p++){const g=u[p],b=p+h;if(g.nodeType===Node.COMMENT_NODE){const m=Oc.exec(g.data);if(m){const x=document.createTextNode("");g.parentNode.replaceChild(x,g),o.push({path:[...l,b],kind:"node",valueIndex:Number(m[1])})}continue}if(g.nodeType===Node.TEXT_NODE){const m=g.textContent||"";if(!U.test(m)){U.lastIndex=0;continue}U.lastIndex=0;const x=g.parentNode;let y=0,k;const f=[],A=[];for(U.lastIndex=0;(k=U.exec(m))!==null;){k.index>y&&f.push(document.createTextNode(m.slice(y,k.index)));const $=document.createTextNode("");f.push($),A.push({path:[...l,b+f.length-1],kind:"node",valueIndex:Number(k[1])}),y=k.index+k[0].length}y<m.length&&f.push(document.createTextNode(m.slice(y)));for(const $ of f)x.insertBefore($,g);x.removeChild(g),h+=f.length-1,o.push(...A)}else i(g,[...l,b])}};i(t.content,[]);const r={template:t,buildParts:a=>{const l=[];for(const u of o){let h=a;for(const p of u.path)h=h.childNodes[p];u.kind==="node"?l.push({kind:"node",valueIndex:u.valueIndex,child:{anchor:h,state:null}}):u.kind==="attr"?l.push({kind:"attr",element:h,name:u.name,template:u.template,valueIndices:u.valueIndices}):u.kind==="event"?l.push({kind:"event",valueIndex:u.valueIndex,element:h,name:u.name}):u.kind==="prop"?l.push({kind:"prop",valueIndex:u.valueIndex,element:h,name:u.name}):u.kind==="bool"&&l.push({kind:"bool",valueIndex:u.valueIndex,element:h,name:u.name})}return l}};return $r.set(s,r),r}const Er=new WeakMap;function Uc(s,e){for(const t of s.nodes)if(t.parentNode!==e)return!1;return!0}function Ee(s,e){const t=Er.get(e);if(t&&t.strings===s.strings&&Uc(t,e)){ws(t.parts,s.values);return}const o=Ar(s.strings),i=o.template.content.cloneNode(!0),n=o.buildParts(i),r=Array.from(i.childNodes);for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(i),ws(n,s.values),Er.set(e,{strings:s.strings,parts:n,nodes:r})}function ws(s,e){for(const t of s)if(t.kind==="node")ys(t.child,e[t.valueIndex]);else if(t.kind==="attr"){let o=t.template[0];for(let i=0;i<t.valueIndices.length;i++)o+=Sr(e[t.valueIndices[i]]),o+=t.template[i+1];o!==t.last&&(t.last=o,o===""?t.element.removeAttribute(t.name):t.element.setAttribute(t.name,o))}else if(t.kind==="event"){const o=e[t.valueIndex];o!==t.current&&(t.current&&t.element.removeEventListener(t.name,t.current),o&&t.element.addEventListener(t.name,o),t.current=o)}else if(t.kind==="prop"){const o=e[t.valueIndex];o!==t.last&&(t.last=o,t.element[t.name]=o)}else if(t.kind==="bool"){const o=!!e[t.valueIndex];o!==t.last&&(t.last=o,o?t.element.setAttribute(t.name,""):t.element.removeAttribute(t.name))}}function ys(s,e){if(e==null||e===!1){s.state&&(ce(s.state),s.state=null);return}if(Array.isArray(e)){jc(s,e);return}if(Nc(e)){Vc(s,e);return}if(e instanceof Node){qc(s,e);return}Fc(s,Sr(e))}function qc(s,e){const t=s.state;t?.shape==="node"&&t.node===e||(t&&ce(t),Oe(s,[e]),s.state={shape:"node",node:e})}function Fc(s,e){const t=s.state;if(t?.shape==="text"){t.text!==e&&(t.node.textContent=e,t.text=e);return}t&&ce(t);const o=document.createTextNode(e);Oe(s,[o]),s.state={shape:"text",node:o,text:e}}function Vc(s,e){const t=s.state;if(t?.shape==="template"&&t.strings===e.strings){ws(t.parts,e.values);return}t&&ce(t);const o=Ar(e.strings),i=o.template.content.cloneNode(!0),n=o.buildParts(i),r=Array.from(i.childNodes);Oe(s,[i]),ws(n,e.values),s.state={shape:"template",strings:e.strings,parts:n,nodes:r}}function jc(s,e){const t=s.state;if(t?.shape==="array"){const i=Math.min(t.entries.length,e.length);for(let n=0;n<i;n++)ys(t.entries[n],e[n]);if(e.length<t.entries.length){for(let n=e.length;n<t.entries.length;n++){const r=t.entries[n];r.state&&ce(r.state),r.anchor.remove()}t.entries.length=e.length}else for(let n=t.entries.length;n<e.length;n++){const r=document.createTextNode("");Oe(s,[r]);const a={anchor:r,state:null};ys(a,e[n]),t.entries.push(a)}return}t&&ce(t);const o=[];for(const i of e){const n=document.createTextNode("");Oe(s,[n]);const r={anchor:n,state:null};ys(r,i),o.push(r)}s.state={shape:"array",entries:o}}function Oe(s,e){const t=s.anchor.parentNode;if(t)for(const o of e)t.insertBefore(o,s.anchor)}function ce(s){if(s.shape==="text"){s.node.remove();return}if(s.shape==="template"){for(const e of s.parts)e.kind==="node"&&e.child.state&&(ce(e.child.state),e.child.state=null);for(const e of s.nodes)e.parentNode&&e.parentNode.removeChild(e);return}if(s.shape==="node"){s.node.parentNode&&s.node.parentNode.removeChild(s.node);return}for(const e of s.entries)e.state&&ce(e.state),e.anchor.remove()}function Sr(s){return s==null||s===!1?"":String(s)}function Kc(s,e){const t=e.local??{},o={id:s,hasLocal:r=>Object.prototype.hasOwnProperty.call(t,r),runLocal:(r,a,l,u)=>{const h=t[r];if(!h)return a;const p={...a},g=h(p,l,u);return g===void 0?p:g},render:r=>{Ee(e.view(r),r.root),e.updated?.(r)},mounted:r=>e.mounted?.(r)},{placeholder:i}=e;i&&(o.placeholder=r=>i(r));const n=window;return(n.openStationApps??(n.openStationApps={}))[s]=o,o}const Cr=J("desktop-mode/settings-tab-registry",()=>({registry:new Map,listeners:new Set})),Bc=Cr.state.registry,Ir=Cr.state.listeners;function Gc(){return Array.from(Bc.values()).sort((s,e)=>(s.order??100)-(e.order??100))}function Xc(s){return Ir.add(s),()=>{Ir.delete(s)}}function Zc(s,e){switch(s){case"starlight":return d("Starlight");case"wp-blue":return d("WordPress Blue");case"indigo":return d("Indigo");case"teal":return d("Teal");case"emerald":return d("Emerald");case"amber":return d("Amber");case"rose":return d("Rose");default:return e}}function Yc(s,e){switch(s){case"compact":return d("Compact");case"default":return d("Default");case"large":return d("Large");default:return e}}function Jc(s,e){switch(s){case"sharp":return d("Sharp");case"default":return d("Default");case"round":return d("Round");default:return e}}function Qc(s,e){switch(s){case"static":return d("Static");case"dynamic":return d("Dynamic");case"hidden":return d("Hidden");default:return e}}function ed(s,e){switch(s){case"static":return d("Static");case"dynamic":return d("Dynamic");default:return e}}function td(s,e){switch(s){case"bottom":return d("Bottom");case"left":return d("Left");case"right":return d("Right");default:return e}}function sd(s,e){switch(s){case"classic":return d("Split");case"unified":return d("Unified");default:return e}}function od(s){switch(s){case"classic":return d("Core admin menus are placed in a sidebar; plugins, apps, and OpenStation controls in a dock along the bottom edge.");case"unified":return d("Every menu in a single dock.");default:return""}}const id=()=>({editor:{id:"",teardown:null},previews:null,imagePickerOpen:!1,imageSource:"",library:{query:"",page:0,totalPages:0,loaded:[],loading:!1,error:"",searchTimer:null,uploadError:"",uploading:!1,dragover:!1},themes:{error:"",busy:!1},features:{purging:!1,resetting:!1,extendedSaving:!1,extendedError:""},components:{entries:null,activeTag:"",query:"",paintedTag:""},about:null,search:{query:"",index:null},mountedTabs:new WeakMap,glyphs:new Map}),de=s=>s.extra,S=s=>s.ui(id),Rr=s=>s.detail??{},W=s=>String(Rr(s).value??""),q=s=>Rr(s).checked===!0,nd="conic-gradient( #f252fc, #9af2ff, #93f0c6, #f8f2b6, #ff5a5a, #f252fc )";function rd(s){const e=s.querySelector(".os-settings__accent-picker");if(e)try{e.showPicker()}catch{e.click()}}const ad=s=>{const e=s.accent===Te,t=i=>{const n=W(i);n!==Te&&!De().some(r=>r.id===n)||(E({accent:n}),n===Te&&rd(i.currentTarget))},o=i=>{const n=i.target.value;/^#[0-9a-fA-F]{6}$/.test(n)&&E({customAccent:n,accent:Te})};return c`
2 <os-section
3 heading=${d("Accent color")}
4 description=${d("Used in focused window title bars, buttons, and focus rings.")}
5 >
6 <os-swatch-grid label=${d("Accent color")} mode="row" @os-pick=${t}>
7 ${De().map(i=>c`<os-swatch
8 value=${i.id}
9 label=${Zc(i.id,i.label)}
10 preview=${i.value}
11 size="small"
12 variant="accent"
13 ?selected=${s.accent===i.id}
14 ></os-swatch>`)}
15 <span class="os-settings__accent-custom">
16 <os-swatch
17 value=${Te}
18 label=${d("Custom")}
19 preview=${e?s.customAccent:nd}
20 size="small"
21 variant="accent"
22 ?selected=${e}
23 ></os-swatch>
24 <input
25 type="color"
26 class="os-settings__accent-picker"
27 tabindex="-1"
28 aria-hidden="true"
29 .value=${s.customAccent}
30 @input=${o}
31 />
32 </span>
33 </os-swatch-grid>
34 </os-section>
35 `},ld={unified:[{kind:"win",style:"left:12%;top:14%;width:44%;height:42%"},{kind:"win",style:"left:30%;top:30%;width:44%;height:42%"},{kind:"bar",rail:"dock",style:"left:24%;bottom:10%;width:52%;height:9%"}],classic:[{kind:"bar",rail:"sidebar",style:"left:0;top:0;bottom:0;width:5%"},{kind:"win",style:"left:14%;top:14%;width:44%;height:42%"},{kind:"win",style:"left:32%;top:30%;width:44%;height:42%"},{kind:"bar",rail:"dock",style:"left:33%;bottom:10%;width:38%;height:9%"}]},We=(s,e)=>t=>{const o=W(t);s.some(i=>i.id===o)&&e(o)},Lr=()=>js.map(s=>c`<os-segment value=${s.id}>${ed(s.id,s.label)}</os-segment>`),cd=s=>d(s==="dynamic"?"The dock folds into a thin line at its edge of the screen and comes back when you move the pointer there. Windows can use the whole desktop.":"The dock is always visible, and windows open above it."),dd=s=>{const e=r=>a=>{a.target.closest(".os-settings__dock-option")||E({desktopLayout:r})},t=r=>{const a=["os-settings__layout-card"];return s.dockBehavior==="dynamic"&&a.push("is-dock-dynamic"),r==="classic"&&s.sideDockBehavior==="dynamic"&&a.push("is-sidebar-dynamic"),a.join(" ")},o=(r,a,l,u="")=>c`<div class="os-settings__dock-option">
36 <span class="os-settings__dock-option-label" id=${r}>${a}</span>
37 ${l}
38 ${u?c`<span class="os-settings__dock-option-hint">${u}</span>`:""}
39 </div>`,i=()=>c`<div class="os-settings__dock-options">
40 ${o("os-settings-dock-placement-label",d("Placement"),c`<os-segmented
41 value=${s.dockPlacement}
42 label=${d("Dock position")}
43 @os-pick=${We(gn,r=>E({dockPlacement:r}))}
44 >
45 ${gn.map(r=>c`<os-segment value=${r.id}>${td(r.id,r.label)}</os-segment>`)}
46 </os-segmented>`)}
47 </div>`,n=()=>c`<div class="os-settings__dock-options">
48 ${o("os-settings-side-dock-behavior-label",d("Sidebar behavior"),c`<os-segmented
49 value=${s.sideDockBehavior}
50 label=${d("Sidebar behavior")}
51 @os-pick=${We(js,r=>E({sideDockBehavior:r}))}
52 >
53 ${Lr()}
54 </os-segmented>`)}
55 </div>`;return c`
56 <!-- The id is a deep-link target: the shell tour's layout card
57 scrolls to it, because this section sits below a fourteen-tile
58 wallpaper grid and landing on the page alone never shows it. -->
59 <os-section id="os-settings-layout" heading=${d("Desktop layout")} description=${d("Where the menus live.")}>
60 <div class="os-settings__layout-grid" role="radiogroup" aria-label=${d("Desktop layout")}>
61 ${hl.map(r=>{const a=s.desktopLayout===r.id;return c`<div class=${t(r.id)} @click=${e(r.id)}>
62 <button
63 type="button"
64 class="os-settings__layout-choice"
65 role="radio"
66 aria-checked=${a?"true":"false"}
67 >
68 <span class="os-settings__layout-preview" aria-hidden="true">
69 ${(ld[r.id]??[]).map(l=>c`<span
70 class="os-settings__layout-${l.kind}${l.rail?` is-accent is-${l.rail}`:""}"
71 style=${l.style}
72 ></span>`)}
73 </span>
74 <span class="os-settings__layout-name">${sd(r.id,r.label)}</span>
75 <span class="os-settings__layout-desc">${od(r.id)}</span>
76 </button>
77 ${r.id==="classic"?n():i()}
78 </div>`})}
79 </div>
80 <div class="os-settings__dock-options os-settings__dock-options--page">
81 ${o("os-settings-dock-size-label",d("Dock size"),c`<os-segmented
82 value=${s.dockSize}
83 label=${d("Dock size")}
84 @os-pick=${We(un,r=>E({dockSize:r}))}
85 >
86 ${un.map(r=>c`<os-segment value=${r.id}>${Yc(r.id,r.label)}</os-segment>`)}
87 </os-segmented>`)}
88 ${o("os-settings-dock-behavior-label",d("Dock behavior"),c`<os-segmented
89 value=${s.dockBehavior}
90 label=${d("Dock behavior")}
91 @os-pick=${We(js,r=>E({dockBehavior:r}))}
92 >
93 ${Lr()}
94 </os-segmented>`,cd(s.dockBehavior))}
95 </div>
96 </os-section>
97 `},ud=s=>{const e=Gs();return e.length<=1?c``:c`
98 <os-section
99 heading=${d("Dock style")}
100 description=${d("How the rail itself paints — the shipped icon strip, or anything a plugin replaces it with. Switching is instant; the dock rebuilds with the new renderer.")}
101 >
102 <os-segmented
103 value=${s.dockRailRenderer}
104 label=${d("Dock style")}
105 @os-pick=${t=>{const o=W(t);o!==""&&E({dockRailRenderer:o})}}
106 >
107 ${e.map(t=>c`<os-segment value=${t.id}>${t.label}</os-segment>`)}
108 </os-segmented>
109 </os-section>
110 `};function hd(s){switch(s){case"dynamic":return d("The admin bar slides out of the way and comes back when you move the pointer to the top edge of the screen.");case"hidden":return d("The admin bar is never shown. Use the Exit OpenStation tile on the dock to get back to the classic admin.");default:return d("The admin bar is always visible above the desktop.")}}const pd=s=>c`
111 <os-section heading=${d("Admin bar")} description=${hd(s.adminBarMode)}>
112 <os-segmented
113 value=${s.adminBarMode}
114 label=${d("Admin bar")}
115 @os-pick=${We(pn,e=>E({adminBarMode:e}))}
116 >
117 ${pn.map(e=>c`<os-segment value=${e.id}>${Qc(e.id,e.label)}</os-segment>`)}
118 </os-segmented>
119 </os-section>
120 `;function gd(s,e,t){return c`
121 ${ad(s)}
122 ${e}
123 ${dd(s)}
124 ${ud(s)}
125 ${pd(s)}
126 `}const pe=class pe 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(Tr)}connectedCallback(){this._adoptStyles(),this.requestUpdate()}attributeChangedCallback(e,t,o){if(t===o)return;const i=fd(e);this._propValues[i]=o,this.requestUpdate()}get classNames(){return Array.from(this.classList)}set classNames(e){if(e==null){this.removeAttribute("class");return}const o=(Array.isArray(e)?e:String(e).split(/\s+/)).map(i=>String(i).trim()).filter(i=>i!=="");this.className=o.join(" ")}requestUpdate(){this._scheduleRender()}emit(e,t){return this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}_installPropAccessors(){const e=this.constructor;for(const t of e.props){if(Object.getOwnPropertyDescriptor(this,t))continue;const o=Tr(t);Object.defineProperty(this,t,{get:()=>t in this._propValues?this._propValues[t]:this.getAttribute(o),set:i=>{let n;i==null||i===!1?n=null:i===!0?n="":n=String(i),this._propValues[t]=n,n===null?this.removeAttribute(o):this.setAttribute(o,n),this.requestUpdate()},enumerable:!0,configurable:!0})}}_scheduleRender(){this._renderScheduled||!this.isConnected||(this._renderScheduled=!0,queueMicrotask(()=>{this._renderScheduled=!1,this.isConnected&&Ee(this.render(),this._renderRoot)}))}_adoptStyles(){const e=this.constructor;if(e.styles.length!==0)if(e.shadow&&this.shadowRoot){const t=e.styles.map(o=>o.sheet).filter(o=>o!==null);if(this.shadowRoot.adoptedStyleSheets=t,t.length!==e.styles.length){for(const o of e.styles)if(!o.sheet){const i=document.createElement("style");i.textContent=o.cssText,this.shadowRoot.appendChild(i)}}}else this._adoptLightStyles(e)}_adoptLightStyles(e){if(!pe._lightStylesAdopted.has(e)){pe._lightStylesAdopted.add(e);for(const t of e.styles){const o=document.createElement("style");o.dataset.osUi=this.tagName.toLowerCase(),o.textContent=t.cssText,document.head.appendChild(o)}}}};pe.props=[],pe.styles=[],pe.shadow=!0,pe._lightStylesAdopted=new WeakSet;let _=pe;function w(s,e){customElements.get(s)||customElements.define(s,e)}function Tr(s){return s.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}function fd(s){return s.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}const bd=(()=>{try{return typeof new CSSStyleSheet().replaceSync=="function"}catch{return!1}})();function v(s,...e){let t=s[0];for(let o=1;o<s.length;o++){const i=e[o-1];if(typeof i=="string"||typeof i=="number")t+=String(i);else if(i&&i.__wpdCss)t+=i.cssText;else throw new TypeError("[os-ui] css`` interpolations must be strings, numbers, or other css`` results. Got: "+typeof i);t+=s[o]}if(bd){const o=new CSSStyleSheet;return o.replaceSync(t),{__wpdCss:!0,sheet:o,cssText:t}}return{__wpdCss:!0,sheet:null,cssText:t}}function md(s){const e=[],t=[];let o=null,i=s.parentElement;for(;i&&!(i===document.body||i===document.documentElement);){const r=i.id||"";if(r.startsWith("wp-window-")){o=r.slice(10);break}if(i.tagName.toLowerCase()==="os-tabpanel"){const a=i.getAttribute("for");a&&t.unshift(a)}i=i.parentElement}o&&e.push(bo(o));for(const r of t)e.push("tab-"+bo(r));const n=s.getAttribute("label");return n&&e.push(bo(n)),e.length===0?"os-unnamed":"os-"+e.filter(r=>r!=="").join("-")}function bo(s){return s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function He(s){if(s.id)return s.id;const e=md(s);return s.id=e,e}const C=v`: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 ) )}`,vd=v` .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%}}`,xs=v` .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%}}`,Dr=v` .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}}`,ks=v` .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}}`,mo=v` .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}}`,Pr=v` .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%}}`,vo=v` .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}}`,_o=v` 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}}`,$s=v` 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}}`,Nr=v` @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}}`;v` ${C} ${vd} ${xs} ${Dr} ${ks} ${mo} ${Pr} ${vo} ${_o} ${$s} ${Nr} `;const _d=v` ${C}: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;--os-ui-fg:var( --os-ui-modal-text,#f0f0f1 );--os-ui-fg-muted:var( --os-ui-modal-text-muted,#a7aaad );--os-ui-border:var( --os-ui-modal-border,rgba( 255,255,255,0.25 ) );--os-window-bg:var( --os-ui-modal-field-bg,#2c3338 );--os-ui-button-bg-hover:var( --os-ui-modal-button-bg-hover,rgba( 255,255,255,0.08 ) );--os-ui-surface:var( --os-ui-modal-surface,#2c3338 );--os-ui-surface-elevated:var( --os-ui-modal-surface-elevated,#3c434a );--os-ui-border-strong:var( --os-ui-modal-border-strong,rgba( 255,255,255,0.35 ) );--os-ui-hover:var( --os-ui-modal-hover,rgba( 255,255,255,0.08 ) );--os-ui-notice-color:var( --os-ui-modal-text,#f0f0f1 );--os-ui-card-bg:var( --os-ui-modal-surface,#2c3338 );--os-ui-card-fg:var( --os-ui-modal-text,#f0f0f1 );--os-ui-card-border:var( --os-ui-modal-border,rgba( 255,255,255,0.25 ) );--os-ui-card-border-hover:var( --os-ui-modal-border-strong,rgba( 255,255,255,0.35 ) )}:host( [ open ] ){display:flex;animation:os-modal-scrim var( --_holo-t ) var( --_holo-ease )}:host( [ open ] ) .dialog{animation:os-modal-dialog var( --_holo-t ) var( --_holo-spring )}@keyframes os-modal-scrim{from{opacity:0}}@keyframes os-modal-dialog{from{opacity:0;transform:scale( 0.96 ) translateY( 8px )}}@media ( prefers-reduced-motion:reduce ){:host( [ open ] ),:host( [ open ] ) .dialog{animation:none}}.dialog{max-width:92vw;max-height:90vh;background-color:var( --os-ui-modal-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-modal-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 );display:flex;flex-direction:column;overflow:hidden}:host( [ size='sm' ] ) .dialog{width:min( 360px,92vw )}:host(:not( [ size ] ) ) .dialog,:host( [ size='md' ] ) .dialog{width:min( 540px,92vw )}:host( [ size='lg' ] ) .dialog{width:min( 760px,94vw )}.header{display:flex;align-items:center;gap:10px;padding:16px 20px 12px;border-bottom:1px solid var( --os-ui-border,rgba( 255,255,255,0.06 ) )}.title{margin:0;flex:1;font-size:15px;font-weight:600}.header-actions{display:flex;gap:6px}.header-actions::slotted( * ){margin-inline-start:6px}.close{background:transparent;border:0;color:inherit;font-size:18px;line-height:1;padding:4px 8px;border-radius:4px;cursor:pointer;opacity:0.7}.close:hover{opacity:1;background:var( --os-ui-hover,rgba( 255,255,255,0.08 ) )}.body{padding:16px 20px;overflow:auto;flex:1 1 auto;font-size:13px;line-height:1.5}.footer{padding:12px 20px 16px;border-top:1px solid var( --os-ui-border,rgba( 255,255,255,0.06 ) )}.footer slot{display:flex;justify-content:flex-end;gap:10px;flex-wrap:wrap}:host( [ mandatory ] ) .close{display:none}`,Mr='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])',Be=class Be extends _{constructor(){super(...arguments),this._prevFocus=null,this._onKey=e=>{if(e.key==="Escape"&&!this.hasAttribute("mandatory")){e.preventDefault(),this._cancel();return}if(e.key==="Tab"){const t=this._focusables();if(t.length===0)return;const o=t[0],i=t[t.length-1],n=this.ownerDocument,r=n?n.activeElement:null,a=e.composedPath()[0]||r;e.shiftKey&&a===o?(e.preventDefault(),i.focus()):!e.shiftKey&&a===i&&(e.preventDefault(),o.focus())}},this._onBackdrop=e=>{if(this.hasAttribute("mandatory"))return;const t=e.composedPath();(t.length>0?t[0]:e.target)===this&&this._cancel()}}connectedCallback(){super.connectedCallback(),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.addEventListener("keydown",this._onKey),this.addEventListener("click",this._onBackdrop)}disconnectedCallback(){this.removeEventListener("keydown",this._onKey),this.removeEventListener("click",this._onBackdrop)}attributeChangedCallback(e,t,o){if(super.attributeChangedCallback?.(e,t,o),e==="open"){if(o!==null){const i=this.ownerDocument;this._prevFocus=i?i.activeElement:null,queueMicrotask(()=>this._focusFirst())}else if(this._prevFocus){try{this._prevFocus.focus()}catch{}this._prevFocus=null}}}showModal(){this.setAttribute("open","")}hideModal(){this.removeAttribute("open")}_focusables(){const e=this.shadowRoot;if(!e)return[];const t=Array.from(this.querySelectorAll(Mr)),o=Array.from(e.querySelectorAll(Mr));return[...t,...o].filter(i=>i.offsetParent!==null||i.tagName==="BUTTON")}_focusFirst(){const e=this._focusables();e.length>0?e[0].focus():this.shadowRoot?.querySelector(".dialog")?.focus?.()}_cancel(){const e=new CustomEvent("os-modal-cancel",{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(e)&&this.hideModal()}render(){const e=this.getAttribute("title")??"",t=this.hasAttribute("mandatory");return c`
127 <div part="dialog" class="dialog" tabindex="-1">
128 ${e?c`
129 <div class="header">
130 <h2 class="title">${e}</h2>
131 <div class="header-actions">
132 <slot name="header-actions"></slot>
133 ${t?c``:c`<button
134 type="button"
135 class="close"
136 aria-label="Close"
137 @click=${()=>this._cancel()}
138 >×</button>`}
139 </div>
140 </div>
141 `:c``}
142 <div class="body">
143 <slot></slot>
144 </div>
145 <div class="footer">
146 <slot name="footer"></slot>
147 </div>
148 </div>
149 `}};Be.props=["open","title","size","mandatory"],Be.styles=[_d],Be.help=void 0;let wo=Be;w("os-modal",wo);const wd=v` ${C} ${xs} ${Dr} ${ks} ${mo} ${Nr}: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 )}}`,Ge=class Ge extends _{static get observedAttributes(){return[...super.observedAttributes,"aria-label"]}render(){const e=this.disabled!==null,t=this.busy!==null,o=this.type||"button",i=this.getAttribute("aria-label")||"";return c`
150 <button
151 part="button"
152 class="os-holo-edge os-holo-sheen"
153 type=${o}
154 ?disabled=${e||t}
155 aria-busy=${t?"true":"false"}
156 aria-label=${i}
157 >
158 ${t?c`<span class="os-button__spinner" aria-hidden="true"></span>`:""}
159 <slot></slot>
160 <!--
161 The two motion layers. Elements rather than
162 pseudo-elements because the sheen and the hairline
163 have already taken this button's ::before and
164 ::after — see the pseudo-element budget note in
165 src/ui/holo.ts. Both are inert and aria-hidden.
166 -->
167 <span class="os-holo-glint" aria-hidden="true"></span>
168 <span class="os-holo-ring" aria-hidden="true"></span>
169 </button>
170 `}};Ge.props=["variant","disabled","type","busy","fill-cell"],Ge.styles=[wd],Ge.help=void 0;let yo=Ge;w("os-button",yo);function xo(s){return!!s&&typeof s=="object"&&typeof s.then=="function"}function ko(s){const{from:e,to:t,angle:o}=s.customGradient;return`linear-gradient(${o}deg, ${e}, ${t})`}function yd(s,e){br({id:gs,label:d("Custom gradient"),type:"css",preview:ko(s()),description:d("Mix your own two-colour gradient and set the angle — your desk, your palette."),resolveValue:()=>ko(s()),...e?{renderEditor:e}:{}})}const xd="rest_cookie_invalid_nonce",zr=()=>d("Could not reach the site. Check your connection and try again.","desktop-mode");function Or(s){return typeof navigator<"u"&&navigator.onLine===!1?!0:s instanceof TypeError}function kd(s){return xn(s)?s.code===xd||s.status===401?"session":s.status>=200&&s.status<300?"unreadable":s.status===404?"gone":s.status>=500?"server":s.status>=400?"refused":"unknown":Or(s)?"offline":"unknown"}function $d(s){return xn(s)?s.serverMessage:Or(s)?zr():s instanceof Error?s.message:""}function As(s,e){const{fallback:t,lead:o}=e,i=kd(s),n=i==="offline"||i==="unreadable"?"warning":"error";let r="",a=!0;switch(i){case"offline":r=zr();break;case"session":r=d("Your session has expired. Reload the page and try again.","desktop-mode");break;case"unreadable":r=d("The site sent an unreadable reply. Reload the page to check whether the change went through.","desktop-mode");break;case"gone":case"refused":case"server":{const u=s;u.serverMessage?r=u.serverMessage:i==="gone"?(r=d("It no longer exists. Reload the page to catch up.","desktop-mode"),a=!1):i==="server"?(r=F(d("The server answered with error %d.","desktop-mode"),u.status),a=!1):(r=F(d("The server refused the request (HTTP %d).","desktop-mode"),u.status),a=!1);break}case"unknown":default:r=$d(s);break}let l;return o?l=r?`${o}: ${r}`:t:r?a?l=r:l=`${t} ${r}`:l=t,{message:l,reason:r,kind:i,type:n}}function Ad(s){return s.replace(/[^a-zA-Z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"wallpaper"}function Ed(s){if(!s||typeof s.id!="number"||!s.source_url)return!1;const e=s.media_details;return!!e&&typeof e.width=="number"&&typeof e.height=="number"&&e.width>0&&e.height>0}function Sd(s){if(!s)return"";const e=document.createElement("div");return e.innerHTML=s,e.textContent?.trim()||""}async function Cd(s,e,t,o){const i=new URL(de(s).mediaUrl);i.searchParams.set("media_type","image"),i.searchParams.set("per_page",String(cl)),i.searchParams.set("page",String(e)),i.searchParams.set("orderby","date"),i.searchParams.set("order","desc"),i.searchParams.set("_fields","id,source_url,alt_text,title,media_details"),t&&i.searchParams.set("search",t),o&&(i.searchParams.set("openstation_min_width",String(Fs)),i.searchParams.set("openstation_min_height",String(Vs)));const n=await s.fetch(i.toString());if(!n.ok)throw await xe(n);const r=n.headers.get("X-WP-TotalPages"),a=r?parseInt(r,10):1;return{items:(await n.json()).filter(Ed),totalPages:a||1}}async function Id(s,e){const t=await s.fetch(de(s).mediaUrl,{method:"POST",headers:{"Content-Type":e.type,"Content-Disposition":`attachment; filename="${Ad(e.name)}"`},body:e});if(!t.ok)throw await xe(t);const o=await t.json();return{id:o.id,url:o.source_url}}function Wr(s){E({customImage:s,wallpaper:ne})}async function Hr(s,e){const t=S(s).library,o=i=>{t.uploadError=i,s.repaint(),window.setTimeout(()=>{t.uploadError="",s.repaint()},4e3)};if(!e.type.startsWith("image/")){o(d("That file isn’t an image."));return}t.uploading=!0,s.repaint();try{Wr(await Id(s,e))}catch(i){o(As(i,{fallback:d("Upload failed.")}).message)}finally{t.uploading=!1,s.repaint()}}function Rd(s,e,t){return s?c`<span class="os-settings__upload-status">${d("Uploading…")}</span>`:e?c`<os-button
171 variant="danger"
172 class="os-settings__upload-remove"
173 aria-label=${d("Remove custom image")}
174 @click=${t}
175 >${d("Remove")}</os-button>`:c`<div class="os-settings__upload-inner">
176 <span class="os-settings__upload-plus" aria-hidden="true">+</span>
177 <span class="os-settings__upload-prompt">${d("Drop an image here, or click to upload")}</span>
178 <span class="os-settings__upload-hint">${d("JPEG, PNG, or WebP · goes straight to your Media Library")}</span>
179 </div>`}const Ld=(s,e)=>{const t=S(e).library,o=!!s.customImage,i=["os-settings__upload-tile"];o&&i.push("os-settings__upload-tile--filled"),t.dragover&&i.push("os-settings__upload-tile--dragover"),t.uploading&&i.push("os-settings__upload-tile--busy");const n=()=>e.root.querySelector("[data-os-upload-input]"),r=h=>{h.stopPropagation(),E({customImage:null,...s.wallpaper===ne?{wallpaper:dn()}:{}})},a=()=>{if(!t.uploading){if(s.customImage){E({wallpaper:ne});return}n()?.click()}},l=h=>{const p=h.currentTarget,g=p.files?.[0];g&&Hr(e,g),p.value=""},u=h=>{t.dragover!==h&&(t.dragover=h,e.repaint())};return c`
180 <input
181 type="file"
182 accept="image/*"
183 class="os-settings__file-input"
184 data-os-upload-input
185 @change=${l}
186 />
187 <div
188 class=${i.join(" ")}
189 data-wallpaper-id=${ne}
190 aria-pressed=${s.wallpaper===ne?"true":"false"}
191 aria-label=${d(o?"Custom image wallpaper":"Upload a wallpaper image")}
192 style=${o?`background-image: url("${encodeURI(s.customImage.url)}")`:""}
193 @click=${a}
194 @dragover=${h=>{h.preventDefault(),u(!0)}}
195 @dragleave=${()=>u(!1)}
196 @drop=${h=>{h.preventDefault(),u(!1);const p=h.dataTransfer?.files?.[0];p&&Hr(e,p)}}
197 >
198 ${Rd(t.uploading,o,r)}
199 ${t.uploadError?c`<span class="os-settings__upload-error" role="status">${t.uploadError}</span>`:""}
200 </div>
201 `};function Td(s,e){return s.libraryHdOnly?e.filter(t=>t.media_details.width>=Fs&&t.media_details.height>=Vs):e}async function $o(s){const e=S(s).library;if(!(e.loading||e.totalPages>0&&e.page>=e.totalPages)){e.loading=!0,e.error="",s.repaint();try{const t=await Cd(s,e.page+1,e.query,P().libraryHdOnly);e.page+=1,e.totalPages=t.totalPages,e.loaded=e.loaded.concat(t.items)}catch(t){e.error=As(t,{lead:d("Couldn’t load your media"),fallback:d("Couldn’t load your media.")}).message}finally{e.loading=!1,s.repaint()}}}function Ur(s){const e=S(s).library;e.page=0,e.totalPages=0,e.loaded=[],$o(s)}const Dd=(s,e)=>{const t=s.wallpaper===ne&&s.customImage?.id===e.id,o=e.media_details.sizes||{},i=o.medium?.source_url||o.thumbnail?.source_url||o.large?.source_url||e.source_url,n=e.alt_text||Sd(e.title?.rendered||"")||`Image #${e.id}`;return c`<button
202 type="button"
203 class=${t?"os-settings__library-tile os-settings__library-tile--selected":"os-settings__library-tile"}
204 data-media-id=${String(e.id)}
205 aria-pressed=${t?"true":"false"}
206 aria-label=${n}
207 title=${n}
208 style=${`background-image: url("${encodeURI(i)}")`}
209 @click=${()=>Wr({id:e.id,url:e.source_url})}
210 >
211 <span class="os-settings__library-tile-dims">${e.media_details.width}×${e.media_details.height}</span>
212 </button>`},Pd=(s,e)=>{const t=S(e).library,o=Td(s,t.loaded),i=t.loaded.length-o.length,n=[F(d("Showing %d"),o.length)];s.libraryHdOnly&&i>0&&n.push(F(d("%d hidden by HD filter"),i));const r=u=>{const h=u.target.value;t.searchTimer!==null&&window.clearTimeout(t.searchTimer),t.searchTimer=window.setTimeout(()=>{t.searchTimer=null,t.query=h.trim(),Ur(e)},dl)},a=u=>{E({libraryHdOnly:q(u)}),Ur(e)},l=()=>t.error?c`<p class="os-settings__library-error">${t.error}</p>`:t.loading&&t.page===0?Array.from({length:8},()=>c`<div class="os-settings__library-tile os-settings__library-tile--skeleton"></div>`):o.length===0&&!t.loading?c`<p class="os-settings__library-empty">
213 ${s.libraryHdOnly?d("No HD images found. Try unchecking the filter, or upload a larger image."):d("No images in your Media Library yet.")}
214 </p>`:o.map(u=>Dd(s,u));return c`
215 <div class="os-settings__library">
216 <div class="os-settings__library-toolbar">
217 <input
218 type="search"
219 class="os-settings__library-search"
220 placeholder=${d("Search your media")}
221 aria-label=${d("Search media")}
222 @input=${r}
223 />
224 <os-checkbox-label
225 label=${F(d("Only HD (≥%1$d×%2$d)"),Fs,Vs)}
226 ?checked=${s.libraryHdOnly}
227 @os-checkbox-change=${a}
228 ></os-checkbox-label>
229 </div>
230 <div class="os-settings__library-grid">${l()}</div>
231 <div class="os-settings__library-footer">
232 <span class="os-settings__library-meta">${n.join(" · ")}</span>
233 <os-button
234 variant="ghost"
235 ?hidden=${t.totalPages>0&&t.page>=t.totalPages}
236 ?disabled=${t.loading}
237 @click=${()=>void $o(e)}
238 >${d("Load more")}</os-button>
239 </div>
240 </div>
241 `};function qr(s){const e=S(s);return e.imageSource?e.imageSource:s.data.canUpload?"upload":"library"}function Nd(s){const e=S(s);if(!e.imagePickerOpen||qr(s)!=="library")return;const t=e.library;t.page===0&&!t.loading&&!t.error&&$o(s)}const Md=(s,e)=>{const t=e.data.canUpload,o=qr(e),i=n=>{const r=W(n);(r==="upload"||r==="library")&&(S(e).imageSource=r,e.repaint())};return c`
242 <div class="os-settings__uploader">
243 ${t?c`<os-tabs value=${o} label=${d("Image source")} @os-tab-change=${i}>
244 <os-tab value="upload">${d("Upload new")}</os-tab>
245 <os-tab value="library">${d("Media Library")}</os-tab>
246 </os-tabs>`:""}
247 <div class="os-settings__tab-pane">
248 ${o==="upload"?Ld(s,e):Pd(s,e)}
249 </div>
250 </div>
251 `},zd="[data-os-editor-slot]";function Fr(s){return{id:s,pluginUrl:"",prefersReducedMotion:typeof window.matchMedia=="function"&&window.matchMedia("( prefers-reduced-motion: reduce )").matches,visible:!document.hidden,settings:xr(s)}}function Od(s){const e=s.root.querySelector(zd);if(!e)return;const t=S(s),o=P().wallpaper;if(t.editor.id===o&&e.firstElementChild)return;Vr(s),t.editor.id=o;const i=document.createElement("div");i.className="os-settings__editor-slot-inner",e.textContent="",e.appendChild(i);const n=ze(o);if(n?.renderEditor)try{const r=n.renderEditor(i,Fr(n.id));xo(r)?r.then(a=>{t.editor.teardown=a}):t.editor.teardown=r}catch(r){console.error(`[openstation] Wallpaper "${n.id}" renderEditor threw:`,r)}}function Vr(s){const e=S(s);if(e.editor.teardown)try{e.editor.teardown()}catch(t){console.error("[openstation] Wallpaper editor teardown threw:",t)}e.editor={id:"",teardown:null}}function Wd(s){s.classList.add("os-settings__gradient-editor-inner");const e=o=>{E({customGradient:{...P().customGradient,...o}}),t()},t=()=>{const{from:o,to:i,angle:n}=P().customGradient;Ee(c`
252 <div class="os-settings__gradient-row">
253 <os-color-field
254 variant="block"
255 label=${d("From")}
256 value=${o}
257 @os-color-change=${r=>e({from:W(r)})}
258 ></os-color-field>
259 <os-color-field
260 variant="block"
261 label=${d("To")}
262 value=${i}
263 @os-color-change=${r=>e({to:W(r)})}
264 ></os-color-field>
265 </div>
266 <os-range-field
267 label=${d("Angle")}
268 min="0"
269 max="360"
270 step="1"
271 suffix="°"
272 value=${String(n)}
273 @os-range-change=${r=>e({angle:Number(W(r))})}
274 ></os-range-field>
275 `,s)};return t(),()=>{}}function jr(s){if(typeof s.renderConfig!="function")return;const e=document.createElement("os-modal");e.setAttribute("size","sm"),e.setAttribute("title",F(d("%s settings"),s.label));const t=document.createElement("div");t.className="os-settings__wallpaper-config-form",e.appendChild(t);const o=document.createElement("os-button");o.setAttribute("slot","footer"),o.setAttribute("variant","primary"),o.textContent=d("Done"),e.appendChild(o);let i=null,n=!1;const r=()=>{if(!n){n=!0;try{i?.()}catch(l){console.error(`[openstation] Wallpaper "${s.id}" config teardown threw:`,l)}i=null,e.remove()}};o.addEventListener("click",r),e.addEventListener("os-modal-cancel",r);const a={...Fr(s.id),setSettings:l=>{const u=P(),h={...u.wallpaperSettings[s.id]??{},...l};E({wallpaperSettings:{...u.wallpaperSettings,[s.id]:h}}),kr(s.id,h)}};document.body.appendChild(e),e.setAttribute("open","");try{const l=s.renderConfig(t,a);xo(l)?l.then(u=>{if(n){try{u()}catch{}return}i=u}):i=l}catch(l){console.error(`[openstation] Wallpaper "${s.id}" renderConfig threw:`,l),r()}}const Hd=(s,e)=>{const t=S(e),o=ze(s.wallpaper),i=typeof o?.renderConfig=="function",n=typeof o?.renderEditor=="function",r=l=>{const u=ze(W(l));u&&u.id!==ne&&E({wallpaper:u.id})},a=Ae().filter(l=>l.id!==ne).sort((l,u)=>+(l.id===gs)-+(u.id===gs));return c`
276 <os-section
277 heading=${d("Wallpaper")}
278 description=${d("The backdrop behind your windows. Pick a preset, mix your own gradient, or drop in an image.")}
279 >
280 <div class="os-settings__grid os-settings__grid--wallpapers" @os-pick=${r}>
281 ${a.map(l=>c`<os-swatch
282 value=${l.id}
283 label=${l.label}
284 preview=${l.id===gs?ko(s):l.preview}
285 variant="wallpaper"
286 data-wallpaper-id=${l.id}
287 ?selected=${s.wallpaper===l.id}
288 >
289 <span class="os-settings__swatch-label">${l.label}</span>
290 </os-swatch>`)}
291 <button
292 type="button"
293 class="os-settings__wallpaper-add"
294 aria-expanded=${t.imagePickerOpen?"true":"false"}
295 @click=${()=>{t.imagePickerOpen=!t.imagePickerOpen,e.repaint()}}
296 >
297 <span class="os-settings__wallpaper-add-plus" aria-hidden="true">+</span>
298 <span>${d("Use your own image")}</span>
299 </button>
300 </div>
301 <div
302 class="os-settings__wallpaper-config-slot"
303 data-expanded=${i?"true":"false"}
304 style=${i?"margin-top:12px":""}
305 >
306 <div class="os-settings__wallpaper-config-slot-inner">
307 ${i?c`<div class="os-settings__wallpaper-config">
308 <os-button variant="secondary" @click=${()=>jr(o)}>
309 <os-icon name="admin-generic"></os-icon>
310 ${d("Wallpaper settings")}
311 </os-button>
312 </div>`:""}
313 </div>
314 </div>
315 <div
316 class="os-settings__editor-slot"
317 data-os-editor-slot
318 data-expanded=${n?"true":"false"}
319 ></div>
320 <div class="os-settings__image-picker-slot" data-expanded=${t.imagePickerOpen?"true":"false"}>
321 <div class="os-settings__image-picker-slot-inner">${Md(s,e)}</div>
322 </div>
323 </os-section>
324 `},Ud=s=>c`
325 <os-section heading=${d("Window corners")} description=${d("How rounded the corners of windows are.")}>
326 <os-segmented
327 value=${s.windowRadius}
328 label=${d("Window corners")}
329 @os-pick=${e=>{const t=W(e);hn.some(o=>o.id===t)&&E({windowRadius:t})}}
330 >
331 ${hn.map(e=>c`<os-segment value=${e.id}>${Jc(e.id,e.label)}</os-segment>`)}
332 </os-segmented>
333 </os-section>
334 `,Kr=[{value:jl,label:()=>d("Default (per reveal)")},{value:200,label:()=>d("Very fast — 200 ms")},{value:320,label:()=>d("Fast — 320 ms")},{value:460,label:()=>d("Normal — 460 ms")},{value:700,label:()=>d("Slow — 700 ms")},{value:1100,label:()=>d("Very slow — 1100 ms")}],qd=[{id:"focus",label:()=>d("When a related window is focused")},{id:"always",label:()=>d("Always")},{id:"off",label:()=>d("Off")}],Ao=(s,e,t,o,i)=>c`<os-select
335 value=${e}
336 label=${s}
337 @os-pick=${n=>{const r=W(n);r!==""&&(r===t||o.some(a=>a.id===r))&&i(r)}}
338 >
339 <os-option value=${t}>${d("None")}</os-option>
340 ${o.map(n=>c`<os-option value=${n.id}>${n.label}</os-option>`)}
341 </os-select>`,Fd=s=>{const e=ho(),t=io(),o=po(),i=(n,r,a,l)=>{const u=n.find(h=>h.id===r);return r!==a&&u?.description?u.description:l};return c`
342 <os-section
343 heading=${d("Unfocused windows")}
344 description=${i(e,s.unfocusEffect,lo,d("Apply a visual treatment to every window except the one you are working in."))}
345 >
346 ${Ao(d("Unfocused window effect"),s.unfocusEffect,lo,e,n=>E({unfocusEffect:n}))}
347 </os-section>
348 <os-section
349 heading=${d("Window reveal")}
350 description=${i(t,s.windowReveal,ms,d("Uncover a window’s content when it finishes loading, instead of fading it in."))}
351 >
352 ${Ao(d("Reveal style"),s.windowReveal,ms,t,n=>E({windowReveal:n}))}
353 <os-select
354 value=${String(s.windowRevealDuration)}
355 label=${d("Reveal speed")}
356 @os-pick=${n=>{const r=Number(W(n));Kr.some(a=>a.value===r)&&E({windowRevealDuration:r})}}
357 >
358 ${Kr.map(n=>c`<os-option value=${String(n.value)}>${n.label()}</os-option>`)}
359 </os-select>
360 </os-section>
361 <os-section
362 heading=${d("Window links")}
363 description=${i(o,s.windowLinkRenderer,hr,d("Draw a visual tie between windows showing related content — a post and its comments or media."))}
364 >
365 ${Ao(d("Link style"),s.windowLinkRenderer,hr,o,n=>E({windowLinkRenderer:n}))}
366 <os-select
367 value=${s.windowLinkVisibility}
368 label=${d("Show links")}
369 @os-pick=${n=>{const r=W(n);(r==="focus"||r==="always"||r==="off")&&E({windowLinkVisibility:r})}}
370 >
371 ${qd.map(n=>c`<os-option value=${n.id}>${n.label()}</os-option>`)}
372 </os-select>
373 </os-section>
374 `},Vd=s=>c`
375 <os-section
376 heading=${d("Closing every window")}
377 description=${d("⌥⌘W on macOS, Ctrl+Alt+W elsewhere, closes every open window on the desktop you are looking at. Unticked, it closes them without asking — a page holding unsaved changes still gets to raise its own prompt.")}
378 >
379 <os-checkbox-label
380 label=${d("Ask before closing all windows")}
381 ?checked=${s.confirmCloseAllWindows}
382 @os-checkbox-change=${e=>E({confirmCloseAllWindows:q(e)})}
383 ></os-checkbox-label>
384 </os-section>
385 `,jd=(s,e)=>c`
386 ${Ud(s)}
387 ${Fd(s)}
388 ${Vd(s)}
389 `,Kd=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/i.test(navigator.platform||navigator.userAgent||"")?"⌘K":"Ctrl+K";let Es=!1;document.addEventListener("os-settings-save-lifecycle",s=>{if(!Es)return;const e=s.detail?.phase;e!=="saved"&&e!=="failed"||(Es=!1,e==="saved"&&mn())});const Z=(s,e,t,o,i=!1,n="")=>c`
390 <div class="os-features__item">
391 <os-checkbox-label
392 label=${s}
393 ?checked=${e}
394 ?disabled=${i}
395 @os-checkbox-change=${t}
396 ></os-checkbox-label>
397 <p class="os-features__hint">${o}</p>
398 ${n}
399 </div>
400 `,Bd=s=>c`
401 <os-notice tone="warning" not-dismissible>
402 ${d("This feature requires an AI provider configured in")}
403 <a
404 href=${s}
405 @click=${e=>{e.preventDefault(),s&&gl(s,d("Connectors"))}}
406 >${d("Settings → Connectors")}</a>.
407 </os-notice>
408 `;async function Gd(s){const e=S(s).features;e.resetting||(e.resetting=!0,s.repaint(),await s.dispatch("reset-intros")&&document.dispatchEvent(new CustomEvent("os-intros-reset")),e.resetting=!1,s.repaint())}function Xd(){document.dispatchEvent(new CustomEvent("os-shell-tour-start"))}function Br(s){const e=Bs(),t=s.data.aiAssistant;if(t&&e.aiAssistant){const o=e.aiAssistant.available!==t.available||e.aiAssistant.assistantProviderConfigured!==t.assistantProviderConfigured;Object.assign(e.aiAssistant,t),o&&document.dispatchEvent(new CustomEvent("os-ai-status-changed"))}}const Zd=(s,e)=>{const{aiAssistant:t,isAdmin:o}=e.data,i=S(e).features,n=r=>{const a=Number(W(r));if([15,30,45,60].includes(a)){E({heartbeatRate:a});try{window.wp?.heartbeat?.interval?.(a>=60?"slow":"standard")}catch{}}};return c`
409 <os-section
410 heading=""
411 description=${d("Watch the dot in the OpenStation Preferences title bar to see when a change has been saved.")}
412 >
413 ${t?.available?Z(d("AI assistant"),s.ai.enabled,r=>E({ai:{...s.ai,enabled:q(r)}}),F(d("Adds an AI mode to the %s command palette: find content and ask about your site."),Kd),!t.assistantProviderConfigured,t.assistantProviderConfigured?"":Bd(t.connectorsUrl)):""}
414 ${Z(d("MIO API"),s.mioApiEnabled,r=>E({mioApiEnabled:q(r)}),d("Enables MIO and its window integrations. This is the same switch as the MIO dock button. Ask MIO also requires the AI assistant and a configured connector."))}
415 ${Z(d("Show MIO on wallpaper"),s.mioShowOnWallpaper,r=>E({mioShowOnWallpaper:q(r)}),d("Let MIO roam the desktop. Turn this off to keep it hidden until a window opens chat or invites it to show a tip."))}
416 <div class="os-features__item">
417 <os-checkbox-label
418 label=${d("Window links")}
419 ?checked=${s.windowLinksEnabled}
420 @os-checkbox-change=${r=>E({windowLinksEnabled:q(r)})}
421 ></os-checkbox-label>
422 <p class="os-features__hint">
423 ${d("Draws connector lines between related windows. Line style and visibility live in Windows → Window links.")}
424 </p>
425 ${Z(d("Bring related windows to front"),s.windowLinkRaiseOnFocus,r=>E({windowLinkRaiseOnFocus:q(r)}),d("Clicking a window also surfaces its parent and children."),!s.windowLinksEnabled)}
426 ${Z(d("Highlight related windows"),s.windowLinkHighlight,r=>E({windowLinkHighlight:q(r)}),d("Related windows get an accent outline while one of them is focused."),!s.windowLinksEnabled)}
427 </div>
428 ${Z(d("Show desktop when clicking the wallpaper"),s.showDesktopOnWallpaperClick,r=>E({showDesktopOnWallpaperClick:q(r)}),d("A click on the empty desktop minimizes every window; a second click restores them."))}
429 ${Z(d("Show post/page status ribbon"),s.showPostStatusRibbons,r=>E({showPostStatusRibbons:q(r)}),d("Marks unpublished posts and pages with a corner ribbon on their tiles."))}
430 ${Z(d("Enable developer mode"),s.developerModeEnabled,r=>{E({developerModeEnabled:q(r)}),Es=!0},d("Unlocks developer surfaces meant for plugin authors."))}
431 ${Z(d("Folder sharing"),s.foldersSharingEnabled,r=>E({foldersSharingEnabled:q(r)}),d("Share desktop folders with other users or roles, with read or write access."),!1,o?c`<div class="os-features__danger-row">
432 <p class="os-features__hint">${d("Removes every share and its access list. Cannot be undone.")}</p>
433 <os-button
434 variant="danger"
435 os-action="purge-shares"
436 os-confirm=${d("This drops every shares table on the site (current + legacy). All invites, accept/deny decisions, and share rows are permanently removed. Recipients lose their access until someone shares with them again. The empty tables are recreated on the next admin load so the feature keeps working — but every existing share is gone.")}
437 os-confirm-title=${d("Delete folder sharing data?")}
438 os-confirm-label=${d("Delete data")}
439 os-confirm-danger
440 >${d("Delete folder sharing data")}</os-button>
441 </div>`:"")}
442 <div class="os-features__item">
443 <label class="os-features__select-label">
444 <span class="os-features__select-title">${d("WordPress Heartbeat rate")}</span>
445 <os-select value=${String(s.heartbeatRate)} @os-pick=${n}>
446 <os-option value="15">${d("Fast (15s, not recommended)")}</os-option>
447 <os-option value="30">${d("Medium (30s)")}</os-option>
448 <os-option value="45">${d("Slow (45s)")}</os-option>
449 <os-option value="60">${d("Very slow (60s, default)")}</os-option>
450 </os-select>
451 </label>
452 <p class="os-features__hint">
453 ${d("How often the Heartbeat API runs. Faster means quicker live updates and more server traffic. The 30s and 45s rates apply exactly from the next page load.")}
454 </p>
455 </div>
456 <div class="os-features__row">
457 <p class="os-features__hint">
458 ${d("Brings back the one-time announcements you have dismissed, such as the welcome dialog.")}
459 </p>
460 <os-button variant="secondary" ?disabled=${i.resetting} @click=${()=>void Gd(e)}>
461 ${i.resetting?d("Resetting…"):d("Reset what’s-new dialogs")}
462 </os-button>
463 </div>
464 ${nc()?"":c`<div class="os-features__row">
465 <p class="os-features__hint">
466 ${d("Replays the first-boot tour: where the menus are, changing the layout, opening a window, snapping it, finding anything.")}
467 </p>
468 <os-button variant="secondary" @click=${Xd}>
469 ${d("Take the tour")}
470 </os-button>
471 </div>`}
472 </os-section>
473 `},Yd=s=>{const e=(t,o,i)=>Z(o,s[t]===!0,n=>{E({[t]:q(n)}),Es=!0},i);return c`
474 <os-section
475 heading=${d("Beta features")}
476 description=${d("Experimental redesigns of core admin screens, off by default. Each toggle affects only your account and takes effect immediately.")}
477 >
478 ${e("stationHomeEnabled",d("Use Station Home as your Dashboard"),d("Opens Station Home instead of the classic WordPress Dashboard: recent work, site pulse, and quick actions in one native window. Leave off to keep the classic Dashboard, including any customizations plugins have made to it."))}
479 ${e("nativePostsEnabled",d("Use the native Posts window"),d("Replaces the classic Posts list with a native table window: sticky header, paginated rows, bulk actions, and a row preview."))}
480 ${e("nativePagesEnabled",d("Use the native Pages window"),d("The Posts table experience for Pages, with a Parent column, hierarchical sort, and edit-lock indicators."))}
481 ${e("nativeUsersEnabled",d("Use the native Users window"),d("A native Users list with bulk role changes, online indicators, and one-click password resets."))}
482 ${e("nativePluginsEnabled",d("Use the native Plugins window"),d("A native Plugins window with an Installed list, bulk actions, and a Browse gallery from the WordPress.org directory."))}
483 ${e("nativeCommentsEnabled",d("Use the native Comments window"),d("A native two-pane Comments window: a list of conversations beside the full reply thread."))}
484
485 </os-section>
486 `};let Eo=0;async function Jd(s,e){const t=S(s).features;t.extendedSaving=!0,t.extendedError="",s.data.extendedOptions&&Object.assign(s.data.extendedOptions,e),s.repaint(),Eo++;try{const o=await s.dispatch("extended",{options:e});if(o&&s.data.extendedOptions)try{be(V.EXTENDED_OPTIONS_CHANGED,{options:s.data.extendedOptions})}catch{}else o||(t.extendedError=d("The options could not be saved."))}finally{Eo--,t.extendedSaving=Eo>0,s.repaint()}}const Qd=(s,e)=>{const t=e.data.extendedOptions;if(!t)return c``;const o=S(e).features,i=(n,r,a)=>Z(r,t[n],l=>void Jd(e,{...t,[n]:q(l)}),a);return c`
487 <os-section
488 heading=${d("Extended options")}
489 description=${d("Site-wide enhancements that apply to every user. Toggling requires the affected page to be reloaded for the change to take effect.")}
490 >
491 ${i("media_library_enhanced",d("Enable drag-and-drop in the Media Library"),d("Makes every item in the WordPress Media Library draggable. Drop a media item into text fields, rich-text editors, Gutenberg blocks, or any target that accepts images or files. No replacement of the library — just a drag-and-drop layer on top of the one you already know."))}
492 ${i("agents",d("Enable AI agents"),d("Adds an Agents section to WP Explorer: durable AI workers that live on the site as login-blocked users, act through the WordPress Abilities API under their own role, and answer in a chat window. Requires a configured AI connector to run. Off by default — while off, nothing agent-related loads. Agent definitions are kept across a disable and reappear when re-enabled."))}
493 ${i("network",d("Enable OpenStation Network"),d("Pairs this install with other OpenStation installs into one network: a Network app on the desktop, a key and a registry, and a site switcher that moves between installs and logs you in on arrival. Off by default — while off, none of the network module loads, on the server or in the browser, and a multisite keeps its own site switcher. Pairings are kept across a disable and reappear when re-enabled."))}
494 ${i("games",d("Enable games"),d("Adds a Games app for every user: built-in games, scoreboards, and player-to-player challenges. Off by default — while off, nothing game-related runs anywhere, on the server or in the browser. Saved scores are kept across a disable and reappear when re-enabled."))}
495 ${i("window_prewarm",d("Preload windows on hover"),d("Starts loading a window while you hover its dock icon, so it appears sooner when you click. Enabled by default for everyone; turn off to avoid the extra memory and background requests. Takes effect after reloading OpenStation."))}
496 ${i("admin_asset_cache",d("Shared asset cache"),d("Shares cached admin stylesheets and scripts across windows to reduce network requests. Enabled by default for everyone; turn off to bypass the shared cache. Takes effect after reloading OpenStation."))}
497 ${o.extendedError?c`<p class="os-ext__error">${o.extendedError}</p>`:""}
498 ${o.extendedSaving?c`<p class="os-ext__saving">${d("Saving…")}</p>`:""}
499 </os-section>
500 `},eu=(s,e)=>c`
501 ${Zd(s,e)}
502 ${Yd(s)}
503 ${e.data.isAdmin?Qd(s,e):""}
504 `,tu="",su={accent:"pulse",desktopLayout:"unified",dockPlacement:"bottom"};function ou(s){if(s===tu)return Object.keys(Yn(su)).length>0;const e=ec(s);return e?Object.keys(Yn(e.recommendedOsSettings)).length>0:!1}const Ss="",Gr="OpenStation";function iu(s){const e=s.trim().split(/\s+/).filter(Boolean);return e.length===0?"?":e.length>=2?(e[0][0]+e[1][0]).toUpperCase():e[0].slice(0,2).toUpperCase()}function Xr(s){const e=s?.serverWallpapers;Array.isArray(e)&&be(V.WALLPAPERS_SERVER_CHANGED,{wallpapers:e})}async function nu(s,e){const t=new FormData;t.append("file",e,e.name);const o=await s.fetch(de(s).desktopThemesUrl,{method:"POST",body:t});if(!o.ok)throw await xe(o);const i=await o.json();return Xr(i),i}async function ru(s,e){const t=await s.fetch(`${de(s).desktopThemesUrl}/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await xe(t);try{Xr(await t.json())}catch{}}async function Zr(s,e){const t=S(s).themes;if(!t.busy){t.busy=!0,t.error="",s.repaint();try{tr(await nu(s,e))}catch(o){t.error=As(o,{fallback:d("That theme could not be installed.")}).message}finally{t.busy=!1,s.repaint()}}}async function au(s,e){if(!await s.host.confirm?.({title:d("Delete this theme?"),message:F(d("“%s” will be removed from this site for everyone. This cannot be undone."),e.name),confirmLabel:d("Delete"),danger:!0}))return;const o=S(s).themes;o.error="";try{await ru(s,e.slug),sc(e.slug),P().desktopTheme===e.slug&&E({desktopTheme:Ss})}catch(i){o.error=As(i,{fallback:d("That theme could not be deleted.")}).message}s.repaint()}const lu=(s,e,t,o)=>c`
505 <div class="os-settings__theme-card-wrap">
506 <button
507 type="button"
508 class="os-settings__theme-card"
509 aria-pressed=${t?"true":"false"}
510 data-theme-slug=${e.slug}
511 @click=${()=>E({desktopTheme:e.slug})}
512 >
513 <span class="os-settings__theme-preview">
514 ${e.previewUrl?c`<img src=${e.previewUrl} alt="" aria-hidden="true" draggable="false" />`:c`<span class="os-settings__theme-initials" aria-hidden="true">${iu(e.name)}</span>`}
515 </span>
516 <span class="os-settings__theme-name">${e.name}</span>
517 <span class="os-settings__theme-meta">
518 ${e.version!==""?F(d("Version %s"),e.version):""}
519 </span>
520 </button>
521 ${o&&e.source!=="code"?c`<button
522 type="button"
523 class="os-settings__theme-delete"
524 aria-label=${F(d("Delete %s"),e.name)}
525 @click=${()=>void au(s,e)}
526 >×</button>`:""}
527 </div>
528 `,cu=s=>c`
529 <div class="os-settings__theme-card-wrap">
530 <button
531 type="button"
532 class="os-settings__theme-card os-settings__theme-card--system"
533 aria-pressed=${s?"true":"false"}
534 @click=${()=>E({desktopTheme:Ss})}
535 >
536 <span class="os-settings__theme-preview os-settings__theme-preview--system" aria-hidden="true"></span>
537 <span class="os-settings__theme-name">${Gr}</span>
538 <span class="os-settings__theme-meta">${d("The look OpenStation ships with")}</span>
539 </button>
540 </div>
541 `,du=s=>{const e=S(s).themes,t=o=>o.dataTransfer?.files?.[0]??o.currentTarget.files?.[0];return c`<div
542 class=${e.busy?"os-settings__theme-upload os-settings__theme-upload--busy":"os-settings__theme-upload"}
543 @dragover=${o=>{o.preventDefault(),o.currentTarget.classList.add("os-settings__theme-upload--dragover")}}
544 @dragleave=${o=>{o.currentTarget.classList.remove("os-settings__theme-upload--dragover")}}
545 @drop=${o=>{o.preventDefault(),o.currentTarget.classList.remove("os-settings__theme-upload--dragover");const i=t(o);i&&Zr(s,i)}}
546 >
547 <label class="os-settings__theme-upload-label">
548 <input
549 type="file"
550 accept=".zip,application/zip"
551 class="os-settings__file-input"
552 ?disabled=${e.busy}
553 @change=${o=>{const i=o.currentTarget,n=i.files?.[0];n&&Zr(s,n),i.value=""}}
554 />
555 <span class="os-settings__theme-upload-plus" aria-hidden="true">+</span>
556 <span class="os-settings__theme-upload-prompt">
557 ${e.busy?d("Installing…"):d("Drop a theme .zip here, or click to upload")}
558 </span>
559 </label>
560 </div>`},uu=(s,e)=>{if(!ou(s))return"";const t=s===Ss?Gr:e.find(o=>o.slug===s)?.name;return t===void 0?"":c`<div class="os-settings__theme-recommendation">
561 <os-button variant="secondary" @click=${()=>bn(s)}>
562 ${F(d("Apply %s’s recommended layout and effects"),t)}
563 </os-button>
564 </div>`},hu=(s,e)=>{const t=no(),o=e.data.canManageDesktopThemes,i=S(e).themes.error;return c`
565 ${i!==""?c`<os-notice tone="error">${i}</os-notice>`:""}
566 <os-section heading=${d("Installed")}>
567 <div class="os-settings__theme-grid" role="group" aria-label=${d("Desktop theme")}>
568 ${cu(s.desktopTheme===Ss)}
569 ${t.map(n=>lu(e,n,s.desktopTheme===n.slug,o))}
570 ${o?du(e):""}
571 </div>
572 ${uu(s.desktopTheme,t)}
573 </os-section>
574 `},Yr="data:image/svg+xml;base64,",Cs=new Map;function pu(s){const e=Cs.get(s);if(e!==void 0)return e;let t=!1;try{t=atob(s.slice(Yr.length)).includes("currentColor")}catch{}return Cs.size>=256&&Cs.clear(),Cs.set(s,t),t}function Jr(s,e){const t=e.className??"",o=e.title??"";let i=null;if(e.slot){const l=ac(e.slot);l!==null&&(s=l),i=lc(e.slot)}if(typeof s=="string"&&s.startsWith("dashicons-")){const l=document.createElement("span");return l.className=`dashicons ${s} ${t}`.trim(),l.setAttribute("aria-hidden","true"),i!==null&&(l.style.color=i),l}if(i!==null&&typeof s=="string"){const l=document.createElement("span");if(l.className=t,l.setAttribute("aria-hidden","true"),l.style.display="inline-block",or(l,s,i))return l}if(typeof s=="string"&&s.startsWith("data:image/svg+xml;base64,")){const l=s.slice(Yr.length);if(/^[A-Za-z0-9+/=]+$/.test(l)){const u=document.createElement("span");return u.className=t,u.setAttribute("aria-hidden","true"),u.style.display="inline-block",pu(s)&&or(u,s,"currentColor")||(u.style.backgroundImage=`url("${s}")`,u.style.backgroundRepeat="no-repeat",u.style.backgroundPosition="center",u.style.backgroundSize="contain"),u}}if(typeof s=="string"&&/^data:image\/(png|jpeg|jpg|gif|webp|x-icon|vnd\.microsoft\.icon);base64,/i.test(s)){const l=s.indexOf(","),u=l>=0?s.slice(l+1):"";if(/^[A-Za-z0-9+/=]+$/.test(u))return Qr(s,t)}if(typeof s=="string"&&(s.startsWith("http://")||s.startsWith("https://")))return Qr(s,t);const n=document.createElement("span");n.className=`${t} os-icon-letter`.trim(),n.setAttribute("aria-hidden","true");const r=gu(o);n.textContent=r;const a=sr(o);return n.style.backgroundColor=`hsl( ${a}, 60%, 45% )`,n.style.color="#fff",n.style.display="inline-flex",n.style.alignItems="center",n.style.justifyContent="center",n.style.fontWeight="600",n.style.borderRadius="4px",n}function Qr(s,e){const t=document.createElement("img");return t.className=e,t.src=s,t.alt="",t.setAttribute("aria-hidden","true"),t.draggable=!1,t}function gu(s){const e=(s??"").trim();if(e==="")return"?";const t=e.split(/\s+/);if(t.length>=2)return(t[0][0]+t[1][0]).toUpperCase();const o=t[0];return o.length>=2?o.slice(0,2).toUpperCase():o.toUpperCase()}const fu=[{kinds:["core"],heading:()=>d("WordPress Core"),description:()=>d("The admin menus WordPress itself registers.")},{kinds:["plugin","app"],heading:()=>d("Plugins & Apps"),description:()=>d("Menus from installed plugins and apps.")},{kinds:["control"],heading:()=>d("OpenStation"),description:()=>d("The OpenStation’s own controls.")}];function bu(){const s=window.wp?.os;return typeof s?.getNavItems=="function"?s.getNavItems():[]}function mu(s){return s.locked||s.transient?!1:s.menu||s.entry?!0:s.tile?.placeable===!0}const vu=s=>d(s==="classic"?"Choose where each menu shows up: on the dock/sidebar, on the desktop wallpaper, both, or hidden entirely. Changes apply instantly.":"Choose where each menu shows up: on the dock, on the desktop wallpaper, both, or hidden entirely. Changes apply instantly."),_u=(s,e)=>[{id:"rail",label:wc(s,e)==="sidebar"?d("In the sidebar"):d("On the dock")},{id:"desktop",label:d("On the desktop")},{id:"both",label:d("On both")},{id:"hidden",label:d("Hidden")}],wu=(s,e)=>c`<div class="os-nav-settings__row" data-item-id=${s.id}>
575 <div class="os-nav-settings__identity">
576 ${Jr(s.icon,{title:s.title,className:"os-nav-settings__icon",slot:hc(s.id)})}
577 <div class="os-nav-settings__title">${s.title}</div>
578 </div>
579 <os-select
580 plain
581 label=${s.title}
582 value=${yc(s,e.navPlacement)}
583 @os-pick=${t=>{const o=W(t);(o==="both"||o==="rail"||o==="desktop"||o==="hidden")&&E({navPlacement:{...e.navPlacement,[s.id]:o}})}}
584 >
585 ${_u(s.kind,e.desktopLayout).map(t=>c`<os-option value=${t.id}>${t.label}</os-option>`)}
586 </os-select>
587 </div>`,yu=s=>{const e=bu().filter(mu),t=fu.map(o=>({...o,rows:xc(e.filter(i=>o.kinds.includes(i.kind)))})).filter(o=>o.rows.length>0);return c`
588 <p class="os-settings__page-description os-nav-settings__lead">${vu(s.desktopLayout)}</p>
589 ${t.length===0?c`<os-empty-state
590 heading=${d("Nothing registered yet")}
591 description=${d("Plugins and the admin menu will appear here once they’re registered.")}
592 ></os-empty-state>`:t.map(o=>c`
593 <os-section class="os-nav-settings" heading=${o.heading()} description=${o.description()}>
594 ${o.rows.map(i=>wu(i,s))}
595 </os-section>
596 `)}
597 `},ea={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 ta(s){return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function sa(s){return Object.prototype.hasOwnProperty.call(ea,s)?ea[s]:null}function xu(s){return sa(s)!==null}function ku(s,e={}){const t=sa(s);if(!t)return"";const{size:o=24,className:i,title:n,rotate:r}=e,a=['xmlns="http://www.w3.org/2000/svg"','viewBox="0 0 24 24"'];o!=null&&a.push(`width="${o}"`,`height="${o}"`),a.push(t.a),i&&a.push(`class="${ta(i)}"`),n?a.push('role="img"',`aria-label="${ta(n)}"`):a.push('aria-hidden="true"','focusable="false"');const l=r?`<g transform="rotate(${r} 12 12)">${t.b}</g>`:t.b;return`<svg ${a.join(" ")}>${l}</svg>`}function N(s,e={}){const t=ku(s,e),o=document.createElement("div");o.innerHTML=t;const i=o.firstElementChild;return i instanceof SVGSVGElement?i:document.createElementNS("http://www.w3.org/2000/svg","svg")}const Is=3,oa=[{id:"auto",label:()=>d("Automatic")},{id:"desktop",label:()=>d("Always desktop")},{id:"mobile",label:()=>d("Always mobile")}];function $u(s){return s.filter(e=>!e.locked&&!e.transient&&!!(e.windowId||e.tile||e.menu?.url||e.entry?.url))}const Au=(s,e)=>{const t=$u(ao()),o=new Set(t.map(u=>u.id)),i=(Bs().mode?.tabBar??[]).filter(u=>o.has(u)),n=(s.mobileTabs.length>0?s.mobileTabs:i).slice(0,Is),r=n.length>=Is,a=u=>{const h=W(u);oa.some(p=>p.id===h)&&E({mobileLayout:h})},l=u=>h=>{const p=q(h),g=n.filter(b=>b!==u);p&&g.length<Is&&g.push(u),E({mobileTabs:g})};return c`
598 <os-section
599 heading=${d("Layout")}
600 description=${d("Automatic follows the screen: phones get the phone layer, everything wider gets the desktop. Force either to preview or to opt out.")}
601 >
602 <os-segmented value=${s.mobileLayout} label=${d("Mobile layout")} @os-pick=${a}>
603 ${oa.map(u=>c`<os-segment value=${u.id}>${u.label()}</os-segment>`)}
604 </os-segmented>
605 </os-section>
606
607 <os-section
608 heading=${d("Tab bar")}
609 description=${F(d("Home and the app switcher are always there. Pin up to %d apps between them; leave it empty for the default set."),Is)}
610 >
611 ${t.length===0?c`<p class="os-features__hint">${d("Nothing to pin yet.")}</p>`:t.map(u=>{const h=n.includes(u.id);return c`
612 <div class="os-features__item">
613 <os-checkbox-label
614 label=${u.title}
615 ?checked=${h}
616 ?disabled=${!h&&r}
617 @os-checkbox-change=${l(u.id)}
618 ></os-checkbox-label>
619 </div>
620 `})}
621 </os-section>
622 `},Eu=v`:host{display:block;margin-block-end:36px}:host( [ hidden ] ){display:none}.os-section__heading{margin:0 0 5px;font-size:20px;font-weight:500;letter-spacing:-0.01em;color:var( --os-ui-fg,#1d2327 )}.os-section__description{margin:0 0 14px;max-width:78ch;font-size:14px;color:var( --os-ui-fg-muted,#646970 );line-height:1.55}.os-section__description:empty{display:none}:host( [ stack ] ) .os-section__body{display:flex;flex-direction:column;gap:var( --os-ui-section-gap,12px )}`,Xe=class Xe extends _{render(){const e=this.heading||"",t=this.description||"";return c`
623 ${e?c`<h3 class="os-section__heading">${e}</h3>`:""}
624 ${t?c`<p class="os-section__description">${t}</p>`:""}
625 <div class="os-section__body" part="body"><slot></slot></div>
626 `}};Xe.props=["heading","description","stack"],Xe.styles=[Eu],Xe.help=void 0;let So=Xe;w("os-section",So);const Su=v` ${C}:host{display:block;width:100%;aspect-ratio:4 / 3}:host( [ size='small' ] ){display:inline-block;width:32px;height:32px;aspect-ratio:1 / 1;flex:0 0 auto}:host( [ variant='accent' ] ){display:inline-block;width:28px;height:28px;aspect-ratio:1 / 1;flex:0 0 auto}:host( [ size='small' ][ variant='accent' ] ) button{border-radius:8px}:host( [ size='small' ][ variant='accent' ] ) button[ aria-pressed='true' ]{box-shadow:0 0 0 2px var( --os-ui-surface-sunken,#f0f0f1 ),0 0 0 4px var( --os-ui-accent,#2271b1 )}:host( [ size='small' ][ variant='accent' ] ) button[ aria-pressed='true' ]:focus-visible{box-shadow:var( --_holo-focus )}:host( [ variant='wallpaper' ] ){aspect-ratio:16 / 10}:host( [ variant='wallpaper' ] ) button{display:flex;align-items:flex-end;justify-content:flex-start;padding:8px;overflow:hidden}button{appearance:none;position:relative;width:100%;height:100%;padding:0;border-radius:10px;border:2px solid transparent;cursor:pointer;background-color:var( --os-ui-surface-sunken,#eee );background-size:cover;background-position:center;transition:transform 0.15s ease,border-color 0.15s ease,box-shadow 0.15s ease}:host( [ size='small' ] ) button{border-radius:50%}button:hover{transform:scale( 1.04 )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button[ aria-pressed='true' ]{border-color:transparent;box-shadow:0 0 0 var( --os-ui-swatch-ring-width,2px ) var( --os-ui-accent,#2271b1 ),var( --os-ui-swatch-lift,0 0 0 0 transparent )}:host(:not( [ variant='accent' ] ) ) button[ aria-pressed='true' ]::after{content:'';position:absolute;top:6px;inset-inline-end:6px;width:18px;height:18px;border-radius:50%;background:var( --os-ui-swatch-badge-bg,transparent );pointer-events:none;-webkit-mask:url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E" ) center / 12px no-repeat,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:url( "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E" ) center / 12px no-repeat,linear-gradient( #000 0 0 );mask-composite:exclude}button[ aria-pressed='true' ]:focus-visible{box-shadow:var( --_holo-focus )}:host( [ variant='wallpaper' ] ) button:hover{transform:translateY( -2px )}`,Ze=class Ze extends _{render(){const e=this.selected!==null,t=this.label||"",o=this.preview||"";return c`
627 <button
628 type="button"
629 aria-pressed=${e?"true":"false"}
630 aria-label=${t}
631 title=${t}
632 style="background: ${o}"
633 @click=${()=>this._onPick()}
634 >
635 <slot></slot>
636 </button>
637 `}_onPick(){this.emit("os-pick",{value:this.value})}};Ze.props=["value","label","selected","preview","size","variant"],Ze.styles=[Su],Ze.help=void 0;let Co=Ze;w("os-swatch",Co);const Cu=v`:host{display:grid;grid-template-columns:repeat( var( --os-ui-swatch-grid-cols,4 ),1fr );gap:12px}:host( [ mode='row' ] ){display:flex;flex-wrap:wrap;align-items:center;gap:10px}`,Ye=class Ye extends _{render(){const e=this.label||"",t=this.columns||"";return t&&this.style.setProperty("--os-ui-swatch-grid-cols",t),this.setAttribute("role","radiogroup"),e&&this.setAttribute("aria-label",e),c`<slot></slot>`}};Ye.props=["label","columns","mode"],Ye.styles=[Cu],Ye.help=void 0;let Io=Ye;w("os-swatch-grid",Io);const Iu=v` ${C}:host{display:inline-flex;position:relative;padding:3px;background:var( --os-ui-segmented-bg,var( --os-ui-hover,rgba( 0,0,0,0.05 ) ) );border-radius:8px;gap:2px;box-shadow:var( --os-ui-segmented-edge,none )}.os-segmented__thumb{position:absolute;top:3px;bottom:3px;left:0;width:var( --_thumb-w,0px );border-radius:6px;background-color:var( --os-ui-segmented-selected-bg,color-mix( in srgb,var( --os-ui-accent,#2271b1 ) var( --os-ui-segmented-selected-accent,100% ),var( --os-ui-segmented-selected-base,var( --os-ui-surface,#fff ) ) ) );background-image:var( --os-ui-segmented-selected-image,none );box-shadow:var( --os-ui-segmented-selected-shadow,none );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;transform:translateX( var( --_thumb-x,0px ) );pointer-events:none;opacity:0}:host( [ data-thumb ] ) .os-segmented__thumb{opacity:1}:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition:transform var( --_holo-t-slow ) var( --_holo-spring ),width var( --_holo-t-slow ) var( --_holo-ease ),opacity var( --_holo-t-fast ) linear}@media ( prefers-reduced-motion:reduce ){:host( [ data-thumb-ready ] ) .os-segmented__thumb{transition-duration:1ms}}`,Ru=v` ${C} ${xs}:host{flex:1 1 auto;min-width:0;--_holo-sheen:var( --os-ui-segmented-hover-sheen,var( --os-ui-holo-sheen,linear-gradient( 124deg,rgba( 159,214,255,0.1 ) 0%,rgba( 236,155,255,0.12 ) 34%,rgba( 242,82,252,0.1 ) 58%,rgba( 147,240,198,0.09 ) 100% ) ) )}button{appearance:none;display:block;width:100%;padding:6px 13px;background:transparent;border:0;font:inherit;font-size:13px;color:var( --os-ui-fg-muted,#646970 );cursor:pointer;border-radius:6px;transition:background-color var( --_holo-t ) ease,color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease,background-position var( --_holo-t ) ease;white-space:nowrap}button:hover{color:var( --os-ui-fg,#1d2327 )}:host(:not( [ aria-checked='true' ] ) ) button:hover{background-color:var( --os-ui-segmented-hover-bg,transparent )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}:host( [ aria-checked='true' ] ) button{color:var( --os-ui-segmented-selected-fg,color-mix( in srgb,var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) ) var( --os-ui-segmented-selected-accent,100% ),var( --os-ui-fg,#1d2327 ) ) );transition-duration:var( --_holo-t-fast )}:host( [ aria-checked='true' ] ) button::before{display:none}`,Je=class Je extends _{render(){return this.setAttribute("role","radio"),c`
638 <button
639 type="button"
640 class="os-holo-sheen"
641 @click=${()=>this._onPick()}
642 >
643 <slot></slot>
644 </button>
645 `}_onPick(){this.emit("os-segment-pick",{value:this.value})}};Je.props=["value"],Je.styles=[Ru],Je.help=void 0;let Ro=Je;w("os-segment",Ro);const Qe=class Qe extends _{constructor(){super(...arguments),this._resizeObserver=null}connectedCallback(){super.connectedCallback(),this.addEventListener("os-segment-pick",e=>{const t=e.detail;e.stopPropagation(),this.value=t.value,this.emit("os-pick",{value:t.value})}),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._placeThumb()),this._resizeObserver.observe(this))}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null}_placeThumb(){if(!this.shadowRoot?.querySelector(".os-segmented__thumb"))return;const t=this.value,o=Array.from(this.querySelectorAll(":scope > os-segment")).find(u=>u.getAttribute("value")===t);if(!o||this.offsetWidth===0){this.removeAttribute("data-thumb");return}const i=this.getBoundingClientRect(),n=i.width/this.offsetWidth,r=Math.abs(n-1)<.02?1:n;if(!(r>0))return;const a=o.getBoundingClientRect(),l=u=>`${Math.round(u*100)/100}px`;this.style.setProperty("--_thumb-x",l((a.left-i.left)/r)),this.style.setProperty("--_thumb-w",l(a.width/r)),this.setAttribute("data-thumb",""),this.hasAttribute("data-thumb-ready")||requestAnimationFrame(()=>this.setAttribute("data-thumb-ready",""))}set items(e){const t=this.querySelectorAll(":scope > os-segment");for(const n of Array.from(t))n.remove();for(const n of e){const r=document.createElement("os-segment");r.setAttribute("value",n.value),r.textContent=n.label,this.appendChild(r)}const o=this.value;!(o!==null&&e.some(n=>n.value===o))&&e.length>0?this.value=e[0].value:this.requestUpdate()}render(){const e=this.label||"";e&&this.setAttribute("aria-label",e),this.setAttribute("role","radiogroup");const t=this.value;return queueMicrotask(()=>{const o=this.querySelectorAll("os-segment");for(const i of Array.from(o)){const n=i.getAttribute("value");i.setAttribute("aria-checked",n===t?"true":"false")}this._placeThumb()}),c`<span class="os-segmented__thumb" aria-hidden="true"></span
646 ><slot></slot>`}};Qe.props=["value","label"],Qe.styles=[Iu],Qe.help={title:"Segmented",summary:"iOS-style segmented radio group. Pill-shaped bar of equal-width <os-segment> children where exactly one is active.",status:"stable",props:[{name:"value",type:"string",description:"Currently selected segment value. Mirrored onto child aria-checked."},{name:"label",type:"string",description:"aria-label for the radiogroup."}],slots:[{name:"(default)",description:'<os-segment value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the selected segment changes.",detail:"{ value: string }"}],cssProps:[{name:"--os-window-bg",description:"Pill background."},{name:"--os-ui-fg",description:"Active label colour."},{name:"--os-ui-fg-muted",description:"Inactive label colour."}],example:c`
647 <os-segmented value="md" label="Dock size">
648 <os-segment value="sm">Small</os-segment>
649 <os-segment value="md">Medium</os-segment>
650 <os-segment value="lg">Large</os-segment>
651 </os-segmented>
652 `};let Lo=Qe;w("os-segmented",Lo);const Lu=v` ${C}:host{display:flex;flex-direction:column;gap:8px;font-size:13px;color:var( --os-ui-fg,#1d2327 );min-width:0}:host( [ hidden ] ){display:none}.os-select__label{font-size:13px;line-height:1.5;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger{appearance:none;display:flex;align-items:center;gap:8px;width:100%;min-width:0;padding:8px 12px;background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border:1px solid transparent;border-radius:8px;font:inherit;font-size:13px;line-height:1.5;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer;transition:background-color var( --_holo-t ) ease,border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}.os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-border-strong,#8c8f94 )}.os-select__trigger:focus,.os-select__trigger:focus-visible{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.os-select__trigger:disabled{opacity:0.5;cursor:not-allowed}:host( [ plain ] ){display:inline-flex;flex-direction:row;align-items:center}:host( [ plain ] ) .os-select__label{display:none}:host( [ plain ] ) .os-select__trigger{width:auto;padding:4px 6px;background:transparent;border-color:transparent;border-radius:6px}:host( [ plain ] ) .os-select__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.05 ) );border-color:transparent}:host( [ plain ] ) .os-select__trigger:focus,:host( [ plain ] ) .os-select__trigger:focus-visible{border-color:var( --os-ui-accent,#2271b1 )}:host( [ plain ] ) .os-select__value{flex:0 1 auto}.os-select__value{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-select__value--placeholder{color:var( --os-ui-fg-muted,#646970 )}.os-select__chevron{flex:0 0 auto;pointer-events:none;color:var( --os-ui-fg-muted,#646970 )}.os-select__trigger:hover .os-select__chevron{color:var( --os-ui-fg,#1d2327 )}.os-select__trigger:focus .os-select__chevron,.os-select__trigger:focus-visible .os-select__chevron{color:var( --os-ui-accent,#2271b1 )}.os-select__popup{position:fixed;inset:auto;margin:0;max-height:min( 320px,60vh );overflow-y:auto;padding:4px;background:var( --os-ui-surface,#fff );border:1px solid var( --os-ui-border,#dcdcde );border-radius:8px;box-shadow:0 12px 32px rgba( 0,0,0,0.45 );color:var( --os-ui-fg,#1d2327 )}.os-select__popup:not( [ data-open ] ){display:none}.os-select__popup:popover-open{display:block}.os-select__popup[ data-open ]{position:absolute;top:calc( 100% + 4px );left:0;min-width:100%;z-index:1000}:host{position:relative}.os-select__option{display:flex;align-items:center;gap:8px;padding:7px 10px;border-radius:6px;font-size:13px;line-height:1.5;cursor:pointer;white-space:nowrap}.os-select__check{flex:0 0 auto;visibility:hidden}.os-select__option[ aria-selected='true' ] .os-select__check{visibility:visible}.os-select__option[ data-active ],.os-select__option:hover{background:var( --os-ui-accent,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-select__option[ aria-disabled='true' ]{opacity:0.5;cursor:not-allowed}.os-select__option[ aria-disabled='true' ]:hover{background:transparent;color:inherit}@media ( prefers-reduced-motion:reduce ){.os-select__trigger{transition-duration:1ms}}`,Tu=v`:host{display:none}`,et=class et extends _{render(){return c``}};et.props=["value","disabled"],et.styles=[Tu],et.help=void 0;let To=et;w("os-option",To);const tt=class tt extends _{constructor(){super(...arguments),this._optionObserver=null,this._open=!1,this._activeIndex=-1,this._typed="",this._dismissedAt=0,this._typedTimer=null,this._onWindowScroll=e=>{const t=e.target,o=this._popup();o&&t instanceof Node&&(t===o||o.contains(t))||this._hide()},this._onWindowResize=()=>this._hide()}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const n of Array.from(t))n.remove();for(const n of e){const r=document.createElement("os-option");r.setAttribute("value",n.value),r.textContent=n.label,this.appendChild(r)}const o=this.value;!(o!==null&&e.some(n=>n.value===o))&&e.length>0&&(this.value=e[0].value),this.requestUpdate()}connectedCallback(){super.connectedCallback(),He(this),this._optionObserver=new MutationObserver(()=>this.requestUpdate()),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._teardownDismiss(),this._open=!1,this._typedTimer&&(clearTimeout(this._typedTimer),this._typedTimer=null)}render(){const e=this.label||"",t=this.value,o=this.placeholder||"",i=this.disabled!==null;e&&this.setAttribute("aria-label",e);const n=this.getAttribute("aria-label")||"",r=e||n||o,a=this._readOptions(),l=a.find(m=>m.value===t),u=l?l.label:o,h=this.id||"os-unnamed",p=`${h}__listbox`,g=`${h}__trigger`,b=this._open&&this._activeIndex>=0?`${h}__opt-${this._activeIndex}`:"";return c`
653 ${e?c`<label
654 class="os-select__label"
655 for=${g}
656 >${e}</label>`:c``}
657 <button
658 type="button"
659 class="os-select__trigger"
660 id=${g}
661 role="combobox"
662 aria-haspopup="listbox"
663 aria-expanded=${this._open?"true":"false"}
664 aria-controls=${p}
665 aria-label=${r}
666 aria-activedescendant=${b}
667 ?disabled=${i}
668 @click=${()=>this._toggle()}
669 @keydown=${m=>this._onTriggerKeydown(m)}
670 >
671 <span
672 class="os-select__value${l?"":" os-select__value--placeholder"}"
673 >${u}</span
674 >
675 ${N("chevron-right",{size:16,rotate:90,className:"os-select__chevron"})}
676 </button>
677 <div
678 class="os-select__popup"
679 id=${p}
680 role="listbox"
681 popover="auto"
682 aria-label=${r}
683 @toggle=${m=>this._onPopoverToggle(m)}
684 >
685 ${a.map((m,x)=>c`
686 <div
687 class="os-select__option"
688 id=${`${h}__opt-${x}`}
689 role="option"
690 data-value=${m.value}
691 aria-selected=${m.value===t?"true":"false"}
692 aria-disabled=${m.disabled?"true":"false"}
693 ?data-active=${this._open&&x===this._activeIndex}
694 @click=${()=>this._onOptionClick(m)}
695 @pointermove=${()=>this._setActive(x)}
696 >
697 ${N("check",{size:16,className:"os-select__check"})}
698 <span class="os-select__option-label"
699 >${m.label}</span
700 >
701 </div>
702 `)}
703 </div>
704 `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_popup(){return this.shadowRoot?.querySelector(".os-select__popup")??null}_trigger(){return this.shadowRoot?.querySelector(".os-select__trigger")??null}_toggle(){if(this._open){this._hide();return}performance.now()-this._dismissedAt<250||this._show()}_show(){const e=this._popup(),t=this._trigger();if(!e||!t||this._open)return;this._open=!0;const o=this._readOptions(),i=this.value,n=o.findIndex(a=>a.value===i&&!a.disabled);this._activeIndex=n>=0?n:o.findIndex(a=>!a.disabled);const r=t.getBoundingClientRect();e.style.minWidth=`${r.width}px`,typeof e.showPopover=="function"?(e.style.left=`${r.left}px`,e.style.top=`${r.bottom+4}px`,e.showPopover(),r.bottom+4+e.offsetHeight>window.innerHeight-8&&(e.style.top=`${Math.max(8,r.top-4-e.offsetHeight)}px`)):e.setAttribute("data-open",""),window.addEventListener("scroll",this._onWindowScroll,{capture:!0,passive:!0}),window.addEventListener("resize",this._onWindowResize),this.requestUpdate(),this._scrollActiveIntoView()}_hide(){if(!this._open)return;this._open=!1;const e=this._popup();if(e){if(typeof e.hidePopover=="function")try{e.hidePopover()}catch{}e.removeAttribute("data-open")}this._teardownDismiss(),this.requestUpdate()}_teardownDismiss(){window.removeEventListener("scroll",this._onWindowScroll,{capture:!0}),window.removeEventListener("resize",this._onWindowResize)}_onPopoverToggle(e){e.newState==="closed"&&this._open&&(this._dismissedAt=performance.now(),this._open=!1,this._teardownDismiss(),this.requestUpdate())}_onOptionClick(e){e.disabled||this._commit(e.value)}_commit(e){this._hide(),this.value=e,this.emit("os-pick",{value:e})}_setActive(e){if(e===this._activeIndex)return;const t=this._readOptions();!t[e]||t[e].disabled||(this._activeIndex=e,this.requestUpdate())}_moveActive(e){const t=this._readOptions();let o=this._activeIndex;for(let i=0;i<t.length&&(o=Math.min(Math.max(o+e,0),t.length-1),!(!t[o]?.disabled||o===0||o===t.length-1));i++);o!==this._activeIndex&&t[o]&&!t[o].disabled&&(this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView())}_scrollActiveIntoView(){queueMicrotask(()=>{this.shadowRoot?.querySelector(".os-select__option[data-active]")?.scrollIntoView?.({block:"nearest"})})}_typeAhead(e){this._typedTimer&&clearTimeout(this._typedTimer),this._typed+=e.toLowerCase(),this._typedTimer=setTimeout(()=>{this._typed=""},500);const o=this._readOptions().findIndex(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._typed));o>=0&&(this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView())}_onTriggerKeydown(e){const t=this._readOptions();if(t.length!==0){if(!this._open){if(["ArrowDown","ArrowUp","Enter"," ","Home","End"].includes(e.key)){if(e.preventDefault(),this._show(),e.key==="Home"&&(this._activeIndex=t.findIndex(o=>!o.disabled)),e.key==="End"){for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){this._activeIndex=o;break}}this.requestUpdate()}else e.key.length===1&&e.key.trim()!==""&&(this._show(),this._typeAhead(e.key));return}switch(e.key){case"ArrowDown":e.preventDefault(),this._moveActive(1);break;case"ArrowUp":e.preventDefault(),this._moveActive(-1);break;case"Home":e.preventDefault(),this._activeIndex=t.findIndex(o=>!o.disabled),this.requestUpdate(),this._scrollActiveIntoView();break;case"End":e.preventDefault();for(let o=t.length-1;o>=0;o--)if(!t[o].disabled){this._activeIndex=o,this.requestUpdate(),this._scrollActiveIntoView();break}break;case"Enter":case" ":{e.preventDefault();const o=t[this._activeIndex];o&&!o.disabled&&this._commit(o.value);break}case"Tab":{const o=t[this._activeIndex];o&&!o.disabled?this._commit(o.value):this._hide();break}case"Escape":e.preventDefault(),this._hide();break;default:e.key.length===1&&e.key.trim()!==""&&this._typeAhead(e.key)}}}};tt.props=["value","label","placeholder","disabled","name"],tt.styles=[Lu],tt.help={title:"Select",summary:"Dropdown picker: a combobox trigger plus a custom top-layer listbox, so the popup wears the station instead of the operating system. Mirrors the <os-segmented> contract (set value, listen for os-pick).",status:"stable",props:[{name:"value",type:"string",description:"Currently selected option value."},{name:"label",type:"string",description:"Visible label rendered above the trigger and used as the accessible name."},{name:"placeholder",type:"string",description:"Trigger text shown when no value is set."},{name:"disabled",type:"boolean attribute",description:"Disables the trigger and dims the chrome."},{name:"plain",type:"boolean attribute",description:"Drops the field chrome and shrinks to the value, for a picker that is a list row’s trailing control rather than a field of its own. The container already draws the box; use with no `label`."},{name:"name",type:"string",description:"Accepted for compatibility. Shadow-DOM controls never participated in light-DOM form submission, so nothing is lost by the native select being gone; read `value` off the host instead."}],slots:[{name:"(default)",description:'<os-option value="…"> children.'}],events:[{name:"os-pick",description:"Fires when the user picks a new option.",detail:"{ value: string }"}],cssProps:[{name:"--os-ui-fg",description:"Label + value colour."},{name:"--os-ui-fg-muted",description:"Placeholder + chevron colour."},{name:"--os-ui-accent",description:"Active option row + selected check."}],example:c`
705 <os-select value="eur" label="Currency">
706 <os-option value="eur">Euro</os-option>
707 <os-option value="usd">US Dollar</os-option>
708 <os-option value="jpy">Japanese Yen</os-option>
709 </os-select>
710 `};let Do=tt;w("os-select",Do);const Du=v`
711 :host {
712 display: flex;
713 flex-direction: column;
714 gap: 4px;
715 font-size: 13px;
716 color: var( --os-ui-fg, #1d2327 );
717 min-width: 0;
718 }
719
720 :host( [ hidden ] ) {
721 display: none;
722 }
723
724 .os-multiselect__label {
725 font-size: 12px;
726 color: var( --os-ui-fg-muted, #646970 );
727 }
728
729 .os-multiselect__trigger {
730 appearance: none;
731 display: inline-flex;
732 align-items: center;
733 justify-content: space-between;
734 gap: 8px;
735 width: 100%;
736 min-width: 0;
737 padding: 7px 12px 7px 12px;
738 background: var( --os-ui-hover, rgba( 0, 0, 0, 0.05 ) );
739 border: 1px solid transparent;
740 border-radius: 7px;
741 font: inherit;
742 font-size: 13px;
743 color: var( --os-ui-fg, #1d2327 );
744 cursor: pointer;
745 text-align: start;
746 transition: background-color 0.12s ease, border-color 0.12s ease,
747 box-shadow 0.12s ease;
748 }
749
750 .os-multiselect__trigger:hover {
751 background: var( --os-ui-hover, rgba( 0, 0, 0, 0.08 ) );
752 }
753
754 .os-multiselect__trigger:focus-visible {
755 outline: none;
756 border-color: var( --os-ui-accent, #2271b1 );
757 box-shadow: var(
758 --os-ui-focus-ring-field,
759 0 0 0 1px #2271b1, 0 0 0 4px rgba( 34, 113, 177, 0.18 )
760 );
761 }
762
763 .os-multiselect__trigger:disabled {
764 opacity: 0.5;
765 cursor: not-allowed;
766 }
767
768 .os-multiselect__trigger[ data-active='true' ] {
769 color: var( --wp-admin-theme-color, #2271b1 );
770 font-weight: 600;
771 }
772
773 .os-multiselect__summary {
774 flex: 1 1 auto;
775 min-width: 0;
776 overflow: hidden;
777 text-overflow: ellipsis;
778 white-space: nowrap;
779 }
780
781 .os-multiselect__chevron {
782 color: var( --os-ui-fg-muted, #646970 );
783 flex-shrink: 0;
784 transition: color 0.12s ease, transform 0.18s ease;
785 }
786
787 .os-multiselect__trigger:hover .os-multiselect__chevron,
788 .os-multiselect__trigger:focus-visible .os-multiselect__chevron {
789 color: var( --os-ui-fg, #1d2327 );
790 }
791
792 :host( [ open ] ) .os-multiselect__chevron {
793 transform: rotate( 180deg );
794 }
795 `;function Pu(){const s="os-multiselect-popover-styles";if(document.getElementById(s))return;const e=document.createElement("style");e.id=s,e.textContent=`
796 .os-multiselect__popover {
797 position: fixed;
798 z-index: 100000;
799 max-height: 320px;
800 overflow-y: auto;
801 min-width: 200px;
802 padding: 4px 0;
803 background: var( --os-window-bg, #fff );
804 color: var( --os-ui-fg, #1d2327 );
805 border: 1px solid var( --os-window-border, #c3c4c7 );
806 border-radius: 8px;
807 box-shadow: 0 8px 28px rgba( 0, 0, 0, 0.18 );
808 font: inherit;
809 font-size: 13px;
810 }
811
812 .os-multiselect__clear {
813 display: block;
814 width: 100%;
815 padding: 6px 12px;
816 font: inherit;
817 font-size: 11px;
818 font-weight: 600;
819 letter-spacing: 0.04em;
820 text-transform: uppercase;
821 text-align: start;
822 border: 0;
823 border-bottom: 1px solid var( --os-window-border, #dcdcde );
824 background: transparent;
825 color: var( --wp-admin-theme-color, #2271b1 );
826 cursor: pointer;
827 }
828
829 .os-multiselect__clear:hover {
830 background: color-mix(
831 in srgb,
832 var( --wp-admin-theme-color, #2271b1 ) 10%,
833 transparent
834 );
835 }
836
837 .os-multiselect__option {
838 display: flex;
839 align-items: center;
840 gap: 8px;
841 padding: 6px 12px;
842 cursor: pointer;
843 user-select: none;
844 }
845
846 .os-multiselect__option:hover {
847 background: var( --os-ui-hover, rgba( 0, 0, 0, 0.05 ) );
848 }
849
850 .os-multiselect__option[ data-disabled='true' ] {
851 opacity: 0.5;
852 cursor: not-allowed;
853 }
854
855 .os-multiselect__option > span {
856 flex: 1 1 auto;
857 min-width: 0;
858 overflow: hidden;
859 text-overflow: ellipsis;
860 white-space: nowrap;
861 }
862
863 .os-multiselect__option > input[ type='checkbox' ] {
864 margin: 0;
865 flex-shrink: 0;
866 accent-color: var( --wp-admin-theme-color, #2271b1 );
867 }
868
869 .os-multiselect__empty {
870 padding: 8px 12px;
871 color: var( --os-ui-fg-muted, #646970 );
872 font-style: italic;
873 }
874
875 .os-multiselect__loading {
876 display: flex;
877 align-items: center;
878 gap: 8px;
879 padding: 8px 12px;
880 color: var( --os-ui-fg-muted, #646970 );
881 font-size: 12px;
882 }
883
884 .os-multiselect__spinner {
885 display: inline-block;
886 width: 12px;
887 height: 12px;
888 border-radius: 50%;
889 border: 2px solid currentColor;
890 border-top-color: transparent;
891 animation: os-multiselect-spin 0.8s linear infinite;
892 }
893
894 @keyframes os-multiselect-spin {
895 to { transform: rotate( 360deg ); }
896 }
897 `,document.head.appendChild(e)}typeof document<"u"&&Pu();const st=class st extends _{constructor(){super(...arguments),this._optionObserver=null,this._popover=null,this._teardownOpen=null,this._hasMore=!1,this._loadingMore=!1}set items(e){const t=this.querySelectorAll(":scope > os-option");for(const n of Array.from(t))n.remove();for(const n of e){const r=document.createElement("os-option");r.setAttribute("value",n.value),r.textContent=n.label,this.appendChild(r)}this._loadingMore=!1;const o=new Set(e.map(n=>n.value)),i=this._readValues().filter(n=>o.has(n));this._writeValueAttribute(i),this.requestUpdate(),this._refreshPopover()}get values(){return this._readValues()}set values(e){const t=Array.isArray(e)?e.map(o=>String(o)).filter(o=>o!==""):[];this._writeValueAttribute(t),this.requestUpdate(),this._refreshPopover()}get hasMore(){return this._hasMore}set hasMore(e){this._hasMore=!!e,this._refreshPopover()}get loadingMore(){return this._loadingMore}set loadingMore(e){this._loadingMore=!!e,this._refreshPopover()}appendItems(e){if(this._loadingMore=!1,!e||e.length===0){this._refreshPopover();return}const t=new Set(Array.from(this.querySelectorAll(":scope > os-option")).map(o=>o.getAttribute("value")));for(const o of e){if(t.has(o.value))continue;const i=document.createElement("os-option");i.setAttribute("value",o.value),i.textContent=o.label,this.appendChild(i)}this.requestUpdate(),this._refreshPopover()}connectedCallback(){super.connectedCallback(),He(this),this._optionObserver=new MutationObserver(()=>{this.requestUpdate(),this._refreshPopover()}),this._optionObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","disabled"],characterData:!0})}disconnectedCallback(){this._optionObserver?.disconnect(),this._optionObserver=null,this._closePopover()}render(){const e=this.label||"",t=this.placeholder||"All",o=this.disabled!==null;e?this.setAttribute("aria-label",e):this.removeAttribute("aria-label");const i=e||t,n=this._summarize(t),r=this._readValues().length>0,l=`${this.id||"os-unnamed"}__trigger`;return c`
898 ${e?c`<label
899 class="os-multiselect__label"
900 for=${l}
901 >${e}</label>`:c``}
902 <button
903 id=${l}
904 type="button"
905 class="os-multiselect__trigger"
906 aria-haspopup="listbox"
907 aria-expanded=${this._isOpen()?"true":"false"}
908 aria-label=${i}
909 ?disabled=${o}
910 data-active=${r?"true":"false"}
911 @click=${u=>this._onTriggerClick(u)}
912 >
913 <span class="os-multiselect__summary">${n}</span>
914 ${N("chevron-right",{size:16,rotate:90,className:"os-multiselect__chevron"})}
915 </button>
916 `}_readOptions(){const e=[],t=this.querySelectorAll(":scope > os-option");for(const o of Array.from(t)){const i=o.getAttribute("value");i!==null&&e.push({value:i,label:(o.textContent||i).trim(),disabled:o.hasAttribute("disabled")})}return e}_readValues(){return(this.value??"").split(",").map(t=>t.trim()).filter(t=>t!=="")}_writeValueAttribute(e){const t=e.join(",");this.value=t}_summarize(e){const t=this._readValues();if(t.length===0)return e;const o=this._readOptions(),i=new Map(o.map(n=>[n.value,n.label]));return t.length===1?i.get(t[0])??t[0]:`${t.length} selected`}_isOpen(){return this.open!==null}_onTriggerClick(e){e.stopPropagation(),e.preventDefault(),this.disabled===null&&(this._popover?this._closePopover():this._openPopover())}_openPopover(){if(this._popover)return;const e=document.createElement("div");e.className="os-multiselect__popover",e.setAttribute("role","listbox"),e.setAttribute("aria-multiselectable","true"),e.style.setProperty("--wp-admin-theme-color",getComputedStyle(this).getPropertyValue("--wp-admin-theme-color")||"#2271b1"),document.body.appendChild(e),this._popover=e,this._refreshPopover(),this._placePopover();const t=r=>{const a=r.target;if(!a)return;const l=this.shadowRoot?.querySelector(".os-multiselect__trigger");e.contains(a)||l&&l.contains(a)||this._closePopover()},o=r=>{r.key==="Escape"&&(r.stopPropagation(),this._closePopover(),this.shadowRoot?.querySelector(".os-multiselect__trigger")?.focus())},i=()=>this._placePopover(),n=()=>{if(!this._hasMore||this._loadingMore)return;const r=e.scrollHeight,a=e.clientHeight,l=e.scrollTop;r-(l+a)<64&&this.emit("os-multiselect-load-more",{})};setTimeout(()=>{document.addEventListener("pointerdown",t,!0)},0),document.addEventListener("keydown",o,!0),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),e.addEventListener("scroll",n),this._teardownOpen=()=>{document.removeEventListener("pointerdown",t,!0),document.removeEventListener("keydown",o,!0),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),e.removeEventListener("scroll",n)},this.setAttribute("open",""),this.requestUpdate(),this.emit("os-multiselect-open",{})}_closePopover(){this._teardownOpen&&(this._teardownOpen(),this._teardownOpen=null),this._popover&&(this._popover.remove(),this._popover=null,this.removeAttribute("open"),this.requestUpdate(),this.emit("os-multiselect-close",{}))}_refreshPopover(){const e=this._popover;if(!e)return;const t=this._readOptions(),o=new Set(this._readValues());if(e.replaceChildren(),t.length===0){const i=document.createElement("div");i.className="os-multiselect__empty",i.textContent="No options",e.appendChild(i);return}if(o.size>0){const i=document.createElement("button");i.type="button",i.className="os-multiselect__clear",i.textContent="Clear",i.addEventListener("click",n=>{n.preventDefault(),n.stopPropagation(),this._writeValueAttribute([]),this.requestUpdate(),this._refreshPopover(),this._emitPick()}),e.appendChild(i)}for(const i of t){const n=document.createElement("label");n.className="os-multiselect__option",n.setAttribute("role","option"),n.setAttribute("aria-selected",o.has(i.value)?"true":"false"),i.disabled&&(n.setAttribute("aria-disabled","true"),n.dataset.disabled="true");const r=document.createElement("input");r.type="checkbox",r.checked=o.has(i.value),r.disabled=i.disabled,r.addEventListener("change",()=>{const l=new Set(this._readValues());r.checked?l.add(i.value):l.delete(i.value);const u=t.map(h=>h.value).filter(h=>l.has(h));this._writeValueAttribute(u),n.setAttribute("aria-selected",r.checked?"true":"false"),this.requestUpdate(),this._refreshPopover(),this._emitPick()});const a=document.createElement("span");a.textContent=i.label,n.appendChild(r),n.appendChild(a),e.appendChild(n)}if(this._loadingMore){const i=document.createElement("div");i.className="os-multiselect__loading";const n=document.createElement("span");n.className="os-multiselect__spinner",n.setAttribute("aria-hidden","true");const r=document.createElement("span");r.textContent="Loading…",i.appendChild(n),i.appendChild(r),e.appendChild(i)}}_placePopover(){const e=this._popover,t=this.shadowRoot?.querySelector(".os-multiselect__trigger");if(!e||!t)return;const o=t.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight,r=Math.max(o.width,200);e.style.minWidth=`${r}px`;let a=o.left;a+r>i-8&&(a=Math.max(8,i-r-8)),e.style.left=`${a}px`,e.style.top=`${o.bottom+4}px`;const l=e.offsetHeight||200;o.bottom+4+l>n-8&&(e.style.top=`${Math.max(8,o.top-l-4)}px`)}_emitPick(){const e=this._readValues();this.emit("os-pick",{value:e.join(","),values:e})}};st.props=["value","label","placeholder","disabled","name","open"],st.styles=[Du],st.help=void 0;let Po=st;w("os-multiselect",Po);const Nu=v` ${C}:host{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}label{display:inline-flex;align-items:center;gap:8px}input[ type='color' ]{width:28px;height:28px;padding:0;border:1px solid var( --os-ui-border,#c3c4c7 );border-radius:6px;background:transparent;cursor:pointer;transition:border-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='color' ]:hover{border-color:var( --os-ui-border-strong,#8c8f94 )}input[ type='color' ]:focus-visible{outline:none;box-shadow:var( --_holo-focus )}:host( [ variant='block' ] ){display:flex;width:100%}:host( [ variant='block' ] ) label{display:flex;flex:1;align-items:center}:host( [ variant='block' ] ) input[ type='color' ]{flex:1;width:auto;height:32px}input[ type='color' ]::-webkit-color-swatch-wrapper{padding:2px}input[ type='color' ]::-webkit-color-swatch{border:none;border-radius:2px}`,ot=class ot extends _{open(){const e=()=>{const t=this.shadowRoot?.querySelector("input");if(!t)return!1;try{t.showPicker()}catch{t.click()}return!0};e()||queueMicrotask(()=>void e())}render(){const e=this.label||"",t=this.value||"#000000";return c`
917 <label>
918 <span class="os-color-field__label">${e}</span>
919 <input
920 type="color"
921 .value=${t}
922 @input=${o=>this._onInput(o)}
923 />
924 </label>
925 `}_onInput(e){const t=e.target;this.value=t.value,this.emit("os-color-change",{value:t.value})}};ot.props=["name","label","value","variant"],ot.styles=[Nu],ot.help=void 0;let No=ot;w("os-color-field",No);const Mu=v` ${C}:host{display:flex;align-items:center;gap:10px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}input[ type='range' ]{appearance:none;-webkit-appearance:none;flex:1;min-width:0;height:18px;margin:0;padding:0;background:transparent;cursor:pointer}input[ type='range' ]:disabled{cursor:not-allowed;opacity:0.5}input[ type='range' ]::-webkit-slider-runnable-track{height:6px;border-radius:999px;background-image:linear-gradient( var( --_range-angle,90deg ),transparent var( --_fill,0% ),var( --_holo-track ) var( --_fill,0% ) ),linear-gradient( var( --os-ui-accent,#2271b1 ),var( --os-ui-accent,#2271b1 ) );background-size:auto,auto;background-position:center,center;background-repeat:no-repeat;box-shadow:inset 0 0 0 1px var( --_holo-track-edge )}input[ type='range' ]::-moz-range-track{height:6px;border-radius:999px;background-image:linear-gradient( var( --_range-angle,90deg ),transparent var( --_fill,0% ),var( --_holo-track ) var( --_fill,0% ) ),linear-gradient( var( --os-ui-accent,#2271b1 ),var( --os-ui-accent,#2271b1 ) );background-size:auto,auto;background-position:center,center;background-repeat:no-repeat;box-shadow:inset 0 0 0 1px var( --_holo-track-edge )}input[ type='range' ]::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:16px;height:16px;margin-top:-5px;border:0;border-radius:50%;background:var( --os-ui-switch-knob,#fffbff );box-shadow:0 1px 3px rgba( 12,11,15,0.5 ),0 0 0 1px rgba( 12,11,15,0.14 );cursor:inherit;transition:transform var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='range' ]::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background:var( --os-ui-switch-knob,#fffbff );box-shadow:0 1px 3px rgba( 12,11,15,0.5 ),0 0 0 1px rgba( 12,11,15,0.14 );cursor:inherit;transition:transform var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}input[ type='range' ]:active::-webkit-slider-thumb{transform:scale( 1.15 );box-shadow:var( --_holo-glow-strong )}input[ type='range' ]:active::-moz-range-thumb{transform:scale( 1.15 );box-shadow:var( --_holo-glow-strong )}input[ type='range' ]:focus-visible{outline:none}input[ type='range' ]:focus-visible::-webkit-slider-thumb{box-shadow:var( --_holo-focus )}input[ type='range' ]:focus-visible::-moz-range-thumb{box-shadow:var( --_holo-focus )}.os-range-field__value{width:var( --os-ui-range-readout-width,3ch );flex:none;text-align:end;font-variant-numeric:tabular-nums;color:var( --os-ui-fg,#1d2327 )}@media ( prefers-reduced-motion:reduce ){input[ type='range' ]::-webkit-slider-thumb{transition-duration:1ms}input[ type='range' ]::-moz-range-thumb{transition-duration:1ms}}`;function zu(s,e,t){const o=Number.parseFloat(s),i=Number.parseFloat(e),n=Number.parseFloat(t);if(!Number.isFinite(o)||!Number.isFinite(i)||!Number.isFinite(n)||n===i)return"0%";const r=(o-i)/(n-i);return`${Math.min(100,Math.max(0,r*100)).toFixed(2)}%`}function Ou(s){const e=s.indexOf(".");return e<0?0:Math.min(3,s.length-e-1)}function Wu(s,e,t,o){const i=r=>{const a=Number.parseFloat(r);return Number.isFinite(a)?String(Math.trunc(Math.abs(a))).length+(a<0?1:0):3};return Math.max(i(s),i(e))+(t>0?t+1:0)+o.length}const it=class it extends _{render(){const e=this.label||"",t=this.value||"0",o=this.min||"0",i=this.max||"100",n=this.step||"1",r=this.suffix||"",a=this.decimals,l=a?Math.min(6,Math.max(0,Number.parseInt(a,10)||0)):Ou(n),u=Number.parseFloat(t),h=Number.isFinite(u)?u.toFixed(l):t,p=Wu(o,i,l,r);return c`
926 <label class="os-range-field__label">${e}</label>
927 <input
928 type="range"
929 min=${o}
930 max=${i}
931 step=${n}
932 style="--_fill: ${zu(t,o,i)}"
933 .value=${t}
934 @input=${g=>this._onInput(g)}
935 />
936 <span
937 class="os-range-field__value"
938 style="--os-ui-range-readout-width: ${p}ch"
939 >${h}${r}</span
940 >
941 `}connectedCallback(){super.connectedCallback(),getComputedStyle(this).direction==="rtl"&&this.style.setProperty("--_range-angle","270deg")}_onInput(e){const t=e.target,o=parseFloat(t.value);Number.isFinite(o)&&(this.value=String(o),this.emit("os-range-change",{value:o}))}};it.props=["name","label","value","min","max","step","suffix","decimals"],it.styles=[Mu],it.help=void 0;let Mo=it;w("os-range-field",Mo);const ia=v` ${C} ${_o}: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}`,nt=class nt extends _{constructor(){super(...arguments),this._revealed=!1}connectedCallback(){super.connectedCallback(),He(this)}render(){const e=this.label||"",t=this.hideLabel!==null,o=this.value??"",i=this.placeholder||"",n=this.disabled!==null,r=this.readonly!==null,a=this.autocomplete,l=this.type||"text",u=l==="password";let h=a||"off";u&&(!a||h==="off")&&(h="new-password");const p=this.maxlength,g=this.minlength,b=this.pattern||"",m=this.name||"",x=this.suffix||"",y=this.invalid!==null,k=this.reveal!==null,f=this.clearable!==null,A=l==="password",$=A&&!(k&&this._revealed);let R;A||k&&this._revealed?R="text":R=l;const I=["os-text-field__row",k?"os-text-field__row--has-reveal":"",f?"os-text-field__row--has-clear":""].filter(Boolean).join(" "),O=$?"os-text-field__input os-text-field__input--masked":"os-text-field__input",X=`${this.id||"os-unnamed"}__input`;return c`
942 ${e?c`<label
943 class=${t?"os-text-field__label os-text-field__label--hidden":"os-text-field__label"}
944 for=${X}
945 >${e}</label>`:c``}
946 <span class=${I}>
947 <input
948 id=${X}
949 class=${O}
950 type=${R}
951 .value=${o}
952 placeholder=${i}
953 ?disabled=${n}
954 ?readonly=${r}
955 autocomplete=${h}
956 maxlength=${p??""}
957 minlength=${g??""}
958 pattern=${b}
959 name=${m}
960 aria-invalid=${y?"true":"false"}
961 aria-label=${e||""}
962 @input=${ye=>this._onInput(ye)}
963 @change=${ye=>this._onChange(ye)}
964 @keydown=${ye=>this._onKeyDown(ye)}
965 />
966 ${x?c`<span class="os-text-field__suffix">${x}</span>`:c``}
967 ${f&&o!==""?this._renderClearButton(n):c``}
968 ${k?this._renderRevealButton(n):c``}
969 </span>
970 `}_renderClearButton(e){return c`
971 <button
972 type="button"
973 class="os-text-field__clear"
974 aria-label="Clear"
975 ?disabled=${e}
976 tabindex="0"
977 @click=${()=>this._onClear()}
978 >
979 ${Hu()}
980 </button>
981 `}_onClear(){this.value="",this.emit("os-input-change",{value:""}),this.emit("os-input-commit",{value:""}),this.shadowRoot?.querySelector("input")?.focus()}_renderRevealButton(e){const t=this._revealed?"Hide":"Show";return c`
982 <button
983 type="button"
984 class="os-text-field__reveal"
985 aria-label=${t}
986 aria-pressed=${this._revealed?"true":"false"}
987 ?disabled=${e}
988 tabindex="0"
989 @click=${()=>this._onToggleReveal()}
990 >
991 ${this._revealed?qu():Uu()}
992 </button>
993 `}_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})}}};nt.props=["label","hideLabel","value","placeholder","disabled","readonly","autocomplete","type","maxlength","minlength","pattern","name","suffix","invalid","reveal","clearable"],nt.styles=[ia],nt.help=void 0;let zo=nt;w("os-text-field",zo);function Hu(){return c`
994 <svg
995 viewBox="0 0 16 16"
996 width="14"
997 height="14"
998 fill="none"
999 stroke="currentColor"
1000 stroke-width="1.5"
1001 stroke-linecap="round"
1002 aria-hidden="true"
1003 focusable="false"
1004 >
1005 <path d="M4 4l8 8M12 4l-8 8" />
1006 </svg>
1007 `}function Uu(){return c`
1008 <svg
1009 viewBox="0 0 16 16"
1010 width="14"
1011 height="14"
1012 fill="none"
1013 stroke="currentColor"
1014 stroke-width="1.5"
1015 stroke-linecap="round"
1016 stroke-linejoin="round"
1017 aria-hidden="true"
1018 focusable="false"
1019 >
1020 <path d="M1 8C1 8 3.5 3 8 3s7 5 7 5-2.5 5-7 5S1 8 1 8z" />
1021 <circle cx="8" cy="8" r="2" />
1022 </svg>
1023 `}function qu(){return c`
1024 <svg
1025 viewBox="0 0 16 16"
1026 width="14"
1027 height="14"
1028 fill="none"
1029 stroke="currentColor"
1030 stroke-width="1.5"
1031 stroke-linecap="round"
1032 stroke-linejoin="round"
1033 aria-hidden="true"
1034 focusable="false"
1035 >
1036 <path d="M1 8C1 8 3.5 3 8 3s7 5 7 5-2.5 5-7 5S1 8 1 8z" />
1037 <circle cx="8" cy="8" r="2" />
1038 <line x1="2" y1="2" x2="14" y2="14" />
1039 </svg>
1040 `}const rt=class rt extends _{connectedCallback(){super.connectedCallback(),He(this)}render(){const e=this.label||"",t=this.value??"",o=this.placeholder||"",i=this.disabled!==null,n=this.readonly!==null,r=this.name||"",a=this.suffix||"",l=this.min,u=this.max,h=this.step||"any",p=this.invalid!==null,b=`${this.id||"os-unnamed"}__input`;return c`
1041 ${e?c`<label
1042 class="os-text-field__label"
1043 for=${b}
1044 >${e}</label>`:c``}
1045 <span class="os-text-field__row">
1046 <input
1047 id=${b}
1048 type="number"
1049 .value=${t}
1050 placeholder=${o}
1051 ?disabled=${i}
1052 ?readonly=${n}
1053 inputmode="decimal"
1054 autocomplete="off"
1055 min=${l??""}
1056 max=${u??""}
1057 step=${h}
1058 name=${r}
1059 aria-invalid=${p?"true":"false"}
1060 aria-label=${e||""}
1061 @input=${m=>this._onInput(m)}
1062 @change=${m=>this._onCommit(m)}
1063 @keydown=${m=>this._onKeyDown(m)}
1064 />
1065 ${a?c`<span class="os-text-field__suffix">${a}</span>`:c``}
1066 </span>
1067 `}_readRange(){const e=this.min,t=this.max,o=e!==null?parseFloat(e):-1/0,i=t!==null?parseFloat(t):1/0;return{min:Number.isFinite(o)?o:-1/0,max:Number.isFinite(i)?i:1/0}}_clamp(e){const{min:t,max:o}=this._readRange();return e<t?t:e>o?o:e}_onInput(e){const t=e.target,o=parseFloat(t.value);Number.isFinite(o)&&(this.value=String(o),this.emit("os-input-change",{value:o}))}_onCommit(e){const t=e.target,o=parseFloat(t.value);if(!Number.isFinite(o))return;const i=this._clamp(o);i!==o&&(t.value=String(i),this.value=String(i)),this.emit("os-input-commit",{value:i})}_onKeyDown(e){if(e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey){const t=e.target,o=parseFloat(t.value);if(!Number.isFinite(o))return;const i=this._clamp(o);i!==o&&(t.value=String(i),this.value=String(i)),this.emit("os-submit",{value:i})}}};rt.props=["label","value","placeholder","disabled","readonly","name","suffix","min","max","step","invalid"],rt.styles=[ia],rt.help=void 0;let Oo=rt;w("os-number-field",Oo);const Fu=v` ${C} ${$s}:host{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var( --os-ui-fg,#1d2327 );cursor:pointer}:host( [ disabled ] ){cursor:not-allowed;opacity:0.55}:host( [ block ] ){display:flex;cursor:default}:host( [ block ] ) label{cursor:pointer}:host( [ block ][ disabled ] ) label{cursor:not-allowed}label{display:inline-flex;align-items:center;gap:6px;cursor:inherit}.os-checkbox__label{line-height:1.3}.os-checkbox__label:empty{display:none}`,at=class at extends _{render(){const e=this.checked!==null,t=this.disabled!==null,o=this.label||"",i=this.value;return c`
1068 <label>
1069 <input
1070 type="checkbox"
1071 .checked=${e}
1072 ?disabled=${t}
1073 .value=${i??""}
1074 @change=${n=>this._onChange(n)}
1075 />
1076 <span class="os-checkbox__label">${o}</span>
1077 </label>
1078 `}_onChange(e){const o=e.target.checked;o?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:o,value:this.value})}};at.props=["checked","value","label","disabled"],at.styles=[Fu],at.help=void 0;let Wo=at;w("os-checkbox",Wo);const Vu=v` ${C} ${$s}:host{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var( --os-ui-fg,#1d2327 );cursor:pointer;-webkit-user-select:none;user-select:none}label{display:inline-flex;align-items:center;gap:8px;cursor:pointer}:host( [ disabled ] ){opacity:0.5;cursor:not-allowed}:host( [ disabled ] ) label,:host( [ disabled ] ) input[ type='checkbox' ]{cursor:not-allowed}`,lt=class lt extends _{render(){const e=this.label||"",t=this.checked!==null,o=this.disabled!==null;return c`
1079 <label>
1080 <input
1081 type="checkbox"
1082 ?checked=${t}
1083 ?disabled=${o}
1084 @change=${i=>this._onChange(i)}
1085 />
1086 <span class="os-checkbox-label__text">${e}</span>
1087 </label>
1088 `}_onChange(e){if(this.disabled!==null)return;const t=e.target.checked;t?this.setAttribute("checked",""):this.removeAttribute("checked"),this.emit("os-checkbox-change",{checked:t})}};lt.props=["label","checked","disabled"],lt.styles=[Vu],lt.help=void 0;let Ho=lt;w("os-checkbox-label",Ho);const ju=v` ${C}:host{--_h:22px;--_pad:2px;--_knob:calc( var( --_h ) - 2 * var( --_pad ) );--_travel:calc( var( --_w ) - var( --_knob ) - 2 * var( --_pad ) );--_w:calc( var( --_h ) * 1.85 );--_drag:0px;--_dir:1;display:inline-flex;align-items:center;gap:10px;font-size:13px;line-height:1.3;color:var( --os-ui-fg,#1d2327 );cursor:pointer;-webkit-user-select:none;user-select:none}:host( [ size='sm' ] ){--_h:16px;--_pad:2px;font-size:12px;gap:8px}:host( [ size='lg' ] ){--_h:30px;--_pad:3px;font-size:14px;gap:12px}:host( [ block ] ){display:flex;width:100%;justify-content:space-between}:host( [ label-position='start' ] ) .os-switch__row{flex-direction:row-reverse}:host( [ disabled ] ){cursor:not-allowed;opacity:0.5}.os-switch__row{display:inline-flex;align-items:center;gap:inherit;flex:1 1 auto;justify-content:inherit}button{appearance:none;flex:0 0 auto;position:relative;box-sizing:border-box;width:var( --_w );height:var( --_h );padding:0;margin:0;border:0;border-radius:999px;background-color:var( --_holo-track );background-image:none;box-shadow:inset 0 0 0 1px var( --_holo-track-edge );cursor:inherit;outline:none;transition:background-color var( --_holo-t ) ease,box-shadow var( --_holo-t ) ease}button:disabled{cursor:not-allowed}:host( [ checked ] ) button{background-image:none;background-color:var( --os-ui-accent,#2271b1 );box-shadow:none}button:focus-visible{box-shadow:var( --_holo-focus ),inset 0 0 0 1px var( --_holo-track-edge )}:host( [ checked ] ) button:focus-visible{box-shadow:var( --_holo-focus )}:host( [ tone='accent' ][ checked ] ) button,:host( [ tone='danger' ][ checked ] ) button,:host( [ tone='success' ][ checked ] ) button{background-image:none}:host( [ tone='accent' ][ checked ] ) button{background-color:var( --os-ui-accent,#2271b1 )}:host( [ tone='danger' ][ checked ] ) button{background-color:var( --os-ui-danger,#d63638 );box-shadow:0 0 0 1px rgba( 255,90,90,0.3 ),0 2px 10px rgba( 255,90,90,0.25 )}:host( [ tone='success' ][ checked ] ) button{background-color:var( --os-ui-success-fg,#00a32a );box-shadow:0 0 0 1px rgba( 147,240,198,0.3 ),0 2px 10px rgba( 147,240,198,0.25 )}.os-switch__knob{position:absolute;top:var( --_pad );inset-inline-start:var( --_pad );width:var( --_knob );height:var( --_knob );border-radius:999px;background:var( --os-ui-switch-knob,#fffbff );box-shadow:0 1px 2px rgba( 12,11,15,0.45 ),0 0 0 1px var( --os-ui-switch-knob-edge,rgba( 12,11,15,0.55 ) );pointer-events:none;transition:transform var( --_holo-t ) var( --_holo-spring ),width var( --_holo-t ) ease}.os-switch__knob{transform:translateX( calc( var( --_dir ) * var( --_drag ) ) )}:host( [ checked ] ) .os-switch__knob{transform:translateX( calc( var( --_dir ) * ( var( --_travel ) + var( --_drag ) ) ) )}:host(:not( [ disabled ] ) ) button:active .os-switch__knob{width:calc( var( --_knob ) * 1.28 )}:host( [ checked ]:not( [ disabled ] ) ) button:active .os-switch__knob{width:calc( var( --_knob ) * 1.28 );transform:translateX( calc( var( --_dir ) * ( var( --_travel ) - var( --_knob ) * 0.28 + var( --_drag ) ) ) )}:host( [ data-dragging ] ) .os-switch__knob{transition:width var( --_holo-t ) ease}.os-switch__label{line-height:1.3}.os-switch__label:empty{display:none}.os-switch__text{display:flex;flex-direction:column;gap:2px;min-width:0}.os-switch__description{font-size:0.92em;color:var( --os-ui-fg-muted,#646970 )}@media ( prefers-reduced-motion:reduce ){.os-switch__knob{transition-duration:1ms}}`,Ku=4,ct=class ct extends _{constructor(){super(...arguments),this._pointerId=null,this._startX=0,this._travel=0,this._moved=!1,this._dir=1,this._swallowClick=!1}render(){const e=this._attr("checked")!==null,t=this._attr("disabled")!==null,o=this._attr("label")||"",i=this._attr("description")||"";return c`
1089 <div class="os-switch__row">
1090 <span class="os-switch__text">
1091 <span class="os-switch__label">${o}</span>
1092 <span class="os-switch__description" id="os-switch-desc"
1093 >${i}</span
1094 >
1095 </span>
1096 <button
1097 type="button"
1098 role="switch"
1099 aria-checked=${e?"true":"false"}
1100 aria-label=${o||"Toggle"}
1101 aria-describedby=${i?"os-switch-desc":""}
1102 ?disabled=${t}
1103 @click=${()=>this._onClick()}
1104 @keydown=${n=>this._onKeyDown(n)}
1105 @pointerdown=${n=>this._onPointerDown(n)}
1106 @pointermove=${n=>this._onPointerMove(n)}
1107 @pointerup=${n=>this._onPointerUp(n)}
1108 @pointercancel=${()=>this._endGesture()}
1109 >
1110 <span class="os-switch__knob"></span>
1111 </button>
1112 </div>
1113 `}_onPointerDown(e){if(this._attr("disabled")!==null)return;const t=e.currentTarget;this._pointerId=e.pointerId,this._startX=e.clientX,this._moved=!1,this._dir=getComputedStyle(this).direction==="rtl"?-1:1,this.style.setProperty("--_dir",String(this._dir)),this._travel=Math.max(0,t.clientWidth-t.clientHeight),t.setPointerCapture(e.pointerId)}_onPointerMove(e){if(this._pointerId!==e.pointerId||this._travel===0)return;const t=(e.clientX-this._startX)*this._dir;if(!this._moved&&Math.abs(t)>=Ku&&(this._moved=!0,this.setAttribute("data-dragging","")),!this._moved)return;const o=this._attr("checked")!==null,i=o?-this._travel:0,n=o?0:this._travel;this.style.setProperty("--_drag",`${Math.min(n,Math.max(i,t))}px`)}_onPointerUp(e){if(this._pointerId!==e.pointerId)return;const t=this._moved,o=(e.clientX-this._startX)*this._dir;if(this._swallowClick=t,this._endGesture(),!t)return;const i=this._attr("checked")!==null,r=(i?this._travel:0)+o>this._travel/2;r!==i&&this._commit(r)}_endGesture(){this._pointerId=null,this._moved=!1,this.removeAttribute("data-dragging"),this.style.removeProperty("--_drag")}_onClick(){if(this._swallowClick){this._swallowClick=!1;return}this._attr("disabled")===null&&this._commit(this._attr("checked")===null)}_onKeyDown(e){this._attr("disabled")===null&&(e.key==="ArrowRight"||e.key==="End"?(e.preventDefault(),this._attr("checked")===null&&this._commit(!0)):(e.key==="ArrowLeft"||e.key==="Home")&&(e.preventDefault(),this._attr("checked")!==null&&this._commit(!1)))}_commit(e){e?this.setAttribute("checked",""):this.removeAttribute("checked");const t={checked:e,value:this._attr("value")};this.emit("os-switch-change",t),this.emit("os-checkbox-change",t)}_attr(e){return this[e]??null}};ct.props=["name","checked","value","label","description","disabled","size","tone","block","labelPosition"],ct.styles=[ju],ct.help=void 0;let Uo=ct;w("os-switch",Uo);const Bu=v`:host{position:fixed;top:calc( var( --os-admin-bar-height,var( --wp-admin--admin-bar--height,32px ) ) + 16px );inset-inline-end:16px;display:flex;flex-direction:column;gap:8px;z-index:calc( var( --os-z-fullscreen,99999 ) + 10 );pointer-events:none}`,Gu=v` ${C}:host{position:relative;overflow:hidden;display:flex;align-items:center;gap:12px;min-width:280px;max-width:420px;padding:10px 14px;background-color:var( --os-ui-toast-bg,var( --os-ui-modal-bg,#1d2327 ) );background-image:var( --os-ui-toast-bg-image,none );background-repeat:var( --os-ui-toast-bg-image-repeat,repeat );background-size:var( --os-ui-toast-bg-image-size,auto );background-position:var( --os-ui-toast-bg-image-position,center );color:var( --os-ui-fg-on-accent,#fff );border-radius:10px;border:1px solid var( --os-ui-border,rgba( 255,255,255,0.12 ) );box-shadow:0 10px 30px rgba( 0,0,0,0.4 ),0 2px 6px rgba( 0,0,0,0.18 ),inset 0 0 0 1px rgba( 255,255,255,0.04 );font-size:13px;line-height:1.4;opacity:0;transform:translateY( -10px ) scale( 0.97 );transition:opacity var( --_holo-t-fast ) linear,transform var( --_holo-t ) var( --_holo-spring );pointer-events:auto}:host( [ state='in' ] ){opacity:1;transform:translateY( 0 ) scale( 1 )}:host( [ state='out' ] ){opacity:0;transform:translateX( 16px ) scale( 0.97 );transition:opacity var( --_holo-t-fast ) linear,transform var( --_holo-t ) var( --_holo-ease )}.os-toast__label{flex:1}.os-toast__icon{display:inline-flex;flex-shrink:0;color:var( --os-ui-toast-accent,currentColor )}.os-toast__icon[ hidden ]{display:none}:host( [ tone ] )::before{content:'';position:absolute;inset-block:0;inset-inline-start:0;width:3px;background:var( --os-ui-toast-accent,transparent )}:host( [ tone='positive' ] ){--os-ui-toast-accent:var( --os-ui-notice-success,var( --os-ui-success-fg,#1a7f37 ) )}:host( [ tone='warning' ] ){--os-ui-toast-accent:var( --os-ui-notice-warning,var( --os-ui-warning-fg,#9a6700 ) )}:host( [ tone='critical' ] ){--os-ui-toast-accent:var( --os-ui-notice-error,var( --os-ui-danger,#cf222e ) )}:host( [ tone='neutral' ] ){--os-ui-toast-accent:var( --os-ui-notice-neutral,var( --os-ui-fg-muted,#57606a ) )}button[ hidden ]{display:none}button{flex-shrink:0;padding:4px 10px;border:none;border-radius:4px;background:var( --os-ui-hover,rgba( 255,255,255,0.12 ) );color:var( --os-ui-fg-on-accent,#fff );font:inherit;font-size:12px;font-weight:500;cursor:pointer;transition:background-color 0.12s ease}button:hover{background:var( --os-ui-scrim,rgba( 255,255,255,0.22 ) )}button:focus-visible{outline:2px solid var( --os-ui-border,rgba( 255,255,255,0.6 ) );outline-offset:2px}.os-toast__close{display:inline-flex;align-items:center;justify-content:center;padding:4px;border-radius:6px;background:transparent;color:var( --os-ui-fg-muted,rgba( 255,255,255,0.7 ) )}.os-toast__close:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.14 ) );color:var( --os-ui-fg-on-accent,#fff )}@media ( prefers-reduced-motion:reduce ){:host{transition-duration:0.01ms}}`,Os=class Os extends _{connectedCallback(){super.connectedCallback(),this.setAttribute("aria-live","polite")}render(){return c`<slot></slot>`}};Os.styles=[Bu],Os.help=void 0;let qo=Os;w("os-toast-container",qo);const Xu={positive:"check",warning:"warning",critical:"warning",neutral:"info"},dt=class dt extends _{constructor(){super(...arguments),this._hovered=!1,this._focused=!1,this._onEnter=()=>{this._hovered=!0,this._syncHold()},this._onLeave=()=>{this._hovered=!1,this._syncHold()},this._onFocusIn=()=>{this._focused=!0,this._syncHold()},this._onFocusOut=e=>{const t=e.relatedTarget;t instanceof Node&&this._containsDeep(t)||(this._focused=!1,this._syncHold())}}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","status"),this.addEventListener("mouseenter",this._onEnter),this.addEventListener("mouseleave",this._onLeave),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("focusout",this._onFocusOut)}disconnectedCallback(){this.removeEventListener("mouseenter",this._onEnter),this.removeEventListener("mouseleave",this._onLeave),this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("focusout",this._onFocusOut)}_containsDeep(e){let t=e;for(;t;){if(t===this)return!0;const o=t.parentNode;t=o instanceof ShadowRoot?o.host:o}return!1}_syncHold(){const e=this._hovered||this._focused;e!==this.hasAttribute("held")&&(e?this.setAttribute("held",""):this.removeAttribute("held"),this.emit("os-toast-hold",{held:e}))}render(){const e=this.action||"",t=this.hasAttribute("dismissible"),o=this.tone||"";return c`
1114 <span class="os-toast__icon" ?hidden=${!o} aria-hidden="true">
1115 ${N(Xu[o]??"info",{size:16})}
1116 </span>
1117 <span class="os-toast__label"><slot></slot></span>
1118 <button
1119 type="button"
1120 ?hidden=${!e}
1121 @click=${i=>this._onAction(i)}
1122 >
1123 ${e}
1124 </button>
1125 <button
1126 type="button"
1127 class="os-toast__close"
1128 aria-label=${d("Dismiss")}
1129 ?hidden=${!t}
1130 @click=${i=>this._onDismiss(i)}
1131 >
1132 ${N("close",{size:16})}
1133 </button>
1134 `}_onAction(e){e.preventDefault(),e.stopPropagation(),this.emit("os-toast-action",{})}_onDismiss(e){e.preventDefault(),e.stopPropagation(),this.emit("os-toast-dismiss",{})}};dt.props=["action","state","dismissible","tone"],dt.styles=[Gu],dt.help={title:"Toast",summary:'Single transient notification. Message is slotted; fade-in / fade-out is CSS-driven by flipping the state attribute between "in" and "out". Usually created via the showToast() helper rather than authored by hand.',status:"stable",props:[{name:"action",type:"string",description:"Optional action button label. When set, a button renders on the right and emits os-toast-action on click."},{name:"state",type:"'in' | 'out'",description:'Drives the CSS fade transition. Set to "in" when rendered, flip to "out" before removal.'},{name:"dismissible",type:"boolean",description:"When set, a close (×) button renders on the right and emits os-toast-dismiss on click. Use for persistent toasts the user must be able to close."},{name:"tone",type:"'positive' | 'warning' | 'critical' | 'neutral'",description:"What kind of news this is. Paints a coloured edge and a leading icon from the palette’s notice tokens; absent, the toast is the plain dark chip. showToast() sets it from the type option through the server’s toast-type registry."},{name:"held",type:"boolean (reflected, read-only)",description:"Set by the component while the pointer is over the toast or focus is inside it. showToast() pauses the auto-dismiss timer for as long as it is present. Do not set it by hand — pass `persistent` for a toast that should never expire."}],slots:[{name:"(default)",description:"Message text."}],events:[{name:"os-toast-action",description:"Fires when the action button is clicked.",detail:"{}"},{name:"os-toast-dismiss",description:"Fires when the close (×) button is clicked.",detail:"{}"},{name:"os-toast-hold",description:"Fires when the toast starts or stops being attended to — pointer over it, or focus inside it. showToast() pauses the auto-dismiss timer while held is true.",detail:"{ held: boolean }"}],example:c`
1135 <os-toast state="in" action="Undo">Post moved to trash.</os-toast>
1136 <os-toast state="in" tone="critical">Could not move the post to trash.</os-toast>
1137 `};let Fo=dt;w("os-toast",Fo);const Zu=v`:host{display:flex;gap:4px;margin-bottom:10px;border-bottom:1px solid var( --os-ui-border,#dcdcde )}:host( [ orientation='vertical' ] ){flex-direction:column;align-items:stretch;gap:0;margin-bottom:0;border-bottom:0}`,Yu=v`:host{display:block}:host( [ hidden ] ){display:none}:host(:focus-visible ){outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:4px;border-radius:4px}`,Ju=v` ${C}:host{display:inline-block}:host( [ data-orientation='vertical' ] ){display:block;--_tab-edge:var( --os-ui-tab-edge,linear-gradient( var( --os-ui-accent,#f252fc ),var( --os-ui-accent,#f252fc ) ) );--_tab-wash:var( --os-ui-tab-wash,linear-gradient( 90deg,rgba( 242,82,252,0.16 ) 0%,rgba( 255,251,255,0.04 ) 42%,transparent 100% ) );--_tab-bloom:var( --os-ui-tab-bloom,linear-gradient( 90deg,rgba( 242,82,252,0.26 ),transparent ) );--_tab-edge-w:var( --os-ui-tab-edge-width,2px );--_tab-bloom-o:var( --os-ui-tab-bloom-opacity,1 );--_tab-fill:var( --os-ui-tab-fill,transparent );--_tab-radius:var( --os-ui-tab-radius,0px );--_tab-inset:var( --os-ui-tab-inset,0px )}:host( [ data-orientation='vertical' ] ) button{display:flex;align-items:center;gap:11px;isolation:isolate;overflow:hidden;width:calc( 100% - 2 * var( --_tab-inset ) );min-height:40px;padding:0 14px 0 calc( 20px - var( --_tab-inset ) );margin-bottom:0;margin-inline:var( --_tab-inset );border-radius:var( --_tab-radius );text-align:start;font-size:14px;font-weight:400;line-height:1.5;white-space:nowrap}:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){flex:0 0 17px;width:17px;height:17px;opacity:0.8;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover slot::slotted( svg ),:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) slot::slotted( svg ){opacity:1}:host( [ data-orientation='vertical' ] ) button::after{inset-inline:0 auto;inset-block:0;z-index:-1;width:var( --_tab-edge-w );height:auto;border-radius:0;background-image:var( --_tab-edge );transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button::before{content:'';position:absolute;inset-inline:0 auto;inset-block:0;z-index:-1;width:44px;background-image:var( --_tab-bloom );filter:blur( 8px );opacity:0;pointer-events:none;transition:opacity var( --_holo-t ) var( --_holo-ease )}:host( [ data-orientation='vertical' ] ) button:hover::after{inset-inline:0 auto;opacity:0}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button{background-color:var( --_tab-fill );background-image:var( --_tab-wash );font-weight:400}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::after,:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button:hover::after{inset-inline:0 auto;opacity:1}:host( [ data-orientation='vertical' ][ aria-selected='true' ] ) button::before{opacity:var( --_tab-bloom-o )}@media ( prefers-reduced-motion:reduce ){:host( [ data-orientation='vertical' ] ) button::before,:host( [ data-orientation='vertical' ] ) slot::slotted( svg ){transition-duration:1ms}}button{appearance:none;position:relative;padding:6px 10px 8px;border:none;background:transparent;color:var( --os-ui-fg-muted,#50575e );font:inherit;font-size:12px;font-weight:500;cursor:pointer;margin-bottom:-1px;transition:color var( --_holo-t ) ease}button::after{content:'';position:absolute;inset-inline:50%;bottom:0;height:2px;border-radius:2px 2px 0 0;background-image:linear-gradient( var( --os-ui-accent,#2271b1 ),var( --os-ui-accent,#2271b1 ) );background-size:100% 100%;opacity:0;transition:inset-inline var( --_holo-t ) ease,opacity var( --_holo-t ) ease}button:hover{color:var( --os-ui-fg,#1d2327 )}button:hover::after{inset-inline:30%;opacity:0.45}button:focus-visible{outline:none;box-shadow:var( --_holo-focus );border-radius:4px}:host( [ aria-selected='true' ] ) button{color:var( --os-ui-fg,#1d2327 );font-weight:600}:host( [ aria-selected='true' ] ) button::after,:host( [ aria-selected='true' ] ) button:hover::after{inset-inline:0;opacity:1}@media ( prefers-reduced-motion:reduce ){button::after{transition-duration:1ms}}`,ut=class ut extends _{render(){return this.setAttribute("role","tab"),c`
1138 <button type="button" @click=${()=>this._onPick()}>
1139 <slot></slot>
1140 </button>
1141 `}_onPick(){this.emit("os-tab-pick",{value:this.value})}};ut.props=["value"],ut.styles=[Ju],ut.help=void 0;let Vo=ut;w("os-tab",Vo);const ht=class ht extends _{constructor(){super(...arguments),this._tabObserver=null,this._onKeyDown=e=>{const t=this.orientation==="vertical",o=t?"ArrowDown":"ArrowRight",i=t?"ArrowUp":"ArrowLeft";if(e.key!==o&&e.key!==i&&e.key!=="Home"&&e.key!=="End")return;const n=Array.from(this.querySelectorAll("os-tab")).filter(h=>!h.hasAttribute("data-search-hidden"));if(n.length===0)return;const r=this.value,a=n.findIndex(h=>h.getAttribute("value")===r);let l=0;if(e.key==="End")l=n.length-1;else if(e.key!=="Home"){const h=e.key===o?1:-1;l=(a+h+n.length)%n.length}const u=n[l]?.getAttribute("value");!u||u===r||(e.preventDefault(),this.value=u,this.emit("os-tab-change",{value:u}),queueMicrotask(()=>{n[l]?.focus()}))}}connectedCallback(){super.connectedCallback(),this.addEventListener("os-tab-pick",e=>{const t=e.detail;e.stopPropagation(),this.value=t.value,this.emit("os-tab-change",{value:t.value})}),this.addEventListener("keydown",this._onKeyDown),this._tabObserver=new MutationObserver(()=>this.requestUpdate()),this._tabObserver.observe(this,{childList:!0})}disconnectedCallback(){this._tabObserver?.disconnect(),this._tabObserver=null,this.removeEventListener("keydown",this._onKeyDown)}set items(e){Qu(this,"os-tab",e);const t=this.value;!(t!==null&&e.some(i=>i.value===t))&&e.length>0?this.value=e[0].value:this.requestUpdate()}render(){this.setAttribute("role","tablist");const e=this.label||"";e&&this.setAttribute("aria-label",e);const t=this.orientation==="vertical";this.setAttribute("aria-orientation",t?"vertical":"horizontal");for(const i of Array.from(this.querySelectorAll("os-tab")))t?i.setAttribute("data-orientation","vertical"):i.removeAttribute("data-orientation");const o=this.value;return queueMicrotask(()=>{const i=this.querySelectorAll("os-tab");for(const n of Array.from(i)){const r=n.getAttribute("value");n.setAttribute("aria-selected",r===o?"true":"false"),n.setAttribute("tabindex",r===o?"0":"-1")}na(this,o)}),c`<slot></slot>`}};ht.props=["value","label","orientation"],ht.styles=[Zu],ht.help={title:"Tabs",summary:'Underline-accent tab strip. Pair with sibling <os-tabpanel for="…"> elements and the strip auto-toggles their hidden attribute on selection. Set orientation="vertical" for a sidebar instead of a strip.',status:"stable",props:[{name:"value",type:"string",description:"Currently active tab value. Mirrored to child <os-tab> aria-selected."},{name:"label",type:"string",description:"aria-label for the tablist — describe the tab group for assistive tech."},{name:"orientation",type:"'horizontal' | 'vertical'",description:"Lay the tabs across the top (default) or down the side. Vertical also sets aria-orientation and moves each tab's accent from an underline to a leading edge."}],slots:[{name:"(default)",description:'<os-tab value="…"> children forming the strip.'}],events:[{name:"os-tab-change",description:"Fires when the active tab changes.",detail:"{ value: string }"}],example:c`
1142 <os-tabs value="one" label="Demo tabs">
1143 <os-tab value="one">One</os-tab>
1144 <os-tab value="two">Two</os-tab>
1145 <os-tab value="three">Three</os-tab>
1146 </os-tabs>
1147 <os-tabpanel for="one">First panel.</os-tabpanel>
1148 <os-tabpanel for="two">Second panel.</os-tabpanel>
1149 <os-tabpanel for="three">Third panel.</os-tabpanel>
1150 `};let jo=ht;w("os-tabs",jo);const pt=class pt extends _{connectedCallback(){super.connectedCallback(),this.setAttribute("role","tabpanel"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const e=eh(this);e&&na(e,e.getAttribute("value"))}render(){return c`<slot></slot>`}};pt.props=["for"],pt.styles=[Yu],pt.help={title:"Tab panel",summary:'Auto-managed panel paired with a sibling <os-tabs>. Declares which tab it belongs to via `for="<tab-value>"`; the parent strip toggles `hidden` whenever the active tab changes. role="tabpanel" and tabindex="0" are set automatically.',status:"stable",props:[{name:"for",type:"string",description:"Matches the `value` of the owning <os-tab>. Panel is shown when its parent tabs strip is on that value."}],slots:[{name:"(default)",description:"Panel body content."}],example:c`
1151 <os-tabs value="two" label="Demo tabs">
1152 <os-tab value="one">One</os-tab>
1153 <os-tab value="two">Two</os-tab>
1154 </os-tabs>
1155 <os-tabpanel for="one">
1156 Hidden — the strip is on "two".
1157 </os-tabpanel>
1158 <os-tabpanel for="two">
1159 Visible, because this panel's <code>for</code> matches the
1160 strip's <code>value</code>.
1161 </os-tabpanel>
1162 `};let Ko=pt;w("os-tabpanel",Ko);function Qu(s,e,t){const o=s.querySelectorAll(`:scope > ${e}`);for(const i of Array.from(o))i.remove();for(const i of t){const n=document.createElement(e);n.setAttribute("value",i.value),n.textContent=i.label,s.appendChild(n)}}function eh(s){const e=s.parentElement;if(!e)return null;const t=e.querySelector(":scope > os-tabs");return t||s.closest("os-tabs")}function na(s,e){const t=new Set,o=s.parentElement;if(o)for(const i of Array.from(o.querySelectorAll(":scope > os-tabpanel")))t.add(i);for(const i of Array.from(s.querySelectorAll(":scope > os-tabpanel")))t.add(i);for(const i of t){const n=i.getAttribute("for"),r=n!==null&&n===e;r?i.removeAttribute("hidden"):i.setAttribute("hidden",""),i.setAttribute("aria-hidden",r?"false":"true")}}const th=v`:host{display:inline-flex}button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:none;border-radius:var( --os-ui-btn-radius,5px );background-color:var( --os-ui-btn-bg,transparent );background-image:var( --os-ui-btn-bg-image,none );background-repeat:var( --os-ui-btn-bg-image-repeat,no-repeat );background-size:var( --os-ui-btn-bg-image-size,auto );background-position:var( --os-ui-btn-bg-image-position,center );color:var( --os-ui-btn-color,currentColor );cursor:pointer;transition:background-color 0.15s ease,color 0.15s ease,transform 80ms ease}button:active:not(:disabled){transform:scale( 0.9 )}@media ( prefers-reduced-motion:reduce ){button:active:not(:disabled){transform:none}}button:disabled{opacity:0.5;cursor:default}button:hover:not(:disabled){color:var( --os-ui-btn-color-hover,currentColor );background-color:var( --os-ui-btn-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) )}button:focus-visible{color:var( --os-ui-btn-color-hover,currentColor );background-color:var( --os-ui-btn-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );outline:2px solid var( --os-ui-btn-outline,currentColor );outline-offset:1px}:host( [ active ] ) button{color:var( --os-ui-btn-color-hover,currentColor );background-color:var( --os-ui-btn-bg-active,var( --os-ui-hover,rgba( 0,0,0,0.08 ) ) )}:host( [ danger ] ) button:hover{color:var( --os-ui-fg-on-accent,#fff );background-color:var( --os-ui-btn-danger-hover,var( --os-ui-danger,#d63638 ) )}svg{display:block;pointer-events:none;flex-shrink:0}svg:empty{display:none}.themed-icon{display:block;width:14px;height:14px;flex-shrink:0;pointer-events:none;background-color:var( --os-ui-btn-icon-color,currentColor )}::slotted( span ){line-height:1}::slotted( svg ){display:block}`,sh={minimize:'<path d="M3 6h6" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>',maximize:'<rect x="3" y="3" width="6" height="6" rx="1" stroke="currentColor" stroke-width="1.25" fill="none"/>',fullscreen:'<path d="M4.5 2H2v2.5M10 4.5V2H7.5M4.5 10H2V7.5M10 7.5V10H7.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',"fullscreen-exit":'<path d="M2 4.5H4.5V2M7.5 2V4.5H10M2 7.5H4.5V10M7.5 10V7.5H10" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',detach:'<path d="M5 2H2.5v7.5H10V7M6.5 2H10v3.5M10 2L5.5 6.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',reload:'<g transform="translate(0.6 0.6) scale(0.021)" fill="currentColor"><path d="m504.554 233.704-76.447 91.467c-6.329 7.572-15.417 11.479-24.571 11.479a31.872 31.872 0 0 1-20.504-7.447l-91.467-76.447c-13.561-11.334-15.366-31.515-4.032-45.075s31.515-15.366 45.075-4.032l37.506 31.347c-10.274-74.891-74.668-132.774-152.337-132.774C132.984 102.223 64 171.207 64 256s68.984 153.777 153.777 153.777c17.673 0 32 14.327 32 32s-14.327 32-32 32c-58.17 0-112.859-22.653-153.991-63.785C22.653 368.859 0 314.17 0 256s22.653-112.859 63.786-153.992c41.132-41.132 95.821-63.785 153.991-63.785s112.859 22.653 153.992 63.785c32.517 32.516 53.471 73.508 60.829 117.991l22.849-27.339c11.334-13.56 31.515-15.364 45.075-4.032 13.56 11.335 15.365 31.516 4.032 45.076z"/></g>',close:'<path d="M3.25 3.25l5.5 5.5M3.25 8.75l5.5-5.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round"/>',menu:'<circle cx="3" cy="6" r="1.2" fill="currentColor"/><circle cx="6" cy="6" r="1.2" fill="currentColor"/><circle cx="9" cy="6" r="1.2" fill="currentColor"/>'};function oh(s){const e=(s??"").trim();return e===""||e.length>4096||!/^(https?:\/\/|data:image\/)/i.test(e)||/['"()\\<>\s]/.test(e)?"":e}const gt=class gt extends _{constructor(){super(...arguments),this._activateWired=!1}static get observedAttributes(){return[...super.observedAttributes,"aria-label","aria-pressed"]}render(){const e=oh(this["icon-src"]||this.getAttribute("icon-src")||""),t=e?"":this.icon||"",o=sh[t]||"",i=this.getAttribute("aria-label")||"";return e?c`
1163 <button type="button" aria-label="${i}" aria-pressed="${this.getAttribute("aria-pressed")||""}" ?disabled="${this.hasAttribute("disabled")}">
1164 <span
1165 class="themed-icon"
1166 aria-hidden="true"
1167 style="-webkit-mask: url('${e}') center / contain no-repeat; mask: url('${e}') center / contain no-repeat;"
1168 ></span>
1169 <slot></slot>
1170 </button>
1171 `:c`
1172 <button type="button" aria-label="${i}" aria-pressed="${this.getAttribute("aria-pressed")||""}" ?disabled="${this.hasAttribute("disabled")}">
1173 <svg
1174 width="14"
1175 height="14"
1176 viewBox="0 0 12 12"
1177 aria-hidden="true"
1178 focusable="false"
1179 ></svg>
1180 <slot></slot>
1181 </button>
1182 <span data-svg-buffer style="display:none">${o}</span>
1183 `}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._paintSvg()),queueMicrotask(()=>this._wireActivateEvent())}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),queueMicrotask(()=>this._paintSvg())}_paintSvg(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("svg"),o=e.querySelector("[data-svg-buffer]");if(t&&o){const i=o.textContent||"";t.innerHTML!==i&&(t.innerHTML=i)}}_wireActivateEvent(){if(this._activateWired)return;const e=this.shadowRoot;if(!e)return;const t=e.querySelector("button");t&&(this._activateWired=!0,t.addEventListener("click",()=>{this.hasAttribute("disabled")||this.dispatchEvent(new CustomEvent("os-button-activate",{bubbles:!0,composed:!0,cancelable:!0}))}))}};gt.props=["icon","icon-src","active","danger","disabled"],gt.styles=[th],gt.help=void 0;let Bo=gt;w("os-window-button",Bo);const ih=v` ${C} ${vo}: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}}`,nh=v`: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}`,ft=class ft extends _{render(){return c`
1184 <slot></slot>
1185 `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}};ft.props=["open"],ft.styles=[ih],ft.help=void 0;let Go=ft;w("os-context-menu",Go);const bt=class bt extends _{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"),o=this.hasAttribute("checked");return c`
1186 ${o?c`<span class="check" aria-hidden="true">✓</span>`:c``}
1187 ${e?c`<span class="icon dashicons ${e}" aria-hidden="true"></span>`:c``}
1188 <span class="label"><slot></slot></span>
1189 ${t?c`<span class="chevron" aria-hidden="true">›</span>`:c``}
1190 `}};bt.props=["value","icon","disabled","danger","heading","has-children","checked"],bt.styles=[nh],bt.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:c`
1191 <os-context-menu open style="position: relative; z-index: 0">
1192 <os-context-menu-option heading>Every variant</os-context-menu-option>
1193 <os-context-menu-option value="plain">Plain</os-context-menu-option>
1194 <os-context-menu-option value="icon" icon="dashicons-admin-page">
1195 With an icon
1196 </os-context-menu-option>
1197 <os-context-menu-option value="checked" checked>
1198 Checked
1199 </os-context-menu-option>
1200 <os-context-menu-option value="children" has-children>
1201 With a submenu
1202 </os-context-menu-option>
1203 <os-context-menu-option value="off" disabled>Disabled</os-context-menu-option>
1204 <os-context-menu-option value="del" danger icon="dashicons-trash">
1205 Danger
1206 </os-context-menu-option>
1207 </os-context-menu>
1208 `};let Xo=bt;w("os-context-menu-option",Xo);function rh(s,e){s.style.visibility="hidden";const t=()=>{s.isConnected&&(e(s.getBoundingClientRect()),s.style.visibility="")};typeof requestAnimationFrame=="function"?requestAnimationFrame(t):t()}const ah=v`:host{display:inline-block}:host([hidden]){display:none}.panel{position:fixed;inset:auto;margin:0;padding:0;border:0;background:transparent;overflow:visible;max-inline-size:calc(100vw - 16px)}.panel[hidden]{display:none}os-context-menu{position:relative;inset:auto;max-inline-size:calc(100vw - 16px)}os-button::part(button){min-block-size:30px}.chevron{display:inline-block;inline-size:5px;block-size:5px;border-inline-end:1.5px solid currentColor;border-block-end:1.5px solid currentColor;transform:translateY(-2px) rotate(45deg);margin-inline-start:5px;vertical-align:middle}:host(:dir(rtl)) .chevron{transform:translateY(-2px) rotate(-45deg)}`,mt=class mt extends _{constructor(){super(...arguments),this.opened=!1,this.listeners=null,this.onKey=e=>{if(e.key==="Escape"||e.key==="Tab"){e.key==="Escape"&&(e.preventDefault(),e.stopPropagation()),this.close();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(e.key))return;e.preventDefault(),e.stopPropagation();const t=this.options();let i=t.indexOf(this.ownerDocument.activeElement)+(e.key==="ArrowUp"?-1:1);e.key==="Home"&&(i=0),e.key==="End"&&(i=t.length-1),t[(i+t.length)%t.length]?.focus()}}get panel(){return this.shadowRoot?.querySelector(".panel")??null}get trigger(){return this.shadowRoot?.querySelector("os-button")?.shadowRoot?.querySelector("button")??null}options(){return Array.from(this.querySelectorAll("os-context-menu-option:not([heading]):not([disabled])"))}render(){return c`<os-button variant="ghost" @click=${()=>this.opened?this.close():this.show()} @keydown=${e=>{(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),this.show(e.key==="ArrowUp"))}}>${this.getAttribute("text")||"Actions"} <span class="chevron" aria-hidden="true"></span></os-button>
1209 <div class="panel" popover="manual" hidden><os-context-menu open aria-label=${this.getAttribute("label")||"Actions"}><slot></slot></os-context-menu></div>`}requestUpdate(){this.opened&&this.close(!1),super.requestUpdate(),queueMicrotask(()=>queueMicrotask(()=>this.syncTrigger()))}syncTrigger(){this.trigger?.setAttribute("aria-label",this.getAttribute("label")||"Actions"),this.trigger?.setAttribute("aria-haspopup","menu"),this.trigger?.setAttribute("aria-expanded",String(this.opened))}show(e=!1){if(this.opened||!this.panel)return;this.opened=!0,this.panel.hidden=!1,this.panel.showPopover?.(),this.syncTrigger();const t=this.panel;rh(t,i=>{if(!this.opened)return;const n=this.getBoundingClientRect(),r=getComputedStyle(this).direction==="rtl";t.style.left=`${Math.max(8,Math.min(r?n.left:n.right-i.width,window.innerWidth-i.width-8))}px`,t.style.top=`${Math.max(8,Math.min(n.bottom+5+i.height<=window.innerHeight-8?n.bottom+5:n.top-i.height-5,window.innerHeight-i.height-8))}px`;const a=this.options();a[e?a.length-1:0]?.focus({preventScroll:!0})}),this.listeners=new AbortController;const{signal:o}=this.listeners;document.addEventListener("pointerdown",i=>{i.composedPath().includes(this)||this.close(!1)},{capture:!0,signal:o}),document.addEventListener("focusin",i=>{i.composedPath().includes(this)||this.close(!1)},{signal:o}),document.addEventListener("scroll",i=>{i.composedPath().includes(t)||this.close(!1)},{capture:!0,signal:o}),window.addEventListener("resize",()=>this.close(!1),{signal:o}),this.addEventListener("keydown",this.onKey,{signal:o}),this.addEventListener("os-context-menu-pick",()=>this.close(),{capture:!0,signal:o})}close(e=!0){this.opened&&(this.opened=!1,this.listeners?.abort(),this.listeners=null,this.panel?.isConnected&&this.panel.hidePopover?.(),this.panel&&(this.panel.hidden=!0),this.syncTrigger(),e&&this.isConnected&&this.trigger?.focus({preventScroll:!0}))}disconnectedCallback(){this.close(!1)}};mt.props=["label","text"],mt.styles=[ah],mt.help=void 0;let Zo=mt;w("os-action-menu",Zo);const lh=v` ${C} ${vo}:host{display:block;animation:os-holo-enter var( --_holo-t ) var( --_holo-spring );transform-origin:top left;min-width:220px;padding:4px;background:var( --os-window-bg,#fff );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-fg,#1d2327 );border:1px solid var( --os-window-border,#c3c4c7 );border-radius:8px;box-shadow:0 8px 24px rgba( 0,0,0,0.18 ),0 2px 6px rgba( 0,0,0,0.08 )}:host(:dir( rtl ) ){transform-origin:top right}@media ( prefers-reduced-motion:reduce ){:host{animation:none}}:host( [ hidden ] ){display:none}`,ch=v`:host{display:block}button{display:flex;align-items:center;gap:10px;width:100%;min-height:32px;padding:6px 10px;border:none;border-radius:6px;background:transparent;color:inherit;font:inherit;font-size:13px;line-height:1.3;text-align:start;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}button:hover,button:focus-visible{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) );color:var( --os-ui-fg,#000 );outline:none}button:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.os-menu-item__icon{flex-shrink:0;width:18px;height:18px;font-size:18px;line-height:1;color:var( --wp-admin-theme-color,#2271b1 )}.os-menu-item__icon[ hidden ]{display:none}.os-menu-item__label{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.os-menu-item__check{flex-shrink:0;width:16px;height:16px;border-radius:3px;border:1.5px solid var( --os-ui-border,rgba( 0,0,0,0.25 ) );position:relative;background:transparent;transition:background-color 0.12s ease,border-color 0.12s ease}.os-menu-item__check[ hidden ]{display:none}:host( [ checked ] ) .os-menu-item__check{background-color:transparent;background-image:var( --os-ui-holo-fill,linear-gradient( 124deg,#afa2e8 0%,#f5a8ea 46%,#8ee9f7 100% ) );background-size:200% 200%;background-position:25% 30%;border-color:transparent;box-shadow:var( --os-ui-holo-glow,0 0 0 1px rgba( 242,82,252,0.28 ),0 2px 10px rgba( 242,82,252,0.22 ) )}:host( [ checked ] ) .os-menu-item__check::after{content:'';position:absolute;top:1px;left:4px;width:4px;height:8px;border:solid var( --os-ui-holo-ink,#0c0b0f );border-width:0 2px 2px 0;transform:rotate( 45deg )}`,Ws=class Ws extends _{connectedCallback(){super.connectedCallback(),this.setAttribute("role","menu")}render(){return c`<slot></slot>`}};Ws.styles=[lh],Ws.help=void 0;let Yo=Ws;w("os-menu",Yo);const vt=class vt extends _{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","menuitem")}render(){const e=this.icon||"",t=this.getAttribute("role")==="menuitemcheckbox",o=this.checked!==null;return t&&this.setAttribute("aria-checked",o?"true":"false"),c`
1210 <button type="button" @click=${i=>this._onPick(i)}>
1211 <span
1212 class="os-menu-item__check"
1213 ?hidden=${!t}
1214 ></span>
1215 <span
1216 class="os-menu-item__icon dashicons ${e}"
1217 aria-hidden="true"
1218 ?hidden=${t||!e}
1219 ></span>
1220 <span class="os-menu-item__label">
1221 <slot></slot>
1222 </span>
1223 </button>
1224 `}_onPick(e){e.preventDefault(),this.emit("os-menu-item-click",{value:this.value})}};vt.props=["icon","value","checked"],vt.styles=[ch],vt.help={title:"Menu item",summary:'Single row inside a <os-menu>. Supports three looks: plain label, left-aligned dashicon (icon="dashicons-…"), or a checkbox indicator (role="menuitemcheckbox" + checked).',status:"stable",props:[{name:"icon",type:"string (dashicons class)",description:'Dashicons class rendered on the left. Ignored when role="menuitemcheckbox".'},{name:"value",type:"string",description:"Identifier emitted in os-menu-item-click.detail.value."},{name:"checked",type:"boolean attribute",description:'Visible check indicator. Only honoured when role="menuitemcheckbox".'}],slots:[{name:"(default)",description:"Menu item label."}],events:[{name:"os-menu-item-click",description:"Fires when the item is clicked; bubbles so the <os-menu> parent can delegate.",detail:"{ value: string | null }"}],example:c`
1225 <os-menu>
1226 <os-menu-item value="plain">Plain item</os-menu-item>
1227 <os-menu-item value="icon" icon="dashicons-external">
1228 With an icon
1229 </os-menu-item>
1230 <os-menu-item value="startup" role="menuitemcheckbox" checked>
1231 Checked (menuitemcheckbox)
1232 </os-menu-item>
1233 </os-menu>
1234 `};let Jo=vt;w("os-menu-item",Jo);const dh=v` ${C}: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 )}`,ra='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function uh(s){let e=s?.activeElement??null;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e&&e!==s?.body?e:null}function aa(s){const e=s.composedPath(),t=e.length>0?e[0]:s.target;return t instanceof HTMLElement?t:null}function la(s){return s!==null&&s.matches(ra)}const _t=class _t extends _{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(la(aa(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,o){super.attributeChangedCallback(e,t,o),e==="open"&&(o!==null?(this._prevFocus=uh(this.ownerDocument),this._focusTries=0,queueMicrotask(this._focusInitial)):this._restoreFocus())}_focusables(){const e=this.shadowRoot;return e?Array.from(e.querySelectorAll(ra)):[]}_trapTab(e){const t=this._focusables();if(t.length===0)return;const o=t[0],i=t[t.length-1],n=aa(e),r=!la(n);e.shiftKey&&(r||n===o)?(e.preventDefault(),i.focus()):!e.shiftKey&&(r||n===i)&&(e.preventDefault(),o.focus())}_initialFocusTarget(){const e=this.shadowRoot;if(!e)return null;const t=e.querySelector(".btn--secondary"),o=e.querySelector(".dialog");return this.hasAttribute("danger")?t??e.querySelector(".close")??o:e.querySelector(".btn--primary, .btn--danger")??t??o}_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??"",o=this["confirm-label"]||"Confirm",i=this["cancel-label"]||"Cancel",n=this.hasAttribute("danger"),r=this.hasAttribute("hide-cancel"),a=this.hasAttribute("dismissable"),l=this["remember-label"]??"";return c`
1235 <div class="dialog" tabindex="-1">
1236 ${a?c`<button
1237 type="button"
1238 class="close"
1239 aria-label="Close"
1240 @click=${()=>this._cancel()}
1241 >&times;</button>`:c``}
1242 ${e?c`<h2 class="title">${e}</h2>`:c``}
1243 ${t?c`<p class="message">${t}</p>`:c``}
1244 ${l?c`<label class="remember">
1245 <input type="checkbox" class="remember__box" />
1246 <span class="remember__label">${l}</span>
1247 </label>`:c``}
1248 <div class="actions">
1249 ${r?c``:c`<button
1250 type="button"
1251 class="btn btn--secondary"
1252 @click=${()=>this._cancel()}
1253 >
1254 ${i}
1255 </button>`}
1256 <button
1257 type="button"
1258 class="btn ${n?"btn--danger":"btn--primary"}"
1259 @click=${()=>this._confirm()}
1260 >
1261 ${o}
1262 </button>
1263 </div>
1264 </div>
1265 `}};_t.props=["open","title","message","confirm-label","cancel-label","danger","hide-cancel","dismissable","remember-label"],_t.styles=[dh],_t.help=void 0;let Qo=_t;w("os-confirm-dialog",Qo);const hh=v`:host{display:block;position:relative;font-size:13px}.input{width:100%;padding:8px 10px;background:var( --os-ui-input-bg,var( --os-ui-hover,rgba( 255,255,255,0.06 ) ) );color:inherit;border:1px solid var( --os-ui-border,rgba( 255,255,255,0.12 ) );border-radius:6px;font:inherit;box-sizing:border-box}.input:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --os-ui-focus-ring-field,0 0 0 1px #2271b1,0 0 0 4px rgba( 34,113,177,0.18 ) )}.dropdown{background:var( --os-bg,#1d2327 );color:var( --os-fg,#fff );border:1px solid var( --os-ui-border,rgba( 255,255,255,0.18 ) );border-radius:6px;overflow:auto;z-index:11000;box-shadow:0 12px 32px rgba( 0,0,0,0.5 )}.empty.error{color:var( --os-ui-danger-hover,#ff8080 )}.item{display:flex;align-items:center;gap:10px;padding:8px 10px;cursor:pointer;border:0;background:transparent;color:inherit;width:100%;text-align:start;font:inherit}.item:hover,.item:focus{background:var( --os-ui-hover,rgba( 255,255,255,0.06 ) );outline:none}.avatar{width:24px;height:24px;border-radius:50%;flex:0 0 auto;background:var( --os-ui-hover,rgba( 255,255,255,0.1 ) )}.name{font-weight:500}.slug{opacity:0.6;font-size:12px}.empty{padding:12px;color:var( --os-ui-fg-muted,rgba( 255,255,255,0.5 ) );font-size:12px}`,wt=class wt extends _{constructor(){super(...arguments),this._timer=null,this._abort=null,this._results=[],this._query="",this._open=!1,this._phase="idle",this._error="",this._dropdownStyle="",this._onScrollOrResize=()=>{},this._onInput=e=>{const t=e.target.value;this._query=t,this._scheduleSearch(t)},this._onFocus=()=>{if(this._results.length===0&&this._phase==="idle"){this._scheduleSearch(this._query);return}this._open=!0,this._positionDropdown(),this.requestUpdate()},this._onBlur=()=>{setTimeout(()=>{this._open=!1,this.requestUpdate()},150)},this._pick=e=>{this.emit("os-user-pick",{user:e}),this._results=[],this._open=!1,this._phase="idle",this._query="";const t=this.shadowRoot?.querySelector(".input");t&&(t.value=""),this.requestUpdate()}}connectedCallback(){super.connectedCallback(),this._onScrollOrResize=()=>{this._open&&(this._positionDropdown(),this.requestUpdate())},window.addEventListener("resize",this._onScrollOrResize),window.addEventListener("scroll",this._onScrollOrResize,!0)}disconnectedCallback(){this._timer&&clearTimeout(this._timer),this._abort&&this._abort.abort(),window.removeEventListener("resize",this._onScrollOrResize),window.removeEventListener("scroll",this._onScrollOrResize,!0)}_endpoint(){const e=this.getAttribute("endpoint");return e||window.openStationConfig?.filesUsersSearchUrl||""}_scheduleSearch(e){this._timer&&clearTimeout(this._timer),this._phase="loading",this._open=!0,this._positionDropdown(),this.requestUpdate(),this._timer=setTimeout(()=>this._runSearch(e),200)}async _runSearch(e){const t=this._endpoint();if(!t){this._phase="error",this._error="Search endpoint is not configured.",this._results=[],this._open=!0,this.requestUpdate();return}this._abort&&this._abort.abort();const o=new AbortController;this._abort=o;const i=this.getAttribute("exclude")||"",n=t+"?q="+encodeURIComponent(e)+"&exclude="+encodeURIComponent(i);try{const r={signal:o.signal,credentials:"same-origin"},a=await wn(n,r,{source:"desktop-mode/files-user-search",silent:!0});if(!a.ok)throw await xe(a);const l=await a.json();this._results=l&&Array.isArray(l.users)?l.users:[],this._phase="ready",this._error="",this._open=!0}catch(r){if(r.name==="AbortError")return;this._results=[],this._phase="error",this._error=r.message||"Search failed.",this._open=!0}this._positionDropdown(),this.requestUpdate()}_positionDropdown(){const e=this.shadowRoot?.querySelector(".input");if(!e)return;const t=e.getBoundingClientRect(),o=t.bottom+4,i=t.left,n=t.width,a=window.innerHeight-t.bottom,l=t.top,u=Math.max(120,Math.min(280,Math.max(a,l)-16));a<200&&l>a?this._dropdownStyle=["position:fixed",`left:${i}px`,`top:${t.top-4-u}px`,`width:${n}px`,`max-height:${u}px`].join(";"):this._dropdownStyle=["position:fixed",`left:${i}px`,`top:${o}px`,`width:${n}px`,`max-height:${u}px`].join(";")}_dropdownContent(){if(this._phase==="loading")return c`<div class="empty">Searching…</div>`;if(this._phase==="error")return c`<div class="empty error">${this._error}</div>`;if(this._results.length===0){const e=this._query?"No matches.":"No users available.";return c`<div class="empty">${e}</div>`}return this._results.map(e=>c`
1266 <button
1267 type="button"
1268 class="item"
1269 role="option"
1270 @mousedown=${t=>t.preventDefault()}
1271 @click=${()=>this._pick(e)}
1272 >
1273 <img class="avatar" src=${e.avatarUrl} alt="" />
1274 <div>
1275 <div class="name">${e.name}</div>
1276 <div class="slug">${e.slug}</div>
1277 </div>
1278 </button>
1279 `)}render(){const e=this.getAttribute("placeholder")||"Search users…";return c`
1280 <input
1281 class="input"
1282 type="search"
1283 placeholder=${e}
1284 autocomplete="off"
1285 @input=${this._onInput}
1286 @focus=${this._onFocus}
1287 @blur=${this._onBlur}
1288 .value=${this._query}
1289 />
1290 ${this._open?c`
1291 <div class="dropdown" role="listbox" style=${this._dropdownStyle}>
1292 ${this._dropdownContent()}
1293 </div>
1294 `:c``}
1295 `}};wt.props=["placeholder","exclude","endpoint"],wt.styles=[hh],wt.help=void 0;let ei=wt;w("os-user-search",ei);const ph=v`:host{display:flex;flex-wrap:wrap;gap:6px;font-size:13px}.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var( --os-ui-hover,rgba( 255,255,255,0.06 ) );color:inherit;border:1px solid var( --os-ui-border,rgba( 255,255,255,0.12 ) );cursor:pointer;font:inherit}.chip:hover{background:var( --os-ui-hover,rgba( 255,255,255,0.12 ) )}.chip[ aria-pressed='true' ]{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.empty{color:var( --os-ui-fg-muted,rgba( 255,255,255,0.5 ) );font-size:12px}`,yt=class yt extends _{constructor(){super(...arguments),this._onToggle=e=>{const t=!this._selectedSet().has(e);this.emit("os-role-toggle",{slug:e,selected:t})}}_selectedSet(){const e=this.getAttribute("selected")||"";return new Set(e.split(",").map(t=>t.trim()).filter(t=>t!==""))}_roles(){const e=this.getAttribute("roles");if(e)try{const t=JSON.parse(e);if(Array.isArray(t))return t}catch{}return window.openStationConfig?.shareEligibleRoles||[]}render(){const e=this._roles();if(e.length===0)return c`<span class="empty">No eligible roles.</span>`;const t=this._selectedSet();return c`
1296 ${e.map(o=>{const i=t.has(o.slug);return c`
1297 <button
1298 type="button"
1299 class="chip"
1300 aria-pressed=${i?"true":"false"}
1301 @click=${()=>this._onToggle(o.slug)}
1302 >${o.name}</button>
1303 `})}
1304 `}};yt.props=["selected","roles"],yt.styles=[ph],yt.help=void 0;let ti=yt;w("os-role-picker",ti);const gh=v`:host{display:block;position:absolute;z-index:10;background:var( --os-ui-flyout-bg,var( --os-ui-surface-elevated,#ffffff ) );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );color:var( --os-ui-flyout-fg,var( --os-fg,#1d2327 ) );border-radius:14px;box-shadow:var( --os-ui-flyout-shadow,0 16px 48px rgba( 0,25,53,0.4 ) );transform:translateX( 110% );opacity:0;pointer-events:none;transition:transform 220ms cubic-bezier( 0.22,1,0.36,1 ),opacity 180ms ease}:host( [ open ] ){transform:translateX( 0 );opacity:1;pointer-events:auto}:host( [ placement='end' ] ),:host(:not( [ placement ] ) ){inset-block:64px 14px;inset-inline-end:14px;width:min( 320px,calc( 100% - 28px ) )}:host( [ placement='start' ] ){inset-block:64px 14px;inset-inline-start:14px;width:min( 320px,calc( 100% - 28px ) );transform:translateX( -110% )}:host( [ placement='start' ][ open ] ){transform:translateX( 0 )}:host( [ placement='top' ] ){inset-block-start:14px;inset-inline:14px;max-block-size:calc( 100% - 28px );transform:translateY( -110% )}:host( [ placement='top' ][ open ] ){transform:translateY( 0 )}:host-context( [ dir='rtl' ] ):host( [ placement='end' ] ),:host-context( [ dir='rtl' ] ):host(:not( [ placement ] ) ){transform:translateX( -110% )}:host-context( [ dir='rtl' ] ):host( [ placement='end' ][ open ] ),:host-context( [ dir='rtl' ] ):host(:not( [ placement ] ) [ open ] ){transform:translateX( 0 )}:host-context( [ dir='rtl' ] ):host( [ placement='start' ] ){transform:translateX( 110% )}:host-context( [ dir='rtl' ] ):host( [ placement='start' ][ open ] ){transform:translateX( 0 )}:host::before{content:'';position:fixed;inset:0;background:var( --os-ui-flyout-backdrop,transparent );z-index:-1;pointer-events:none;transition:opacity 180ms ease;opacity:0}:host( [ open ] )::before{opacity:1}@media ( prefers-reduced-motion:reduce ){:host{transition:none}:host::before{transition:none}}`,ca=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(","),fh="[data-flyout-close]",xt=class xt extends _{constructor(){super(...arguments),this._trigger=null,this._onDocKey=null,this._onScopePointerDown=null,this._onHostClick=null,this._onHostKeyDown=null,this._pendingReason=null}connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","dialog"),this.hasAttribute("open")||this.setAttribute("inert","")}disconnectedCallback(){this._detachOpenListeners()}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),e==="open"&&(o!==null&&t===null?this._handleOpen():o===null&&t!==null&&this._handleClose())}_handleOpen(){this.removeAttribute("inert");const e=this.ownerDocument,t=e?.activeElement??null;this._trigger=t instanceof HTMLElement&&t!==this&&t!==e?.body&&t!==e?.documentElement?t:null,queueMicrotask(()=>{if(!this.hasAttribute("open"))return;(this._firstFocusable()??this).focus?.({preventScroll:!0})}),this._attachOpenListeners()}_handleClose(){const e=this._pendingReason??"api";this._pendingReason=null,this.setAttribute("inert",""),this._detachOpenListeners(),this.emit("os-flyout-dismiss",{reason:e});const t=this._trigger;this._trigger=null,t&&t.isConnected&&t.focus?.({preventScroll:!0})}_dismiss(e){this.hasAttribute("open")&&(this._pendingReason=e,this.removeAttribute("open"))}_attachOpenListeners(){const e=this._resolveScopeRoot();this._onScopePointerDown=t=>{if(!this.hasAttribute("open"))return;const o=t.composedPath();o.includes(this)||this._trigger&&o.includes(this._trigger)||this._dismiss("pointer")},e.addEventListener("pointerdown",this._onScopePointerDown),this._onDocKey=t=>{t.key==="Escape"&&this.hasAttribute("open")&&(t.preventDefault(),this._dismiss("escape"))},document.addEventListener("keydown",this._onDocKey),this._onHostKeyDown=t=>{if(t.key!=="Tab")return;const o=this._allFocusable();if(o.length===0){t.preventDefault();return}const i=o[0],n=o[o.length-1],r=this.ownerDocument?.activeElement??null;t.shiftKey&&(r===i||r===this)?(t.preventDefault(),n.focus({preventScroll:!0})):!t.shiftKey&&r===n&&(t.preventDefault(),i.focus({preventScroll:!0}))},this.addEventListener("keydown",this._onHostKeyDown),this._onHostClick=t=>{const i=t.target?.closest?.(fh);i&&this.contains(i)&&this._dismiss("close-button")},this.addEventListener("click",this._onHostClick)}_detachOpenListeners(){this._onDocKey&&(document.removeEventListener("keydown",this._onDocKey),this._onDocKey=null),this._onScopePointerDown&&(this._resolveScopeRoot().removeEventListener("pointerdown",this._onScopePointerDown),this._onScopePointerDown=null),this._onHostKeyDown&&(this.removeEventListener("keydown",this._onHostKeyDown),this._onHostKeyDown=null),this._onHostClick&&(this.removeEventListener("click",this._onHostClick),this._onHostClick=null)}_resolveScopeRoot(){const e=this.getAttribute("scope")??"window";return e==="document"?document.body:e==="parent"?this.parentElement??document.body:this.closest(".os-window__body")??this.parentElement??document.body}_firstFocusable(){return this.querySelector(ca)??null}_allFocusable(){return Array.from(this.querySelectorAll(ca)).filter(e=>!e.disabled)}render(){return c`<slot></slot>`}};xt.props=["open","placement","scope","aria-label","aria-labelledby"],xt.styles=[gh],xt.help=void 0;let si=xt;w("os-flyout",si);const bh=v`:host{display:contents;--_accent:var( --os-ui-accent,#f252fc );--_glow:var( --os-ui-accent-dim,#d846e0 );--_bg:var( --os-ui-surface-elevated,#ffffff );--_fg:var( --os-ui-fg,#1d2327 );--_muted:var( --os-ui-fg-muted,#646970 );--_border:var( --os-ui-border-strong,rgba( 0,0,0,0.12 ) );--_shadow:var( --os-ui-flyout-shadow,0 16px 48px rgba( 0,25,53,0.4 ) );--_ease:cubic-bezier( 0.22,1,0.36,1 );--_step:360ms}.layer{position:fixed;inset:0;margin:0;padding:0;border:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;background:transparent;color:inherit;pointer-events:none}.layer[hidden]{display:none}.outline{position:fixed;box-sizing:border-box;border:2px solid var( --_accent );border-radius:12px;box-shadow:0 0 0 4px color-mix( in srgb,var( --_glow ) 28%,transparent );pointer-events:none;animation:os-coachmark-pulse 1.6s ease-in-out infinite}.outline[hidden]{display:none}@keyframes os-coachmark-pulse{0%,100%{box-shadow:0 0 0 4px color-mix( in srgb,var( --_glow ) 28%,transparent )}50%{box-shadow:0 0 0 8px color-mix( in srgb,var( --_glow ) 12%,transparent )}}.card{position:fixed;box-sizing:border-box;width:min( 320px,calc( 100vw - 24px ) );padding:16px 18px 14px;border-radius:14px;background:var( --_bg );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );color:var( --_fg );border:1px solid var( --_border );box-shadow:var( --_shadow );pointer-events:auto;outline:none;font-size:13px;line-height:1.5;animation:os-coachmark-in 240ms var( --_ease ) both}.card:focus-visible{box-shadow:var( --_shadow ),0 0 0 2px var( --_accent )}@keyframes os-coachmark-in{from{opacity:0;transform:translateY( 6px )}to{opacity:1;transform:none}}.layer.stepping .card,.layer.stepping .outline{transition:left var( --_step ) var( --_ease ),top var( --_step ) var( --_ease ),width var( --_step ) var( --_ease ),height var( --_step ) var( --_ease )}.card.swap{animation:os-coachmark-swap 300ms var( --_ease )}@keyframes os-coachmark-swap{from{opacity:0.35;transform:scale( 0.97 )}to{opacity:1;transform:none}}.layer.leaving .card,.layer.leaving .outline{animation:os-coachmark-out 180ms ease forwards;pointer-events:none}@keyframes os-coachmark-out{from{opacity:1;transform:none}to{opacity:0;transform:translateY( 6px )}}@keyframes os-coachmark-fade{from{opacity:0}to{opacity:1}}.tail{position:absolute;width:14px;height:14px;box-sizing:border-box;background:var( --_bg );border:1px solid var( --_border );transform:rotate( 45deg );pointer-events:none}.tail[hidden]{display:none}.tail[data-edge='bottom']{bottom:-8px;left:calc( var( --_tail-at,50% ) - 7px );border-top-color:transparent;border-left-color:transparent}.tail[data-edge='top']{top:-8px;left:calc( var( --_tail-at,50% ) - 7px );border-bottom-color:transparent;border-right-color:transparent}.tail[data-edge='left']{left:-8px;top:calc( var( --_tail-at,50% ) - 7px );border-top-color:transparent;border-right-color:transparent}.tail[data-edge='right']{right:-8px;top:calc( var( --_tail-at,50% ) - 7px );border-bottom-color:transparent;border-left-color:transparent}.meta{font-size:11px;font-weight:600;letter-spacing:0.04em;text-transform:uppercase;color:var( --_accent );margin:0 0 4px}.meta:empty{display:none}h2{margin:0 0 6px;font-size:15px;font-weight:600;line-height:1.3;color:inherit}.body{color:var( --_muted )}.body::slotted( p ){margin:0 0 8px}.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.actions os-button[hidden]{display:none}@media ( prefers-reduced-motion:reduce ){.outline{animation:none}.card,.card.swap{animation:os-coachmark-fade 160ms ease}.layer.stepping .card,.layer.stepping .outline{transition:none}.layer.leaving .card,.layer.leaving .outline{animation:os-coachmark-fade 140ms ease reverse forwards}}`,mh=12,j=12,ue=4,vh=16,da=28,_h=180,wh=360,ua="gone",oi=["bottom","top","end","start"];function ha(s){switch(s){case"top":return"bottom";case"bottom":return"top";case"start":return"end";default:return"start"}}function pa(s){if(!s.isConnected)return!1;const e=s.checkVisibility;return typeof e!="function"||e.call(s)}const kt=class kt extends _{constructor(){super(...arguments),this._anchor=null,this._returnFocus=null,this._shown=!1,this._raf=0,this._lastKey="",this._listeners=null,this._leaving=!1,this._exitTimer=0,this._stepTimer=0,this._speakerKey="",this._onKeyDown=e=>{if(e.key==="Escape"){e.preventDefault(),e.stopPropagation(),this.emit("os-coachmark-dismiss",{step:this.stepNumber});return}if(e.key!=="Tab")return;const t=Array.from(this.card?.querySelectorAll("os-button")??[]).filter(n=>!n.hidden);if(t.length===0){e.preventDefault();return}const o=this._focusables(),i=t.indexOf(this._activeHost());e.shiftKey&&i<=0?(e.preventDefault(),o[o.length-1]?.focus({preventScroll:!0})):!e.shiftKey&&(i===-1||i===t.length-1)&&(e.preventDefault(),o[0]?.focus({preventScroll:!0}))}}get anchor(){return this._anchor}set anchor(e){this._anchor=e??null,this._lastKey="",this._shown&&(this._beginStep(),this._position())}get stepNumber(){return Number(this.getAttribute("step")??0)||0}get layer(){return this.shadowRoot?.querySelector(".layer")??null}get card(){return this.shadowRoot?.querySelector(".card")??null}get outline(){return this.shadowRoot?.querySelector(".outline")??null}disconnectedCallback(){this._teardown(),this._finishExit(),window.clearTimeout(this._stepTimer)}render(){const e=this.hasAttribute("open"),t=this.getAttribute("step"),o=this.getAttribute("total"),i=t&&o?this.getAttribute("counter-label")||`${t} of ${o}`:"",n=this.getAttribute("primary-label")??"Next",r=this.getAttribute("secondary-label")??"Skip";return c`<div class="layer" popover="manual" ?hidden=${!e&&!this._leaving}>
1305 <div class="outline" hidden aria-hidden="true"></div>
1306 <div
1307 class="card"
1308 role="dialog"
1309 aria-labelledby="os-coachmark-heading"
1310 tabindex="-1"
1311 @keydown=${this._onKeyDown}
1312 >
1313 <span class="tail" hidden aria-hidden="true"></span>
1314 <p class="meta">${i}</p>
1315 <h2 id="os-coachmark-heading">${this.getAttribute("heading")??""}</h2>
1316 <div class="body"><slot></slot></div>
1317 <div class="actions">
1318 <os-button
1319 variant="ghost"
1320 class="secondary"
1321 ?hidden=${r===""}
1322 @click=${()=>this.emit("os-coachmark-secondary",{step:this.stepNumber})}
1323 >${r}</os-button
1324 >
1325 <os-button
1326 variant="primary"
1327 class="primary"
1328 @click=${()=>this.emit("os-coachmark-primary",{step:this.stepNumber})}
1329 >${n}</os-button
1330 >
1331 </div>
1332 </div>
1333 </div>`}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>queueMicrotask(()=>this._afterRender()))}_afterRender(){if(!this.isConnected)return;const e=this.hasAttribute("open");e&&!this._shown?this._show():!e&&this._shown?this._hide():e&&(this._lastKey="",this._position())}_show(){const e=this.layer;if(!e)return;this._finishExit(!1),this.card?.classList.remove("swap"),this._shown=!0;const t=this.ownerDocument.activeElement;this._returnFocus=t instanceof HTMLElement&&t!==this.ownerDocument.body?t:null;try{e.showPopover?.()}catch{}this._listeners=new AbortController;const{signal:o}=this._listeners,i=()=>{this._lastKey="",this._position()};window.addEventListener("resize",i,{signal:o}),document.addEventListener("os-work-area-changed",i,{signal:o}),this._position(),this._track(),this._focusPrimary()}_hide(){this._teardown();const e=this._returnFocus;this._returnFocus=null,e&&e.isConnected&&e.focus?.({preventScroll:!0});const t=this.layer;t&&(this._leaving=!0,t.classList.add("leaving"),this.requestUpdate(),this._exitTimer=window.setTimeout(()=>this._finishExit(),_h))}_finishExit(e=!0){if(!this._leaving)return;window.clearTimeout(this._exitTimer),this._exitTimer=0,this._leaving=!1;const t=this.layer;if(t?.classList.remove("leaving"),e&&t)try{t.hidePopover?.()}catch{}this.requestUpdate()}_beginStep(){const e=this.layer,t=this.card;!e||!t||(e.classList.add("stepping"),t.classList.remove("swap"),t.offsetWidth,t.classList.add("swap"),window.clearTimeout(this._stepTimer),this._stepTimer=window.setTimeout(()=>{e.classList.remove("stepping")},wh))}_teardown(){this._shown=!1,this._raf&&(cancelAnimationFrame(this._raf),this._raf=0),this._listeners?.abort(),this._listeners=null}_track(){if(typeof requestAnimationFrame!="function")return;const e=()=>{if(!this._shown){this._raf=0;return}if(this._anchor){let t=ua;if(pa(this._anchor)){const o=this._anchor.getBoundingClientRect();t=`${o.left},${o.top},${o.width},${o.height}`}t!==this._lastKey&&this._position()}this._raf=requestAnimationFrame(e)};this._raf=requestAnimationFrame(e)}_position(){const e=this.card,t=this.outline;if(!e||!t)return;const o=window.innerWidth,i=window.innerHeight,n=e.getBoundingClientRect(),r=this._anchor&&pa(this._anchor)?this._anchor:null,a=Math.max(0,Number(this.getAttribute("speaker-size"))||0),l=mh;if(!r){t.hidden=!0;const I=Math.max(j,(o-n.width)/2),O=Math.max(j,(i-n.height)/2);e.style.left=`${I}px`,e.style.top=`${O}px`,this._lastKey=this._anchor?ua:"",this._placeSpeaker("top",I,O,n,a);return}const u=r.getBoundingClientRect();this._lastKey=`${u.left},${u.top},${u.width},${u.height}`,t.hidden=!1,t.style.left=`${u.left-ue}px`,t.style.top=`${u.top-ue}px`,t.style.width=`${u.width+ue*2}px`,t.style.height=`${u.height+ue*2}px`;const h=getComputedStyle(this.ownerDocument.documentElement).direction==="rtl",p={top:u.top,bottom:i-u.bottom,start:h?o-u.right:u.left,end:h?u.left:o-u.right},g=I=>(I==="top"||I==="bottom"?n.height:n.width)+l+j,b=I=>p[I]>=g(I),m=this.getAttribute("placement")??"auto",x=oi.find(I=>I===m);let y;x?y=b(x)||!b(ha(x))?x:ha(x):(y=oi.reduce((I,O)=>p[O]>p[I]?O:I,oi[0]),b("bottom")?y="bottom":b("top")&&(y="top"));let k,f;const A=u.left+u.width/2-n.width/2,$=u.top+u.height/2-n.height/2,R=I=>I==="start"!==h?"left":"right";switch(y){case"top":k=A,f=u.top-ue-l-n.height;break;case"bottom":k=A,f=u.bottom+ue+l;break;default:f=$,k=R(y)==="left"?u.left-ue-l-n.width:u.right+ue+l}k=Math.min(Math.max(j,k),Math.max(j,o-n.width-j)),f=Math.min(Math.max(j,f),Math.max(j,i-n.height-j)),e.style.left=`${k}px`,e.style.top=`${f}px`,this._placeSpeaker(y,k,f,n,a)}_placeSpeaker(e,t,o,i,n){const r=this.card?.querySelector(".tail");if(!r)return;if(n<=0){r.hidden=!0,this._speakerKey="";return}const a=window.innerWidth,l=window.innerHeight,u=vh+n/2,h=(k,f,A)=>Math.min(Math.max(k,f),Math.max(f,A));let p,g;e==="top"||e==="bottom"?(p=a-(t+i.width)>=t?"right":"left",g={x:p==="right"?t+i.width+u:t-u,y:h(o+i.height/2,j+n/2,l-j-n/2)}):(p=l-(o+i.height)>=o?"bottom":"top",g={x:h(t+i.width/2,j+n/2,a-j-n/2),y:p==="bottom"?o+i.height+u:o-u}),r.hidden=!1,r.dataset.edge=p;const b=p==="top"||p==="bottom",m=b?i.width:i.height,x=h(b?g.x-t:g.y-o,da,m-da);r.style.setProperty("--_tail-at",`${x}px`);const y=`${Math.round(g.x)},${Math.round(g.y)}`;y!==this._speakerKey&&(this._speakerKey=y,this.emit("os-coachmark-speaker",g))}_focusables(){const e=this.card;return e?Array.from(e.querySelectorAll("os-button")).filter(t=>!t.hidden).map(t=>t.shadowRoot?.querySelector("button")??t):[]}_focusPrimary(){const e=this._focusables();(e[e.length-1]??this.card)?.focus?.({preventScroll:!0})}_activeHost(){return this.shadowRoot?.activeElement??null}};kt.props=["open","placement","step","total","counter-label","heading","primary-label","secondary-label","speaker-size"],kt.styles=[bh],kt.help=void 0;let ii=kt;w("os-coachmark",ii);const yh=v`:host{--_bg:var( --os-tooltip-bg,var( --os-ui-scrim,rgba( 0,0,0,0.85 ) ) );--_fg:var( --os-tooltip-fg,var( --os-ui-fg-on-accent,#fff ) );position:fixed;top:0;left:0;z-index:calc( var( --os-z-fullscreen,99999 ) + 1 );display:block;max-width:280px;pointer-events:none;opacity:0;visibility:hidden;transform:translateY( -2px );transition:opacity 0.15s ease,transform 0.15s ease,visibility 0s linear 0.15s}:host( [ open ] ){opacity:1;visibility:visible;transform:none;transition:opacity 0.15s ease,transform 0.15s ease,visibility 0s}.surface{display:flex;flex-direction:column;gap:2px;padding:6px 12px;border-radius:6px;background:var( --_bg );color:var( --_fg );font-size:12px;font-weight:400;line-height:1.4;overflow-wrap:anywhere}.heading{font-weight:600}.heading + .text{opacity:0.8}@media ( prefers-reduced-motion:reduce ){:host,:host( [ open ] ){transform:none;transition:none}}`,$t=class $t extends _{connectedCallback(){super.connectedCallback?.(),this.setAttribute("role","tooltip")}render(){const e=this.heading,t=this.text;return c`
1334 <div part="surface" class="surface">
1335 ${e?c`<strong class="heading">${e}</strong>`:""}
1336 ${t?c`<span class="text">${t}</span>`:""}
1337 </div>
1338 `}};$t.props=["heading","text","open"],$t.styles=[yh],$t.help=void 0;let ni=$t;w("os-tooltip",ni);const xh=v` ${C}:host{display:inline-flex}button{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:transparent;color:var( --os-ui-fg-muted,rgba( 0,0,0,0.45 ) );cursor:pointer;transition:background-color 0.15s ease,color 0.15s ease,transform 0.12s ease}:host( [ variant='detach' ] ) button:hover{color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-accent-soft,rgba( 34,113,177,0.12 ) );transform:translateY( -1px )}:host( [ variant='detach' ] ) button:focus-visible{outline:none;color:var( --os-ui-accent,#2271b1 );background:var( --os-ui-accent-soft,rgba( 34,113,177,0.12 ) );box-shadow:var( --_holo-focus )}:host( [ variant='close' ] ) button:hover{color:var( --os-ui-fg-on-accent,#fff );background:var( --os-ui-danger,#d63638 )}:host( [ variant='close' ] ) button:focus-visible{color:var( --os-ui-fg-on-accent,#fff );background:var( --os-ui-danger,#d63638 );outline:none;box-shadow:0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px var( --os-ui-danger,#d63638 ),0 0 12px 2px rgba( 214,54,56,0.45 )}svg{display:block;pointer-events:none;width:12px;height:12px}@media ( prefers-reduced-motion:reduce ){button{transition-duration:0.01ms}:host( [ variant='detach' ] ) button:hover{transform:none}}`,kh={detach:'<path d="M5 2H2.5v7.5H10V7M6.5 2H10v3.5M10 2L5.5 6.5" stroke="currentColor" stroke-width="1.25" stroke-linecap="round" stroke-linejoin="round" fill="none"/>',close:'<path d="M2.5 2.5l7 7M9.5 2.5l-7 7" stroke="currentColor" stroke-width="1.6" stroke-linecap="round"/>'},At=class At extends _{render(){const e=this.variant||"",t=kh[e]||"";return c`
1339 <button type="button">
1340 <svg
1341 viewBox="0 0 12 12"
1342 aria-hidden="true"
1343 focusable="false"
1344 ></svg>
1345 <slot></slot>
1346 </button>
1347 <span data-svg-buffer style="display:none">${t}</span>
1348 `}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._paintSvg())}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),queueMicrotask(()=>this._paintSvg())}_paintSvg(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("svg"),o=e.querySelector("[data-svg-buffer]");if(t&&o){const i=o.textContent||"";t.innerHTML!==i&&(t.innerHTML=i)}}};At.props=["variant"],At.styles=[xh],At.help=void 0;let ri=At;w("os-tab-chip",ri);const $h=v`:host{display:flex;flex-direction:column;gap:var( --os-ui-stack-gap,12px );align-items:var( --os-ui-stack-align,stretch );padding:var( --os-ui-stack-padding,0 )}:host( [ hidden ] ){display:none}`,Et=class Et extends _{render(){const e=this.gap,t=this.align,o=this.padding,i=e&&/^\d+$/.test(e)?`${e}px`:"";return i&&this.style.setProperty("--os-ui-stack-gap",i),t&&this.style.setProperty("--os-ui-stack-align",t),o!==null&&/^\d+$/.test(o)&&this.style.setProperty("--os-ui-stack-padding",`${o}px`),c`<slot></slot>`}};Et.props=["gap","align","padding"],Et.styles=[$h],Et.help=void 0;let ai=Et;w("os-stack",ai);const Ah=v`:host{display:flex;flex-direction:row;flex-wrap:wrap;gap:var( --os-ui-cluster-gap,8px );justify-content:var( --os-ui-cluster-justify,flex-start );align-items:var( --os-ui-cluster-align,center )}:host( [ hidden ] ){display:none}`,St=class St extends _{render(){const e=this.gap,t=this.justify,o=this.align,i=e&&/^\d+$/.test(e)?`${e}px`:"";return i&&this.style.setProperty("--os-ui-cluster-gap",i),t&&this.style.setProperty("--os-ui-cluster-justify",t),o&&this.style.setProperty("--os-ui-cluster-align",o),c`<slot></slot>`}};St.props=["gap","justify","align"],St.styles=[Ah],St.help=void 0;let li=St;w("os-cluster",li);const Eh=v`:host{display:inline-flex;align-items:center;justify-content:center;width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );color:inherit;line-height:1}:host( [ hidden ] ){display:none}.os-icon__glyph{font-size:var( --os-ui-icon-size,16px );width:var( --os-ui-icon-size,16px );height:var( --os-ui-icon-size,16px );line-height:1;color:inherit;display:inline-flex;align-items:center;justify-content:center}.os-icon__glyph--char{font-family:dashicons;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;speak:none}.os-icon__glyph.dashicons{font-family:dashicons}`;let Rs=null;function Sh(s){let e=s.trim();if(e==="")return null;(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1));const t=e.match(/^\\([0-9a-f]{1,6})\s?$/i);return t?String.fromCodePoint(parseInt(t[1],16)):e||null}function ga(){const s=new Map;if(typeof document>"u")return s;const e=Array.from(document.styleSheets??[]);for(const t of e){let o=null;try{o=t.cssRules}catch{continue}if(o)for(const i of Array.from(o)){const n=i;if(!n||!n.selectorText)continue;const r=n.selectorText.match(/\.dashicons-([a-z0-9-]+)::?before/i);if(!r)continue;const a=n.style?.content;if(!a)continue;const l=Sh(a);l&&s.set(r[1],l)}}return s}function Ch(s){Rs||(Rs=ga());const e=s.startsWith("dashicons-")?s.slice(10):s;return Rs.get(e)??null}function Ih(){Rs=ga()}let fa=!1;function Rh(){if(fa||typeof window>"u")return;fa=!0;const s=()=>{Ih()};document.readyState==="loading"&&document.addEventListener("DOMContentLoaded",s,{once:!0}),window.addEventListener("load",s,{once:!0})}Rh();const Ct=class Ct extends _{render(){const e=this.name||"",t=e.startsWith("dashicons-")?e.slice(10):e,o=this.size;o&&/^\d+$/.test(o)&&this.style.setProperty("--os-ui-icon-size",`${o}px`);const i=Ch(t);return i?c`<span
1349 class="os-icon__glyph os-icon__glyph--char dashicons dashicons-${t}"
1350 aria-hidden="true"
1351 >${i}</span>`:c`<span
1352 class="os-icon__glyph dashicons dashicons-${t}"
1353 aria-hidden="true"
1354 ></span>`}};Ct.props=["name","size"],Ct.styles=[Eh],Ct.help=void 0;let ci=Ct;w("os-icon",ci);const Lh=v`:host{display:flex;flex-direction:column;gap:var( --os-ui-body-gap,12px );padding:var( --os-ui-body-padding,16px );box-sizing:border-box;width:100%;height:100%;min-width:0;min-height:0}:host( [ scroll ] ){overflow:auto}:host( [ hidden ] ){display:none}::slotted( * ){min-width:0}`,It=class It extends _{render(){const e=this.gap,t=this.padding;return e&&/^\d+$/.test(e)&&this.style.setProperty("--os-ui-body-gap",`${e}px`),t&&/^\d+$/.test(t)&&this.style.setProperty("--os-ui-body-padding",`${t}px`),c`<slot></slot>`}};It.props=["gap","padding","scroll"],It.styles=[Lh],It.help=void 0;let di=It;w("os-body",di);const Th=v`:host{display:flex;flex-direction:column;gap:var( --os-ui-panel-gap,12px );padding:var( --os-ui-panel-padding,16px );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );box-sizing:border-box}:host( [ hidden ] ){display:none}`,Rt=class Rt extends _{render(){const e=this.gap,t=this.padding;return e&&/^\d+$/.test(e)&&this.style.setProperty("--os-ui-panel-gap",`${e}px`),t&&/^\d+$/.test(t)&&this.style.setProperty("--os-ui-panel-padding",`${t}px`),c`<slot></slot>`}};Rt.props=["gap","padding"],Rt.styles=[Th],Rt.help=void 0;let ui=Rt;w("os-panel",ui);const Dh=v`:host{display:grid;grid-template-columns:repeat( 12,minmax( 0,1fr ) );gap:var( --os-ui-row-gap,12px );row-gap:var( --os-ui-row-row-gap,var( --os-ui-row-gap,12px ) );column-gap:var( --os-ui-row-column-gap,var( --os-ui-row-gap,12px ) );width:100%;min-width:0}:host( [ hidden ] ){display:none}::slotted( [ col='1' ] ){grid-column:span 1}::slotted( [ col='2' ] ){grid-column:span 2}::slotted( [ col='3' ] ){grid-column:span 3}::slotted( [ col='4' ] ){grid-column:span 4}::slotted( [ col='5' ] ){grid-column:span 5}::slotted( [ col='6' ] ){grid-column:span 6}::slotted( [ col='7' ] ){grid-column:span 7}::slotted( [ col='8' ] ){grid-column:span 8}::slotted( [ col='9' ] ){grid-column:span 9}::slotted( [ col='10' ] ){grid-column:span 10}::slotted( [ col='11' ] ){grid-column:span 11}::slotted( [ col='12' ] ){grid-column:span 12}::slotted(:not( [ col ] ) ){grid-column:1 / -1}::slotted( * ){min-width:0}`,Lt=class Lt extends _{render(){const e=this.gap,t=this["column-gap"],o=this["row-gap"];return e&&/^\d+$/.test(e)&&this.style.setProperty("--os-ui-row-gap",`${e}px`),t&&/^\d+$/.test(t)&&this.style.setProperty("--os-ui-row-column-gap",`${t}px`),o&&/^\d+$/.test(o)&&this.style.setProperty("--os-ui-row-row-gap",`${o}px`),c`<slot></slot>`}};Lt.props=["gap","column-gap","row-gap"],Lt.styles=[Dh],Lt.help=void 0;let hi=Lt;w("os-row",hi);const Ph=v`:host{display:grid;grid-template-rows:auto auto minmax( 0,1fr ) auto;flex:1 1 auto;min-inline-size:0;min-block-size:0;block-size:100%;overflow:hidden}:host( [ hidden ] ){display:none}.content{min-inline-size:0;min-block-size:0;overflow:auto}:host( [ contained ] ) .content{display:flex;flex-direction:column;overflow:hidden}::slotted( * ){min-inline-size:0}:host( [ contained ] ) slot:not( [ name ] )::slotted( * ){flex:1 1 auto;min-block-size:0}`,Tt=class Tt extends _{render(){return c`<div><slot name="header"></slot></div>
1355 <div><slot name="toolbar"></slot></div>
1356 <div class="content" part="content"><slot></slot></div>
1357 <div><slot name="footer"></slot></div>`}};Tt.props=["contained"],Tt.styles=[Ph],Tt.help=void 0;let pi=Tt;w("os-app-frame",pi);const Nh=v`:host{display:flex;flex:1 1 auto;min-inline-size:0;min-block-size:0;overflow:hidden}:host( [ hidden ] ){display:none}.layout{display:grid;flex:1;min-inline-size:0;min-block-size:0;grid-template-columns:minmax( 0,var( --_split-start,35% ) ) auto minmax( 0,1fr );grid-template-rows:minmax( 0,1fr )}.pane{display:flex;flex-direction:column;min-inline-size:0;min-block-size:0;overflow:auto}::slotted( * ){flex:1 1 auto;min-inline-size:0;min-block-size:0}.divider{inline-size:0;outline:none}.divider.enabled{position:relative;inline-size:8px;cursor:col-resize;touch-action:none;user-select:none}.divider.enabled::before,.divider.enabled::after{content:'';position:absolute;inset-inline:0;margin-inline:auto;inset-block-start:50%;transform:translateY( -50% );pointer-events:none;transition:background-color 120ms ease}.divider.enabled::before{inline-size:1px;block-size:100%;background:var( --os-ui-border,#dcdcde );opacity:0.65}.divider.enabled::after{inline-size:3px;block-size:28px;border-radius:999px;background:var( --os-ui-fg-faint,#787c82 )}.divider.enabled:hover::after,.divider.dragging::after,.divider:focus-visible::after{background:var( --os-ui-accent,#2271b1 )}.divider:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:-2px;border-radius:4px}:host( [ direction='vertical' ] ) .layout{grid-template-columns:minmax( 0,1fr );grid-template-rows:minmax( 0,var( --_split-start,35% ) ) auto minmax( 0,1fr )}:host( [ direction='vertical' ] ) .divider.enabled{inline-size:auto;block-size:8px;cursor:row-resize}:host( [ direction='vertical' ] ) .divider.enabled::before{inline-size:100%;block-size:1px}:host( [ direction='vertical' ] ) .divider.enabled::after{inline-size:28px;block-size:3px}:host .layout.compact{grid-template-columns:minmax( 0,1fr );grid-template-rows:minmax( 0,1fr ) minmax( 0,1fr )}.layout.compact .divider{display:none}:host .layout.compact.start,:host .layout.compact.end{grid-template-rows:minmax( 0,1fr )}.layout.compact.start .end,.layout.compact.end .start{display:none}.shield{position:fixed;inset:0;z-index:2147483647;cursor:col-resize}:host( [ direction='vertical' ] ) .shield{cursor:row-resize}.shield[hidden]{display:none}@media ( prefers-reduced-motion:reduce ){.divider.enabled::before,.divider.enabled::after{transition:none}}`,Dt=class Dt extends _{constructor(){super(...arguments),this.observer=null,this.width=0,this.height=0,this.drag=null,this.onDown=e=>{if(!this.enabled()||e.button!==0||this.drag||this.extent()<=0)return;e.preventDefault();const t=e.currentTarget;t.focus(),this.drag={id:e.pointerId,origin:this.coordinate(e),last:this.coordinate(e),position:this.positionValue(),initial:this.positionValue(),target:t},t.setPointerCapture(e.pointerId),this.requestUpdate()},this.onMove=e=>{this.drag?.id===e.pointerId&&(this.drag.last=this.coordinate(e),this.setPosition(this.drag.position+(this.coordinate(e)-this.drag.origin)*this.sign()/Math.max(1,this.extent())*100))},this.cancelDrag=()=>this.finishDrag(!1),this.onCancel=e=>{this.drag?.id===e.pointerId&&this.cancelDrag()},this.onLostCapture=e=>{this.drag?.id===e.pointerId&&this.finishDrag(!0)},this.onUp=e=>{this.drag?.id===e.pointerId&&(this.onMove(e),this.finishDrag(!0))},this.onKey=e=>{if(!this.enabled())return;if(e.key==="Escape"&&this.drag){e.preventDefault(),this.cancelDrag();return}const[t,o]=this.bounds(),i=this.positionValue(),n=e.shiftKey?10:2,r=this.isVertical()?"ArrowDown":"ArrowRight",a=this.isVertical()?"ArrowUp":"ArrowLeft";let l=i;if(e.key==="Home")l=t;else if(e.key==="End")l=o;else if(e.key===r||e.key===a)l+=n*this.sign()*(e.key===r?1:-1);else return;e.preventDefault(),this.setPosition(l),i!==this.positionValue()&&this.emit("os-split-change",{position:this.positionValue()})}}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<"u"&&(this.observer=new ResizeObserver(e=>{const{width:t,height:o}=e[0].contentRect;if(t===this.width&&o===this.height)return;const i=this.positionValue();this.width=t,this.height=o,this.isCompact()?this.cancelDrag():this.drag&&(this.setPosition(i),this.drag.origin=this.drag.last,this.drag.position=this.positionValue()),this.requestUpdate()}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.observer=null,this.cancelDrag()}attributeChangedCallback(e,t,o){t!==o&&e==="direction"&&this.cancelDrag(),super.attributeChangedCallback(e,t,o)}number(e,t){const o=this.getAttribute(e),i=o===null||o.trim()===""?NaN:Number(o);return Number.isFinite(i)&&i>=0?i:t}isVertical(){return this.getAttribute("direction")==="vertical"}isCompact(){const e=this.number("collapse-at",600);return this.hasAttribute("compact")||!this.isVertical()&&e>0&&this.width>0&&this.width<=e}extent(){return Math.max(0,(this.isVertical()?this.height:this.width)-(this.hasAttribute("resizable")?8:0))}bounds(){const e=this.extent();if(e<=0)return[0,100];const t=this.number("min-start",160),o=this.number("min-end",160),i=t+o,n=i>e?e/i:1;return[t*n/e*100,100-o*n/e*100]}positionValue(){const[e,t]=this.bounds();return Math.min(t,Math.max(e,this.number("position",35)))}enabled(){return this.hasAttribute("resizable")&&!this.isCompact()}setPosition(e){const[t,o]=this.bounds();this.setAttribute("position",String(Math.min(o,Math.max(t,e))))}coordinate(e){return this.isVertical()?e.clientY:e.clientX}sign(){return!this.isVertical()&&getComputedStyle(this).direction==="rtl"?-1:1}finishDrag(e){const t=this.drag;t&&(this.drag=null,e||this.setPosition(t.initial),t.target.hasPointerCapture(t.id)&&t.target.releasePointerCapture(t.id),this.requestUpdate(),e&&this.positionValue()!==t.initial&&this.emit("os-split-change",{position:this.positionValue()}))}recoverFocus(e){const t=e==="end"?"start":"end",i=this.getRootNode().activeElement,n=e!=="stack"&&Array.from(this.children).some(a=>a.slot===t&&a.contains(i)),r=this.shadowRoot?.activeElement?.classList.contains("divider");!n&&!r||queueMicrotask(()=>{this.isConnected&&this.shadowRoot?.querySelector(e==="end"?".pane.end":".pane.start")?.focus()})}render(){!this.enabled()&&this.drag&&this.cancelDrag();const e=this.enabled(),t=this.positionValue(),[o,i]=this.bounds(),n=this.getAttribute("narrow"),r=n==="start"||n==="end"?n:"stack";return this.style.setProperty("--_split-start",`calc((100% - ${this.hasAttribute("resizable")?8:0}px) * ${t/100})`),this.isCompact()&&this.recoverFocus(r),c`<div class="layout ${this.isCompact()?"compact "+r:""}">
1358 <div class="pane start" part="start" id="start" tabindex="-1"><slot name="start"></slot></div>
1359 <div class="divider ${e?"enabled":""} ${this.drag?"dragging":""}" part="divider"
1360 role=${e?"separator":"presentation"} aria-hidden=${e?"false":"true"} tabindex=${e?"0":"-1"}
1361 aria-label=${this.getAttribute("label")||d("Resize panes")}
1362 aria-controls="start" aria-orientation=${this.isVertical()?"horizontal":"vertical"}
1363 aria-valuemin=${String(o)} aria-valuemax=${String(i)} aria-valuenow=${String(t)}
1364 @pointerdown=${this.onDown} @pointermove=${this.onMove} @pointerup=${this.onUp}
1365 @pointercancel=${this.onCancel} @lostpointercapture=${this.onLostCapture} @keydown=${this.onKey}></div>
1366 <div class="pane end" part="end" tabindex="-1"><slot name="end"></slot></div>
1367 </div><div class="shield" ?hidden=${!this.drag} aria-hidden="true"></div>`}};Dt.props=["position","min-start","min-end","resizable","direction","collapse-at","narrow","compact","label"],Dt.styles=[Nh],Dt.help=void 0;let gi=Dt;w("os-split",gi);const Mh=v`:host{display:grid;min-inline-size:0;min-block-size:0;grid-template-columns:var( --os-ui-grid-columns,1fr );grid-template-rows:var( --os-ui-grid-rows,auto );gap:var( --os-ui-grid-gap,8px );column-gap:var( --os-ui-grid-column-gap,var( --os-ui-grid-gap,8px ) );row-gap:var( --os-ui-grid-row-gap,var( --os-ui-grid-gap,8px ) )}:host( [ hidden ] ){display:none}::slotted( * ){min-inline-size:0}::slotted( [ col-span='1' ] ){grid-column:span min( 1,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='1' ] ){grid-row:span 1}::slotted( [ col-span='2' ] ){grid-column:span min( 2,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='2' ] ){grid-row:span 2}::slotted( [ col-span='3' ] ){grid-column:span min( 3,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='3' ] ){grid-row:span 3}::slotted( [ col-span='4' ] ){grid-column:span min( 4,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='4' ] ){grid-row:span 4}::slotted( [ col-span='5' ] ){grid-column:span min( 5,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='5' ] ){grid-row:span 5}::slotted( [ col-span='6' ] ){grid-column:span min( 6,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='6' ] ){grid-row:span 6}::slotted( [ col-span='7' ] ){grid-column:span min( 7,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='7' ] ){grid-row:span 7}::slotted( [ col-span='8' ] ){grid-column:span min( 8,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='8' ] ){grid-row:span 8}::slotted( [ col-span='9' ] ){grid-column:span min( 9,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='9' ] ){grid-row:span 9}::slotted( [ col-span='10' ] ){grid-column:span min( 10,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='10' ] ){grid-row:span 10}::slotted( [ col-span='11' ] ){grid-column:span min( 11,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='11' ] ){grid-row:span 11}::slotted( [ col-span='12' ] ){grid-column:span min( 12,var( --_os-grid-tracks,1 ) )}::slotted( [ row-span='12' ] ){grid-row:span 12}:host( [ data-single-column ] ){grid-template-rows:none}:host( [ data-single-column ] )::slotted( [ row-span ] ){grid-row:auto}`,Pt=class Pt extends _{constructor(){super(...arguments),this.observer=null,this.availableWidth=0,this.overrides=new Map}overrideToken(e,t){if(t!==null)this.overrides.has(e)||this.overrides.set(e,{value:this.style.getPropertyValue(e),priority:this.style.getPropertyPriority(e)}),this.style.setProperty(e,t);else{const o=this.overrides.get(e);o&&(o.value?this.style.setProperty(e,o.value,o.priority):this.style.removeProperty(e),this.overrides.delete(e))}}connectedCallback(){super.connectedCallback(),!(typeof ResizeObserver>"u")&&(this.observer=new ResizeObserver(e=>{this.availableWidth=e[0].contentRect.width,this.updateTracks()}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.observer=null}updateTracks(){const e=Number(this.getAttribute("min-item-width")),t=Number.isFinite(e)&&e>0,o=parseFloat(getComputedStyle(this).columnGap)||0,i=Number(this.getAttribute("columns")),n=Number.isSafeInteger(i)&&i>0?i:1,r=t?Math.max(1,Math.floor((this.availableWidth+o)/(e+o))):n;this.style.setProperty("--_os-grid-tracks",String(r)),this.toggleAttribute("data-single-column",t&&r===1),t||Number.isSafeInteger(i)&&i>0?this.overrideToken("--os-ui-grid-columns",`repeat(${r}, minmax(0, 1fr))`):this.overrideToken("--os-ui-grid-columns",null)}render(){const e=this.getAttribute("rows");e&&/^[1-9]\d*$/.test(e)?this.overrideToken("--os-ui-grid-rows",`repeat(${e}, minmax(0, 1fr))`):this.overrideToken("--os-ui-grid-rows",null);for(const t of["gap","column-gap","row-gap"]){const o=this.getAttribute(t);o!==null&&/^\d+$/.test(o)?this.overrideToken(`--os-ui-grid-${t}`,`${o}px`):this.overrideToken(`--os-ui-grid-${t}`,null)}return this.updateTracks(),c`<slot></slot>`}};Pt.props=["columns","rows","gap","column-gap","row-gap","min-item-width"],Pt.styles=[Mh],Pt.help=void 0;let fi=Pt;w("os-grid",fi);const zh=v`:host{display:flex;align-items:center;justify-content:var( --os-ui-display-align,flex-end );width:100%;min-height:calc( var( --os-ui-display-size,28px ) * 1.4 );padding:8px 14px;box-sizing:border-box;font-size:var( --os-ui-display-size,28px );font-variant-numeric:tabular-nums;font-weight:500;letter-spacing:0.01em;color:var( --os-ui-display-fg,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-display-bg,transparent );border-radius:var( --os-ui-display-border-radius,0 );line-height:1.1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host( [ hidden ] ){display:none}.os-display__output{display:block;font:inherit;color:inherit;text-align:var( --os-ui-display-align,end );overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}`,ba={sm:"16px",md:"20px",lg:"28px",xl:"40px"},Nt=class Nt extends _{connectedCallback(){super.connectedCallback?.(),this.hasAttribute("aria-live")||this.setAttribute("aria-live","polite"),this.hasAttribute("role")||this.setAttribute("role","status")}render(){const e=this.value,t=this.size||"lg",o=this.align||"end";return this.style.setProperty("--os-ui-display-size",ba[t]||ba.lg),this.style.setProperty("--os-ui-display-align",o),c`
1368 <output part="output" class="os-display__output">
1369 ${e??c`<slot></slot>`}
1370 </output>
1371 `}};Nt.props=["value","size","align"],Nt.styles=[zh],Nt.help=void 0;let bi=Nt;w("os-display",bi);const Oh=v`:host{display:block}:host( [ hidden ] ){display:none}.os-disclosure__summary{display:flex;align-items:center;gap:8px;width:100%;padding:0;background:none;border:0;font:inherit;color:var( --os-ui-fg,#1d2327 );text-align:start;cursor:pointer}.os-disclosure__summary:focus-visible{outline:2px solid var( --os-ui-accent,#f252fc );outline-offset:2px;border-radius:4px}.os-disclosure__heading{flex:1 1 auto;min-width:0;margin:0;font-size:20px;font-weight:500;letter-spacing:-0.01em}.os-disclosure__hint{flex:0 0 auto;font-size:13px;font-weight:400;color:var( --os-ui-fg-muted,#646970 )}.os-disclosure__marker{flex:0 0 auto;width:8px;height:8px;margin-inline-end:2px;border-inline-end:2px solid currentColor;border-block-end:2px solid currentColor;transform:rotate( -45deg );transition:transform 160ms ease;opacity:0.7}:host( [ open ] ) .os-disclosure__marker{transform:rotate( 45deg )}@media ( prefers-reduced-motion:reduce ){.os-disclosure__marker{transition:none}}.os-disclosure__body{margin-block-start:14px}.os-disclosure__body[ hidden ]{display:none}`;let Wh=0;const Mt=class Mt extends _{constructor(){super(...arguments),this.bodyId=`os-disclosure-body-${++Wh}`,this.onToggle=()=>{const e=!this.isOpen();e?this.setAttribute("open",""):this.removeAttribute("open"),this.emit("os-disclosure-toggle",{open:e})}}isOpen(){return this.hasAttribute("open")}render(){const e=this.heading||"",t=this.hint||"",o=this.isOpen();return c`
1372 <button
1373 type="button"
1374 class="os-disclosure__summary"
1375 part="summary"
1376 aria-expanded=${o?"true":"false"}
1377 aria-controls=${this.bodyId}
1378 @click=${this.onToggle}
1379 >
1380 <span class="os-disclosure__marker" aria-hidden="true"></span>
1381 <h3 part="heading" class="os-disclosure__heading">${e}</h3>
1382 ${t?c`<span class="os-disclosure__hint">${t}</span>`:""}
1383 </button>
1384 <div
1385 id=${this.bodyId}
1386 class="os-disclosure__body"
1387 part="body"
1388 ?hidden=${!o}
1389 >
1390 <slot></slot>
1391 </div>
1392 `}};Mt.props=["heading","hint","open"],Mt.styles=[Oh],Mt.help=void 0;let mi=Mt;w("os-disclosure",mi);const Hh=v`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:32px 24px;text-align:center;color:var( --os-ui-empty-state-fg,var( --os-ui-fg-muted,#646970 ) )}:host( [ hidden ] ){display:none}.os-empty-state__icon{margin-bottom:4px;color:var( --os-ui-empty-state-icon-color,currentColor );opacity:0.75}.os-empty-state__heading{margin:0;font-size:14px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.os-empty-state__description{margin:0;font-size:12px;line-height:1.4;max-width:48ch}.os-empty-state__description:empty{display:none}.os-empty-state__cta{margin-top:8px}.os-empty-state__cta:empty{display:none}`,zt=class zt extends _{render(){const e=this.icon||"",t=this.heading||"",o=this.description||"";return c`
1393 ${e?c`<os-icon
1394 class="os-empty-state__icon"
1395 name=${e}
1396 size="28"
1397 ></os-icon>`:null}
1398 <h3 class="os-empty-state__heading">${t}</h3>
1399 <p class="os-empty-state__description">${o}</p>
1400 <div class="os-empty-state__cta">
1401 <slot name="cta"></slot>
1402 </div>
1403 <slot></slot>
1404 `}};zt.props=["icon","heading","description"],zt.styles=[Hh],zt.help=void 0;let vi=zt;w("os-empty-state",vi);const Uh=v` ${C} ${xs} ${ks} ${mo}:host{display:inline-flex;user-select:none}:host( [ fill-cell ] ),:host{display:flex;width:100%}:host( [ hidden ] ){display:none}button{width:100%;min-height:var( --os-ui-key-min-height,48px );appearance:none;display:inline-flex;align-items:center;justify-content:center;padding:var( --os-ui-key-padding,8px 12px );font:inherit;font-size:var( --os-ui-key-font-size,16px );font-weight:500;cursor:pointer;border-radius:var( --os-ui-key-border-radius,8px );background:var( --os-ui-key-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-key-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-key-border,1px solid transparent );transition:transform 0.08s ease,background-color 0.12s ease,box-shadow 0.12s ease}button:hover:not(:disabled ){background:var( --os-ui-key-bg-hover,var( --os-ui-hover,rgba( 0,0,0,0.1 ) ) )}button:focus-visible{outline:none;box-shadow:var( --_holo-focus )}button:disabled::before{opacity:0 !important}:host( [ variant='primary' ] ) button{background:var( --os-ui-key-bg,var( --wp-admin-theme-color,#2271b1 ) );color:var( --os-ui-key-fg,var( --os-ui-fg-on-accent,#fff ) )}:host( [ variant='primary' ] ) button:hover:not(:disabled ){filter:brightness( 1.06 )}:host( [ variant='secondary' ] ) button{background:var( --os-ui-key-bg,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) )}:host( [ variant='ghost' ] ) button{background:transparent;border:var( --os-ui-key-border,1px solid var( --os-ui-border,#c3c4c7 ) )}:host( [ variant='danger' ] ) button{background:transparent;color:var( --os-ui-danger,#d63638 );border:1px solid currentColor}:host( .os-key--pressed ) button,button:active:not(:disabled ){transform:scale( 0.96 );box-shadow:inset 0 1px 2px rgba( 0,0,0,0.22 );background:var( --os-ui-key-bg-pressed,var( --os-ui-hover,rgba( 0,0,0,0.14 ) ) )}button:disabled{opacity:0.5;cursor:not-allowed}`,Ls="os-key--pressed",Ot=class Ot extends _{constructor(){super(...arguments),this._onKeyDown=null,this._onKeyUp=null,this._keyHeldByKeyboard=!1}connectedCallback(){super.connectedCallback?.(),this._onKeyDown=e=>this.handleKeyboardDown(e),this._onKeyUp=e=>this.handleKeyboardUp(e),document.addEventListener("keydown",this._onKeyDown),document.addEventListener("keyup",this._onKeyUp)}disconnectedCallback(){this._onKeyDown&&document.removeEventListener("keydown",this._onKeyDown),this._onKeyUp&&document.removeEventListener("keyup",this._onKeyUp)}render(){const e=this.label,t=this.disabled!==null;return c`
1405 <button
1406 part="button"
1407 class="os-holo-sheen"
1408 type="button"
1409 ?disabled=${t}
1410 @click=${o=>this.handleClick(o)}
1411 >
1412 ${e!=null&&e!==""?e:c`<slot></slot>`}
1413 <span class="os-holo-glint" aria-hidden="true"></span>
1414 <span class="os-holo-ring" aria-hidden="true"></span>
1415 </button>
1416 `}handleClick(e){if(this.isDisabled())return;const t=this.buildDetail("click");this.flashPressed(),this.hasAttribute("hold")?(this.emitKey("os-key-down",t),this.emitKey("os-key-up",t)):this.emitKey("os-key",t),e.stopPropagation()}handleKeyboardDown(e){if(this.isDisabled()||!this.matchesEvent(e)||this._keyHeldByKeyboard)return;this._keyHeldByKeyboard=!0,this.classList.add(Ls);const t=this.buildDetail("keyboard");this.hasAttribute("hold")?this.emitKey("os-key-down",t):this.emitKey("os-key",t)}handleKeyboardUp(e){!this._keyHeldByKeyboard||!this.matchesEvent(e,!0)||(this._keyHeldByKeyboard=!1,this.classList.remove(Ls),this.hasAttribute("hold")&&this.emitKey("os-key-up",this.buildDetail("keyboard")))}matchesEvent(e,t=!1){const o=this.code||"",i=this.key||"";if(o){if(e.code!==o)return!1}else if(i){if(e.key!==i)return!1}else return!1;const n=this.modifier||"",r=new Set(n.split("+").map(p=>p.trim().toLowerCase()).filter(Boolean)),a=r.has("ctrl")||r.has("control"),l=r.has("alt"),u=r.has("shift"),h=r.has("meta")||r.has("cmd")||r.has("command");return e.ctrlKey===a&&e.altKey===l&&e.shiftKey===u&&e.metaKey===h}buildDetail(e){const t=this.label||this.textContent?.trim()||"";return{key:this.key||"",code:this.code||"",label:t,source:e}}isDisabled(){return this.disabled!==null}emitKey(e,t){this.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0,composed:!0}))}flashPressed(){this.classList.add(Ls),window.setTimeout(()=>{this.classList.remove(Ls)},120)}};Ot.props=["key","code","label","variant","fill-cell","hold","modifier","disabled"],Ot.styles=[Uh],Ot.help=void 0;let _i=Ot;w("os-key",_i);const qh=v`:host{display:inline}:host( [ hidden ] ){display:none}code{font-family:var( --os-ui-code-font-family,ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace );font-size:var( --os-ui-code-font-size,0.92em );padding:var( --os-ui-code-padding,0.1em 0.4em );border-radius:var( --os-ui-code-border-radius,4px );background:var( --os-ui-code-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );color:var( --os-ui-code-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-code-border,1px solid rgba( 0,0,0,0.08 ) );white-space:var( --os-ui-code-white-space,nowrap );overflow-wrap:anywhere}:host( [ block ] ){display:block}:host( [ block ] ) code{display:block;padding:var( --os-ui-code-block-padding,10px 12px );white-space:pre;max-block-size:var( --os-ui-code-block-max-block-size,none );overflow:auto}:host( [ wrap ] ) code{white-space:pre-wrap;overflow-wrap:anywhere}:host( [ copy ] ){position:relative}:host( [ copy ] ):not( [ block ] ){display:inline-flex;align-items:center;gap:var( --os-ui-code-copy-gap,8px )}.copy{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var( --os-ui-code-copy-size,24px );block-size:var( --os-ui-code-copy-size,24px );background:transparent;border:0;border-radius:4px;padding:0;margin:0;font:inherit;cursor:pointer;color:var( --os-ui-code-copy-color,var( --os-ui-fg-muted,#57606a ) );opacity:var( --os-ui-code-copy-opacity,0.6 );transition:opacity 120ms ease,color 120ms ease,background-color 120ms ease;line-height:1;font-size:1.05em}.copy:hover,.copy:focus-visible{opacity:1;color:var( --os-ui-code-copy-color-hover,var( --wp-admin-theme-color,#007cba ) );background:var( --os-ui-code-copy-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) )}:host( [ block ] ) .copy{position:absolute;top:6px;inset-inline-end:6px;background:var( --os-ui-code-copy-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );opacity:var( --os-ui-code-copy-opacity,0.6 )}:host( [ block ] ):hover .copy,:host( [ block ] ):focus-within .copy{opacity:1}:host( [ block ][ copy ] ) code{padding-inline-end:var( --os-ui-code-copy-inset,42px )}`,Wt=class Wt extends _{constructor(){super(...arguments),this._copied=!1,this._resetTimer=null,this._onCopy=e=>{e.stopPropagation();const t=this._readSlotText();if(t==="")return;const o=n=>{n&&(this._copied=!0,this.requestUpdate(),this.emit("os-copy",{text:t}),this._resetTimer&&clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{this._copied=!1,this._resetTimer=null,this.requestUpdate()},1500))},i=navigator.clipboard;i&&typeof i.writeText=="function"?i.writeText(t).then(()=>o(!0),()=>o(this._fallbackCopy(t))):o(this._fallbackCopy(t))}}_readSlotText(){const e=this.shadowRoot?.querySelector("slot");return e?e.assignedNodes({flatten:!0}).map(i=>i.textContent??"").join("").trim():(this.textContent||"").trim()}_fallbackCopy(e){try{const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select();const o=document.execCommand("copy");return document.body.removeChild(t),o}catch{return!1}}render(){const e=this.getAttribute("copy")!==null;return c`<code><slot></slot></code>${e?c`<button
1417 type="button"
1418 class="copy"
1419 part="copy"
1420 aria-label="${this._copied?"Copied":"Copy code to clipboard"}"
1421 title="${this._copied?"Copied":"Copy to clipboard"}"
1422 @click=${this._onCopy}
1423 >
1424 ${this._copied?"✓":"⧉"}
1425 </button>`:""}`}};Wt.props=["block","copy","wrap"],Wt.styles=[qh],Wt.help=void 0;let wi=Wt;w("os-code",wi);const Fh=v` ${C}:host{display:inline-flex;align-items:center;gap:var( --os-ui-badge-gap,6px );padding:var( --os-ui-badge-padding,2px 8px );font:var( --os-ui-badge-font,500 12px/1.4 var( --os-font,system-ui ) );color:var( --os-ui-badge-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-badge-bg,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) );border:var( --os-ui-badge-border,1px solid transparent );border-radius:var( --os-ui-badge-border-radius,999px );white-space:nowrap;vertical-align:baseline}:host( [ hidden ] ){display:none}.dot{width:var( --os-ui-badge-dot-size,8px );height:var( --os-ui-badge-dot-size,8px );border-radius:50%;background:currentColor;flex:0 0 auto}:host( [ tone="success" ] ){--os-ui-badge-color:var( --os-ui-badge-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-badge-bg:var( --os-ui-badge-success-bg,rgba( 26,127,55,0.12 ) )}:host( [ tone="warning" ] ){--os-ui-badge-color:var( --os-ui-badge-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-badge-bg:var( --os-ui-badge-warning-bg,rgba( 154,103,0,0.12 ) )}:host( [ tone="danger" ] ){--os-ui-badge-color:var( --os-ui-badge-danger,var( --os-ui-danger,#cf222e ) );--os-ui-badge-bg:var( --os-ui-badge-danger-bg,rgba( 207,34,46,0.12 ) )}:host( [ tone="info" ] ){--os-ui-badge-color:var( --os-ui-badge-info,var( --os-ui-info-fg,#0969da ) );--os-ui-badge-bg:var( --os-ui-badge-info-bg,rgba( 9,105,218,0.12 ) )}:host( [ tone="neutral" ] ){--os-ui-badge-color:var( --os-ui-badge-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-badge-bg:var( --os-ui-badge-neutral-bg,rgba( 87,96,106,0.12 ) )}:host( [ tone="accent" ] ){--os-ui-badge-color:var( --os-ui-badge-accent,var( --_holo-ink ) );background-color:transparent;background-image:var( --os-ui-badge-accent-bg,var( --_holo-fill ) );background-size:220% 220%;background-position:22% 28%;background-repeat:no-repeat;box-shadow:var( --_holo-glow );font-weight:600}:host( [ tone="accent" ] ) .dot{display:none}:host( [ no-dot ] ) .dot{display:none}`,Ht=class Ht extends _{render(){return c`<span class="dot" aria-hidden="true"></span><slot></slot>`}};Ht.props=["tone","noDot"],Ht.styles=[Fh],Ht.help=void 0;let yi=Ht;w("os-badge",yi);const Vh=v`:host{position:absolute;width:var( --os-ui-ribbon-size,90px );height:var( --os-ui-ribbon-size,90px );overflow:hidden;pointer-events:none;z-index:var( --os-ui-ribbon-z,2 )}:host( [ hidden ] ){display:none}.banner{position:absolute;display:block;width:var( --os-ui-ribbon-banner-width,140px );padding:var( --os-ui-ribbon-padding,4px 0 );text-align:center;font:var( --os-ui-ribbon-font,700 10px/1.4 var( --os-font,system-ui ) );letter-spacing:var( --os-ui-ribbon-tracking,0.06em );text-transform:uppercase;color:var( --os-ui-ribbon-fg,var( --os-ui-fg-on-accent,#fff ) );background:var( --os-ui-ribbon-bg,var( --wp-admin-theme-color,#2271b1 ) );background-size:260% 260%;background-position:30% 40%;box-shadow:var( --os-ui-ribbon-shadow,0 2px 4px rgba( 0,0,0,0.2 ) )}:host(:not( [ placement ] ) ),:host( [ placement='top-end' ] ){inset-block-start:0;inset-inline-end:0}:host(:not( [ placement ] ) ) .banner,:host( [ placement='top-end' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host( [ placement='top-start' ] ){inset-block-start:0;inset-inline-start:0}:host( [ placement='top-start' ] ) .banner{inset-block-start:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-end' ] ){inset-block-end:0;inset-inline-end:0}:host( [ placement='bottom-end' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-end:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( -45deg )}:host( [ placement='bottom-start' ] ){inset-block-end:0;inset-inline-start:0}:host( [ placement='bottom-start' ] ) .banner{inset-block-end:var( --os-ui-ribbon-banner-offset,20px );inset-inline-start:var( --os-ui-ribbon-banner-pull,-36px );transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host(:not( [ placement ] ) ) .banner,:host-context( [ dir='rtl' ] ):host( [ placement='top-end' ] ) .banner{transform:rotate( -45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='top-start' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-end' ] ) .banner{transform:rotate( 45deg )}:host-context( [ dir='rtl' ] ):host( [ placement='bottom-start' ] ) .banner{transform:rotate( -45deg )}:host( [ tone='success' ] ) .banner{background:var( --os-ui-ribbon-success,var( --os-ui-success-fg,#1a7f37 ) )}:host( [ tone='warning' ] ) .banner{background:var( --os-ui-ribbon-warning,var( --os-ui-warning-bg,#9a6700 ) )}:host( [ tone='danger' ] ) .banner{background:var( --os-ui-ribbon-danger,var( --os-ui-danger,#cf222e ) )}:host( [ tone='info' ] ) .banner{background:var( --os-ui-ribbon-info,var( --os-ui-info-bg,#0969da ) )}:host( [ tone='neutral' ] ) .banner{background:var( --os-ui-ribbon-neutral,var( --os-ui-surface,#57606a ) )}`,Ut=class Ut extends _{render(){return c`<span class="banner" part="banner"><slot></slot></span>`}};Ut.props=["placement","tone"],Ut.styles=[Vh],Ut.help=void 0;let xi=Ut;w("os-ribbon",xi);const jh=v`:host{display:inline-block}`,M="os-file-tile",ma={draft:"Draft",pending:"Pending",private:"Private",future:"Scheduled"};function Kh(){const s=window.wp?.os?.getOsSettings;if(typeof s!="function")return!0;try{return s()?.showPostStatusRibbons!==!1}catch{return!0}}function Bh(){return window.wp?.os?.dragManager??null}const Gh=["type","ref","label","icon","thumbnail","kind","status","selected","selectable","missing","access-gated","drag-kind","drag-title","drag-icon"],Le=class Le extends _{constructor(){super(...arguments),this._pointerdownHandler=null,this._keydownHandler=null,this._onSettingsSave=e=>{e.detail?.phase==="saved"&&this._paint()}}connectedCallback(){super.connectedCallback(),this._keydownHandler||(this._keydownHandler=e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.click())},this.addEventListener("keydown",this._keydownHandler)),document.addEventListener("os-settings-save-lifecycle",this._onSettingsSave),this._paint()}disconnectedCallback(){this._pointerdownHandler&&(this.removeEventListener("pointerdown",this._pointerdownHandler),this._pointerdownHandler=null),this._keydownHandler&&(this.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),document.removeEventListener("os-settings-save-lifecycle",this._onSettingsSave)}requestUpdate(){this.isConnected&&this._paint()}attributeChangedCallback(e,t,o){if(t!==o){if(e==="selected"||e==="selectable"||e==="aria-selected"){this._paintSelection();return}super.attributeChangedCallback(e,t,o)}}_paintSelection(){const e=this.hasAttribute("selected"),t=this.hasAttribute("selectable");if(this.classList.toggle(`${M}--selected`,e),this.setAttribute("role",t?"option":"listitem"),t){const o=e?"true":"false";this.getAttribute("aria-selected")!==o&&this.setAttribute("aria-selected",o)}else this.removeAttribute("aria-selected")}render(){return c``}_paint(){const e=this.getAttribute("type")??"",t=this.getAttribute("ref")??"",o=this.getAttribute("label")??"",i=this.getAttribute("icon")??"",n=this.getAttribute("thumbnail")??"",r=this.getAttribute("kind")??"entry",a=this.getAttribute("status")??"",l=this.hasAttribute("selected"),u=this.hasAttribute("selectable"),h=this.hasAttribute("missing"),p=this.hasAttribute("access-gated"),g=[M,`${M}--folder`,`${M}--missing`,`${M}--access-gated`,`${M}--selected`];for(const k of g)this.classList.remove(k);this.classList.add(M),r==="folder"&&this.classList.add(`${M}--folder`),h&&this.classList.add(`${M}--missing`),p&&this.classList.add(`${M}--access-gated`),l&&this.classList.add(`${M}--selected`),this.dataset.fileType=e,this.dataset.fileRef=t,r&&(this.dataset.role=r),this.setAttribute("role",u?"option":"listitem"),u?this.setAttribute("aria-selected",l?"true":"false"):this.removeAttribute("aria-selected"),this.setAttribute("aria-label",o),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0");const b="You don’t have permission to open this — ask the folder owner for access.";p?(this.title=b,this.setAttribute("aria-disabled","true")):(this.removeAttribute("aria-disabled"),this.title===b&&this.removeAttribute("title"));const m=[`${M}__visual`,`${M}__label`,`${M}__lock`];for(const k of m)this.querySelectorAll(`:scope > .${k}`).forEach(f=>f.remove());this.querySelectorAll(":scope > os-ribbon").forEach(k=>k.remove());const x=document.createElement("span");if(x.className=`${M}__visual`,n){const k=document.createElement("img");k.src=n,k.alt="",k.loading="lazy",k.decoding="async",k.className=`${M}__preview`,k.draggable=!1,x.appendChild(k)}else if(i){const k=Jr(i,{title:o,className:`${M}__icon`});x.appendChild(k)}this.appendChild(x);const y=document.createElement("span");if(y.className=`${M}__label`,y.textContent=o,this.appendChild(y),p){const k=document.createElement("span");k.className=`${M}__lock dashicons dashicons-lock`,k.setAttribute("aria-hidden","true"),this.appendChild(k)}if(a&&a!=="publish"&&ma[a]&&Kh()){const k=document.createElement("os-ribbon");k.setAttribute("placement","top-end"),k.setAttribute("tone",Xh(a)),k.textContent=ma[a],this.appendChild(k)}rc(this),be("os.tile.rendered",{tile:this}),this._wireDragOut()}_wireDragOut(){this._pointerdownHandler&&(this.removeEventListener("pointerdown",this._pointerdownHandler),this._pointerdownHandler=null);const e=this.getAttribute("drag-kind");if(!e)return;const t=o=>{if(o.button!==0)return;const i=Bh();if(!i)return;const n=this.getAttribute("ref")??"",r=this.getAttribute("drag-title")??this.getAttribute("label")??void 0,a=this.getAttribute("drag-icon")??this.getAttribute("icon")??void 0,l=this.getBoundingClientRect();i.start({payload:{type:"shortcut",source:this,data:{kind:e,ref:n,title:r,icon:a},ghost:{offsetX:o.clientX-l.left,offsetY:o.clientY-l.top}},origin:o})};this._pointerdownHandler=t,this.addEventListener("pointerdown",t)}};Le.shadow=!1,Le.props=Gh,Le.styles=[jh],Le.help=void 0;let ki=Le;function Xh(s){switch(s){case"draft":return"warning";case"pending":return"info";case"private":return"danger";case"future":return"primary";default:return"primary"}}w("os-tile",ki);const Zh=v`:host{display:block;position:relative;overflow-y:auto;overflow-x:hidden;font:var( --os-ui-log-font,12px/1.4 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace );color:var( --os-ui-log-fg,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-log-bg,transparent );border:var( --os-ui-log-border,1px solid rgba( 0,0,0,0.06 ) );border-radius:var( --os-ui-log-border-radius,4px );min-height:var( --os-ui-log-min-height,120px );contain:strict}:host( [ hidden ] ){display:none}.spacer{position:relative;width:100%}.window{position:absolute;left:0;right:0;top:0}.row{box-sizing:border-box;display:block;padding:var( --os-ui-log-row-padding,2px 8px );min-height:var( --os-ui-log-row-height,22px );border-bottom:var( --os-ui-log-row-border,1px solid rgba( 0,0,0,0.04 ) );white-space:var( --os-ui-log-row-white-space,pre );overflow:hidden;text-overflow:ellipsis}:host( [ auto-row-height ] ) .row{min-height:0;overflow:visible;text-overflow:clip;white-space:var( --os-ui-log-row-white-space,normal )}.empty{display:flex;align-items:center;justify-content:center;padding:16px;color:var( --os-ui-fg-muted,#57606a );font-style:italic}`;function va(s){const e=document.createElement("span");let t;if(typeof s=="string")t=s;else try{t=JSON.stringify(s)}catch{t=String(s)}return e.textContent=t,e}const qt=class qt extends _{constructor(){super(...arguments),this._entries=[],this._renderRow=va,this._stickToBottom=!0,this._heights=[],this._offsets=[],this._offsetsValid=!1,this._onScroll=()=>{const e=this.scrollHeight-this.clientHeight-this.scrollTop;this._stickToBottom=e<=4,this._paintWindow()},this._resizeObserver=null}connectedCallback(){super.connectedCallback(),this.addEventListener("scroll",this._onScroll,{passive:!0}),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._paintWindow()),this._resizeObserver.observe(this)),queueMicrotask(()=>{this._paintSpacer(),this._stickToBottom&&(this.scrollTop=this.scrollHeight),this._paintWindow()})}disconnectedCallback(){this.removeEventListener("scroll",this._onScroll),this._resizeObserver?.disconnect(),this._resizeObserver=null}get renderRow(){return this._renderRow}set renderRow(e){this._renderRow=typeof e=="function"?e:va,this._heights=[],this._invalidateOffsets(),this._paintSpacer(),this._paintWindow()}get entries(){return this._entries}set entries(e){this._entries=Array.isArray(e)?e.slice():[],this._heights=[],this._invalidateOffsets(),this._enforceMaxRows(),this._afterEntriesMutation()}push(e){this._entries.push(e),this._enforceMaxRows(),this._afterEntriesMutation(),this.emit("os-log-append",{entry:e,length:this._entries.length})}pushMany(e){if(!(!Array.isArray(e)||e.length===0)){for(const t of e)this._entries.push(t);this._enforceMaxRows(),this._afterEntriesMutation()}}clear(){this._entries=[],this._heights=[],this._invalidateOffsets(),this._afterEntriesMutation()}scrollToBottom(){this._stickToBottom=!0,this.scrollTop=this.scrollHeight}_enforceMaxRows(){const e=this._readMaxRows();if(e>0&&this._entries.length>e){const t=this._entries.length-e;this._entries.splice(0,t),this._heights.length>0&&this._heights.splice(0,Math.min(t,this._heights.length)),this._invalidateOffsets()}}_afterEntriesMutation(){this._paintSpacer(),this._stickToBottom&&(this.scrollTop=this.scrollHeight),this._paintWindow()}_readRowHeight(){const e=parseFloat(this.getAttribute("row-height")||"22");return Number.isFinite(e)&&e>0?e:22}_readMaxRows(){const e=parseFloat(this.getAttribute("max-rows")||"0");return Number.isFinite(e)&&e>0?Math.floor(e):0}_readOverscan(){const e=parseFloat(this.getAttribute("overscan")||"6");return Number.isFinite(e)&&e>=0?Math.floor(e):6}_isAutoHeight(){return this.getAttribute("auto-row-height")!==null}_invalidateOffsets(){this._offsetsValid=!1,this._offsets=[]}_ensureOffsets(){if(this._offsetsValid)return;const e=this._readRowHeight(),t=new Array(this._entries.length);let o=0;for(let i=0;i<this._entries.length;i++){t[i]=o;const n=this._heights[i];o+=Number.isFinite(n)&&n>0?n:e}this._offsets=t,this._totalHeight=o,this._offsetsValid=!0}_totalContentHeight(){return this._isAutoHeight()?(this._ensureOffsets(),this._totalHeight??0):this._entries.length*this._readRowHeight()}_findIndexAtOffset(e){const t=this._offsets;if(t.length===0)return 0;let o=0,i=t.length-1;for(;o<i;){const n=Math.floor((o+i+1)/2);t[n]<=e?o=n:i=n-1}return o}_paintSpacer(){const e=this.shadowRoot?.querySelector(".spacer");e&&(e.style.height=`${this._totalContentHeight()}px`)}_paintWindow(){const e=this.shadowRoot?.querySelector(".window"),t=this.shadowRoot?.querySelector(".empty");if(!e)return;if(this._entries.length===0){e.replaceChildren(),t&&(t.style.display="");return}t&&(t.style.display="none");const o=this._isAutoHeight(),i=this._readRowHeight(),n=this._readOverscan(),r=this.clientHeight,a=this.scrollTop;let l,u;if(o){this._ensureOffsets();const m=this._findIndexAtOffset(a),x=this._findIndexAtOffset(a+r);l=Math.max(0,m-n),u=Math.min(this._entries.length,x+1+n)}else l=Math.max(0,Math.floor(a/i)-n),u=Math.min(this._entries.length,Math.ceil((a+r)/i)+n);const h=document.createDocumentFragment(),p=[];for(let m=l;m<u;m++){const x=this._renderRow(this._entries[m],m);let y;x instanceof HTMLElement?y=x:(y=document.createElement("span"),y.textContent=String(x)),y.classList.add("row"),y.style.position="absolute",y.style.left="0",y.style.right="0",o?(y.style.top=`${this._offsets[m]}px`,y.style.height="auto"):(y.style.top=`${m*i}px`,y.style.height=`${i}px`),h.appendChild(y),p.push({idx:m,el:y})}if(e.replaceChildren(h),!o)return;let g=!1;const b=this._readRowHeight();for(const{idx:m,el:x}of p){const y=x.offsetHeight||b,k=this._heights[m];(!Number.isFinite(k)||Math.abs(k-y)>.5)&&(this._heights[m]=y,g=!0)}if(g){this._invalidateOffsets(),this._ensureOffsets();for(const{idx:m,el:x}of p)x.style.top=`${this._offsets[m]}px`;this._paintSpacer(),this._stickToBottom&&(this.scrollTop=this.scrollHeight)}}render(){const e=this.getAttribute("empty")||"No entries";return c`
1426 <div class="spacer">
1427 <div class="window" part="window"></div>
1428 </div>
1429 <div class="empty" part="empty">${e}</div>
1430 `}};qt.props=["rowHeight","maxRows","overscan","empty","autoRowHeight"],qt.styles=[Zh],qt.help=void 0;let $i=qt;w("os-log",$i);const Yh=v`:host{display:block;counter-reset:os-step}:host( [ hidden ] ){display:none}.os-steps__list{display:flex;flex-direction:column;gap:var( --os-ui-steps-gap,16px );margin:0;padding:0;list-style:none}:host( [ horizontal ] ){--os-ui-step-connector-width:20px;--os-ui-step-title-color:var( --os-ui-fg-muted,#646970 );--os-ui-step-title-weight:400}:host( [ horizontal ] ) .os-steps__list{flex-direction:row;align-items:center;flex-wrap:wrap;gap:var( --os-ui-steps-gap,10px )}`,Jh=v`:host{display:grid;grid-template-columns:var( --os-ui-step-chip-size,28px ) 1fr var( --os-ui-step-connector-width,0 );column-gap:var( --os-ui-step-gap,12px );align-items:start;counter-increment:os-step}:host( [ hidden ] ){display:none}:host::before{content:counter( os-step );display:inline-flex;align-items:center;justify-content:center;width:var( --os-ui-step-chip-size,28px );height:var( --os-ui-step-chip-size,28px );box-sizing:border-box;border-radius:50%;background:var( --os-ui-step-chip-bg,var( --wp-admin-theme-color,#2271b1 ) );background-size:200% 200%;background-position:30% 40%;color:var( --os-ui-step-chip-fg,var( --os-ui-fg-on-accent,#fff ) );border:var( --os-ui-step-chip-border,0 );font-family:var( --os-ui-step-chip-family,inherit );font-size:var( --os-ui-step-chip-font-size,13px );font-weight:600;line-height:1;flex-shrink:0}:host( [ done ] )::before{content:'✓';background:var( --os-ui-step-chip-done-bg,var( --os-ui-fg-muted,#646970 ) )}:host( [ current ] ) .os-step__title{color:var( --os-ui-fg,#1d2327 );font-weight:600}:host( [ interactive ] ){cursor:pointer}:host( [ interactive ] ) .os-step__title{transition:color 120ms ease}:host( [ interactive ] )::before{transition:border-color 120ms ease}:host( [ interactive ]:hover ) .os-step__title{color:var( --os-ui-step-title-hover-color,var( --os-ui-fg,#1d2327 ) )}:host( [ interactive ]:hover )::before{border-color:var( --os-ui-step-title-hover-color,var( --os-ui-fg,#1d2327 ) )}:host( [ interactive ]:focus-visible ){outline:var( --os-ui-focus-ring,2px solid #2271b1 );outline-offset:2px;border-radius:var( --os-ui-radius,4px )}:host::after{content:'';inline-size:var( --os-ui-step-connector-width,0 );block-size:1px;background:var( --os-ui-border,rgba( 0,0,0,0.08 ) );align-self:center}:host(:last-of-type )::after{content:none}.os-step__body{min-width:0}:host( [ trail ] ){align-items:center}:host( [ trail ] ) .os-step__title{margin:0}.os-step__title{margin:0 0 4px;font-family:var( --os-ui-step-title-family,inherit );font-size:var( --os-ui-step-title-size,14px );font-weight:var( --os-ui-step-title-weight,600 );color:var( --os-ui-step-title-color,var( --os-ui-fg,#1d2327 ) );text-transform:var( --os-ui-step-title-transform,none );letter-spacing:var( --os-ui-step-title-spacing,normal );line-height:1.3}.os-step__title:empty{display:none}.os-step__body::slotted( * ){margin-block:0}`,Ft=class Ft extends _{constructor(){super(...arguments),this.syncTrail=()=>{const e=this.hasAttribute("horizontal");for(const t of Array.from(this.children))t.tagName==="OS-STEP"&&t.toggleAttribute("trail",e)}}connectedCallback(){super.connectedCallback(),this.syncTrail()}render(){return this.syncTrail(),c`<ol class="os-steps__list"><slot @slotchange=${this.syncTrail}></slot></ol>`}};Ft.props=["horizontal"],Ft.styles=[Yh],Ft.help=void 0;let Ai=Ft;w("os-steps",Ai);const Vt=class Vt extends _{constructor(){super(...arguments),this.onClick=e=>{if(!this.isInteractive())return;const t=e.composedPath();for(const o of t){if(o===this)break;if(o instanceof HTMLElement&&o.hasAttribute("data-noclick"))return}this.dispatchEvent(new CustomEvent("os-step-click",{bubbles:!0,composed:!0}))},this.onKeyDown=e=>{if(!this.isInteractive()||e.key!=="Enter"&&e.key!==" ")return;const t=e.target;t instanceof HTMLElement&&t!==this&&t.closest("button, a, input, select, textarea")||(e.preventDefault(),this.onClick(e))}}isInteractive(){return this.hasAttribute("interactive")}syncRoles(){this.hasAttribute("current")?this.setAttribute("aria-current","step"):this.removeAttribute("aria-current"),this.isInteractive()?(this.setAttribute("role","button"),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")):(this.removeAttribute("role"),this.removeAttribute("tabindex"))}connectedCallback(){super.connectedCallback(),this.syncRoles(),this.addEventListener("click",this.onClick),this.addEventListener("keydown",this.onKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.onClick),this.removeEventListener("keydown",this.onKeyDown)}render(){const e=this.title||"";return this.syncRoles(),c`
1431 <div class="os-step__body">
1432 <div class="os-step__title">${e}</div>
1433 <slot></slot>
1434 </div>
1435 `}};Vt.props=["title","done","current","interactive"],Vt.styles=[Jh],Vt.help={title:"Step",summary:"A single numbered step inside <os-steps>. Renders an auto-numbered chip and an optional bold title above the slotted body.",status:"stable",props:[{name:"title",type:"string",description:"Optional bold title rendered above the body."},{name:"done",type:"boolean",description:"When present, the chip shows a ✓ in a muted colour instead of the number."},{name:"current",type:"boolean",description:'Marks the step the reader is on. Mirrors aria-current="step" onto the host.'},{name:"interactive",type:"boolean",description:"Makes the step a jump target: focusable, activated by click or Enter/Space, and emits os-step-click. Lifts the title to full contrast on hover."}],events:[{name:"os-step-click",detail:"none",description:"Fired when an interactive step is activated by pointer or keyboard."}],slots:[{name:"(default)",description:"Step body content."}],cssProps:[{name:"--os-ui-step-gap",default:"12px"},{name:"--os-ui-step-chip-size",default:"28px"},{name:"--os-ui-step-chip-bg",default:"var(--wp-admin-theme-color)"},{name:"--os-ui-step-chip-fg",default:"#fff"},{name:"--os-ui-step-chip-done-bg",default:"var(--os-ui-fg-muted)"},{name:"--os-ui-step-chip-font-size",default:"13px"},{name:"--os-ui-step-title-hover-color",default:"var(--os-ui-fg)",description:"Ink an interactive step takes on hover, on its title and on an outlined chip."}],example:c`
1436 <os-steps>
1437 <os-step title="Configure">Open OpenStation Preferences → AI.</os-step>
1438 <os-step title="Connect" done>Key confirmed.</os-step>
1439 </os-steps>
1440 `};let Ei=Vt;w("os-step",Ei);const Qh=v` ${C} ${$s}:host{display:block;--_bg:var( --os-ui-table-bg,var( --os-ui-surface,#fff ) );--_border:var( --os-ui-table-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_column-border:var( --os-ui-table-column-border,var( --os-ui-border-strong,rgba( 0,0,0,0.14 ) ) );--_header-bg:var( --os-ui-table-header-bg,var( --os-ui-surface-elevated,#f6f7f7 ) );--_row-hover:var( --os-ui-table-row-hover,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );--_stripe:var( --os-ui-table-stripe,var( --os-ui-surface-subtle,rgba( 0,0,0,0.03 ) ) );--_cell-padding:var( --os-ui-table-cell-padding,8px 12px );--_font-size:var( --os-ui-table-font-size,13px );--_max-height:var( --os-ui-table-max-height,none );font-size:var( --_font-size );color:inherit}:host( [ hidden ] ){display:none}.scroll{position:relative;overflow:auto;max-height:var( --_max-height );border:1px solid var( --_border );border-radius:4px;background:var( --_bg )}table{width:100%;border-collapse:separate;border-spacing:0;background:var( --_bg )}thead th{text-align:start;font-weight:600;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );padding:var( --_cell-padding );border-bottom:1px solid var( --_border );white-space:nowrap}tbody td{padding:var( --_cell-padding );border-bottom:1px solid var( --_border );background-color:var( --_bg );vertical-align:middle}tbody tr:last-child td{border-bottom:0}:host( [ striped ] ) tbody tr:nth-child( odd ) td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ hover ] ) tbody tr:hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) ),linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ compact ] ){--os-ui-table-cell-padding:4px 8px;--os-ui-table-font-size:12px}:host( [ bordered ] ) thead th,:host( [ bordered ] ) tbody td{border-inline-end:1px solid var( --_column-border )}:host( [ bordered ] ) thead th:last-child,:host( [ bordered ] ) tbody td:last-child{border-inline-end:0}th.is-sticky,td.is-sticky{position:sticky;z-index:10}tbody td.is-sticky{background-color:var( --_bg )}thead th.is-sticky{background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );z-index:30}:host( [ sticky-header ] ) thead th{position:sticky;top:0;z-index:20}:host( [ sticky-header ] ) thead tr.filter-row th{top:var( --os-ui-table-header-height,33px );z-index:20}:host( [ sticky-header ] ) thead th.is-sticky{z-index:40}:host( [ sticky-header ] ) thead tr.filter-row th.is-sticky{z-index:40}th.is-sticky-edge,td.is-sticky-edge{border-inline-end:var( --os-ui-table-sticky-edge,2px solid var( --_border ) )}.align-center{text-align:center}.align-end{text-align:end}.filter-row th{padding:4px 8px;background-color:var( --_header-bg );background-image:var( --os-ui-table-header-bg-image,none );background-repeat:var( --os-ui-table-header-bg-image-repeat,repeat );background-size:var( --os-ui-table-header-bg-image-size,auto );background-position:var( --os-ui-table-header-bg-image-position,center );border-bottom:1px solid var( --_border );font-weight:400}.filter-input,.filter-select{width:100%;min-width:60px;box-sizing:border-box;padding:4px 6px;font:inherit;color:inherit;background-color:var( --_bg );border:1px solid var( --_border );border-radius:3px}.filter-input:focus,.filter-select:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --_holo-focus-field )}.expander{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:0;background:transparent;color:inherit;cursor:pointer;border-radius:3px;font-size:11px;line-height:1}.expander:hover{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}td.col-expander,th.col-expander{width:36px;min-width:36px;padding-left:0;padding-right:0;text-align:center}tr.subtable td{padding:0;background-color:var( --_bg );background-image:linear-gradient( var( --_stripe ),var( --_stripe ) );border-bottom:1px solid var( --_border )}tr.subtable .subtable-inner{padding:8px 12px 8px 32px}tr.empty td{padding:24px;text-align:center;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );font-style:italic}thead th.is-sortable{cursor:pointer;user-select:none}thead th.is-sortable:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}thead th.is-sortable:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var( --os-ui-accent,#2271b1 )}.sort-indicator{font-size:10px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) );margin-inline-start:2px}thead th.sort-asc .sort-indicator,thead th.sort-desc .sort-indicator{color:var( --wp-admin-theme-color,#2271b1 )}td.col-select,th.col-select{width:40px;min-width:40px;padding-left:0;padding-right:0;text-align:center}.select-all-checkbox,.select-row-checkbox{cursor:pointer;margin:0}tbody tr.is-selected td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none}tbody tr.is-selected:hover td{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 16%,var( --_bg ) )}tbody tr.is-selected td:first-child{box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}tbody:dir( rtl ) tr.is-selected td:first-child{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) .scroll{border:0;border-radius:0}:host( [ stacked ] ) table,:host( [ stacked ] ) tbody{display:block;width:100%}:host( [ stacked ] ) colgroup,:host( [ stacked ] ) thead{display:none}:host( [ stacked ] ) tbody tr{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border-bottom:1px solid var( --_border );background-color:var( --_bg )}:host( [ stacked ] ) tbody tr:last-child{border-bottom:0}:host( [ stacked ] ) tbody td{display:block;padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none;min-width:0;width:auto;vertical-align:baseline}:host( [ stacked ] ) tbody tr.is-selected td,:host( [ stacked ] ) tbody tr.is-selected:hover td,:host( [ stacked ][ striped ] ) tbody tr:nth-child( odd ) td,:host( [ stacked ][ hover ] ) tbody tr:hover td,:host( [ stacked ][ hover ][ striped ] ) tbody tr:nth-child( odd ):hover td,:host( [ stacked ][ bordered ] ) tbody td{padding:0;border:0;background-color:transparent;background-image:none;box-shadow:none}:host( [ stacked ][ hover ] ) tbody tr:hover{background-image:linear-gradient( var( --_row-hover ),var( --_row-hover ) )}:host( [ stacked ] ) tbody tr.is-selected,:host( [ stacked ] ) tbody tr.is-selected:hover{background-color:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,var( --_bg ) );background-image:none;box-shadow:inset 3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody:dir( rtl ) tr.is-selected{box-shadow:inset -3px 0 0 0 var( --os-ui-accent,#2271b1 )}:host( [ stacked ] ) tbody td.col-select,:host( [ stacked ] ) tbody td.col-expander{flex:0 0 auto;display:flex;align-items:center;justify-content:center;min-width:0}:host( [ stacked ] ) tbody td.col-select{width:44px;height:44px;margin:-11px 0 -11px -11px;cursor:pointer}:host( [ stacked ] ) .select-row-checkbox{width:22px;height:22px}:host( [ stacked ] ) tbody td.col-expander{width:28px;height:22px;margin-inline-start:-4px}:host( [ stacked ] ) tbody td.stack-body{flex:1 1 auto;display:flex;flex-direction:column;gap:4px;min-width:0}.stack-cell{display:flex;align-items:baseline;gap:6px;min-width:0;line-height:1.4}.stack-title{font-size:15px;font-weight:600;line-height:1.35}.stack-meta{font-size:13px}.stack-label{flex:0 0 auto;font-size:12px;color:var( --os-ui-text-muted,var( --os-ui-fg-muted,rgba( 0,0,0,0.55 ) ) )}.stack-label::after{content:'·';margin-inline-start:6px}.stack-value{flex:1 1 auto;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:6px}.stack-actions{margin-block-start:6px}.stack-actions .stack-value{gap:8px}.stack-actions .stack-value>*{justify-content:flex-start;max-width:100%}:host( [ stacked ] ) tr.subtable,:host( [ stacked ] ) tr.empty{display:block;padding:0}:host( [ stacked ] ) tr.subtable td{background-image:linear-gradient( var( --_stripe ),var( --_stripe ) )}:host( [ stacked ] ) tr.subtable .subtable-inner{padding:8px 14px 12px}:host( [ stacked ] ) tr.empty td{padding:24px}:host( [ stacked ] ) tr.skeleton{display:block;padding:14px;border-bottom:1px solid var( --_border )}:host( [ stacked ] ) tr.skeleton td.stack-body{gap:8px}:host( [ stacked ] ) tr.skeleton .skeleton-bar:first-child{height:15px}tbody tr.skeleton td{padding:var( --_cell-padding )}.skeleton-bar{display:block;height:12px;border-radius:3px;background:linear-gradient( 90deg,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 0%,var( --os-ui-table-skeleton-highlight,var( --os-ui-hover,rgba( 0,0,0,0.14 ) ) ) 50%,var( --os-ui-table-skeleton-color,var( --os-ui-hover,rgba( 0,0,0,0.06 ) ) ) 100% );background-size:200% 100%;animation:os-table-skeleton-pulse 1.4s ease-in-out infinite}@keyframes os-table-skeleton-pulse{0%{background-position:200% 50%}100%{background-position:-200% 50%}}@media ( prefers-reduced-motion:reduce ){.skeleton-bar{animation:none}}`,Se="__wpd_expander__",Ce="__wpd_select__",jt=class jt extends _{constructor(){super(...arguments),this._data=[],this._columns=[],this._filters={},this._expanded=new Set,this._subTable=null,this._sort=null,this._selection=new Set,this._getRowId=(e,t)=>t,this._filterCache=new Map,this._paintScheduled=!1,this._stacked=!1,this._stickyHeaderWarned=!1,this._stickyRaceWarned=!1,this._resizeObserver=null,this._stickyMicroScheduled=!1,this._stickyRafHandle=null,this._loadingDesyncWarned=!1,this._lastStickyIndex=-1}get data(){return this._data}set data(e){this._data=Array.isArray(e)?e.slice():[],this._expanded.clear(),this._schedulePaint()}get columns(){return this._columns}set columns(e){this._columns=Array.isArray(e)?e.slice():[];const t=new Set(this._columns.map(o=>o.key));for(const o of Object.keys(this._filters))t.has(o)||delete this._filters[o];for(const o of Array.from(this._filterCache.keys()))t.has(o)||this._filterCache.delete(o);this._sort&&!t.has(this._sort.key)&&(this._sort=null),this._schedulePaint()}get filters(){return{...this._filters}}set filters(e){this._filters=e?{...e}:{},this._schedulePaint()}get sort(){return this._sort?{...this._sort}:null}set sort(e){this._sort=e?{...e}:null,this._schedulePaint()}get selection(){return new Set(this._selection)}set selection(e){this._selection=new Set(e??[]),this._schedulePaint()}get selectedRows(){const e=[];return this._data.forEach((t,o)=>{this._selection.has(this._getRowId(t,o))&&e.push(t)}),e}get visibleRows(){return this._filteredRows().map(e=>e.row)}get getRowId(){return this._getRowId}set getRowId(e){this._getRowId=typeof e=="function"?e:(t,o)=>o,this._schedulePaint()}get subTable(){return this._subTable}set subTable(e){this._subTable=typeof e=="function"?e:null,this._expanded.clear(),this._schedulePaint()}get expanded(){return new Set(this._expanded)}set expanded(e){this._expanded=new Set(e??[]),this._schedulePaint()}expand(e){e<0||e>=this._data.length||this._expanded.has(e)||(this._expanded.add(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!0}),this._schedulePaint())}collapse(e){this._expanded.has(e)&&(this._expanded.delete(e),this.emit("os-table-expand-change",{row:this._data[e],index:e,expanded:!1}),this._schedulePaint())}expandAll(){if(!this._subTable)return;let e=!1;for(let t=0;t<this._data.length;t++)this._subTable(this._data[t],t)&&(this._expanded.has(t)||(this._expanded.add(t),e=!0));e&&this._schedulePaint()}collapseAll(){this._expanded.size!==0&&(this._expanded.clear(),this._schedulePaint())}isExpanded(e){return this._expanded.has(e)}clearFilters(){Object.keys(this._filters).length!==0&&(this._filters={},this.emit("os-table-filter-change",{filters:{}}),this._schedulePaint())}clearSort(){this._sort!==null&&(this._sort=null,this.emit("os-table-sort-change",{sort:null}),this._schedulePaint())}select(e){if(this._selection.has(e))return;const t=this._readSelectable(),o=t==="single"?Array.from(this._selection):[];t==="single"&&this._selection.clear(),this._selection.add(e),this._emitSelectionChange(),this._syncSelectionDom([e,...o])}deselect(e){this._selection.delete(e)&&(this._emitSelectionChange(),this._syncSelectionDom([e]))}selectAll(){if(this._readSelectable()==="multi"){for(const{row:e,index:t}of this._filteredRows())this._selection.add(this._getRowId(e,t));this._emitSelectionChange(),this._syncSelectionDom("all")}}clearSelection(){this._selection.size!==0&&(this._selection.clear(),this._emitSelectionChange(),this._syncSelectionDom("all"))}_syncSelectionDom(e){const t=this.shadowRoot;if(!t)return;const o=t.querySelector("tbody");if(!o)return;let i=null;if(e!=="all"){i=new Set;for(const a of e)i.add(String(a))}const n=o.querySelectorAll("tr[data-row-id]");for(const a of n){const l=a.dataset.rowId;if(l===void 0||i&&!i.has(l))continue;const u=Number(a.dataset.rowIndex);if(!Number.isFinite(u))continue;const h=this._data[u];if(h===void 0)continue;const p=this._getRowId(h,u),g=this._selection.has(p);a.classList.toggle("is-selected",g);const b=a.querySelector("input.select-row-checkbox");b&&b.checked!==g&&(b.checked=g)}const r=t.querySelector("thead .select-all-checkbox");if(r){const{total:a,selected:l}=this._visibleSelectionStats();r.checked=a>0&&l===a,r.indeterminate=l>0&&l<a}}scrollToRow(e){const t=this.shadowRoot;if(!t)return;const i=t.querySelectorAll("tbody tr:not(.subtable):not(.empty):not(.skeleton)")[e];i&&i.scrollIntoView({block:"nearest",inline:"nearest"})}connectedCallback(){super.connectedCallback(),this._schedulePaint()}disconnectedCallback(){this._resizeObserver?.disconnect(),this._resizeObserver=null,this._stickyRafHandle!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this._stickyRafHandle),this._stickyRafHandle=null)}recomputeLayout(){this._applyStickyOffsets(),this._measureHeaderHeight()}render(){return c`
1441 <div class="scroll" part="scroll">
1442 <table part="table">
1443 <colgroup></colgroup>
1444 <thead></thead>
1445 <tbody></tbody>
1446 </table>
1447 </div>
1448 `}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){const e=this.shadowRoot;if(!e)return;e.querySelector("tbody")||Ee(this.render(),e);const t=e.querySelector("colgroup"),o=e.querySelector("thead"),i=e.querySelector("tbody");if(!t||!o||!i)return;const n=this._effectiveColumns();this._stacked=this.hasAttribute("stacked");const r=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,r),this._paintColgroup(t,n),this._paintHead(o,n,r),this._paintBody(i,n,r),this._applyStickyOffsets(),this._measureHeaderHeight(),this._scheduleStickyOffsets(),this._maybeWarnStickyHeader(),this._maybeWarnLoadingDesync(i),this._ensureResizeObserver()}_maybeWarnLoadingDesync(e){this._loadingDesyncWarned||this.hasAttribute("loading")&&(e.querySelector("tr.skeleton")||(this._loadingDesyncWarned=!0,console.warn("[os-table] `loading` attribute is set but no skeleton rows rendered. Either attributeChangedCallback didn't route through requestUpdate (framework regression), or `loading` was set after the most recent paint and no follow-up trigger ran. Toggling `data` will force a paint as a workaround.")))}_scheduleStickyOffsets(){this._stickyMicroScheduled||(this._stickyMicroScheduled=!0,queueMicrotask(()=>{this._stickyMicroScheduled=!1,this.isConnected&&this._applyStickyOffsets()})),this._stickyRafHandle===null&&typeof requestAnimationFrame<"u"&&(this._stickyRafHandle=requestAnimationFrame(()=>{this._stickyRafHandle=null,this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight())}))}_ensureResizeObserver(){if(this._resizeObserver||typeof ResizeObserver>"u")return;const e=this.shadowRoot?.querySelector(".scroll");e&&(this._resizeObserver=new ResizeObserver(()=>{this.isConnected&&(this._applyStickyOffsets(),this._measureHeaderHeight(),this._stickyHeaderWarned=!1,this._maybeWarnStickyHeader())}),this._resizeObserver.observe(e),this._resizeObserver.observe(this))}_paintColgroup(e,t){const o=[];for(const i of t){const n=document.createElement("col");i.width&&(n.style.width=i.width),o.push(n)}e.replaceChildren(...o)}_paintHead(e,t,o){const i=document.createElement("tr");i.setAttribute("part","header-row");for(let l=0;l<t.length;l++)i.appendChild(this._buildHeaderCell(t[l],l,o));const n=e.querySelector(':scope > tr[part="header-row"]');n?e.replaceChild(i,n):e.insertBefore(i,e.firstChild);const r=t.some(l=>l.filter||Array.isArray(l.filterOptions)||typeof l.filterRender=="function");let a=e.querySelector(":scope > tr.filter-row");if(r){const l=[];for(let p=0;p<t.length;p++)l.push(this._buildFilterCell(t[p],p,o));a||(a=document.createElement("tr"),a.classList.add("filter-row"),a.setAttribute("part","filter-row"),e.appendChild(a));const u=Array.from(a.children);let h=u.length===l.length;if(h){for(let p=0;p<l.length;p++)if(u[p]!==l[p]){h=!1;break}}if(!h){const p=new Set(l);for(const g of l)a.appendChild(g);for(const g of Array.from(a.children))p.has(g)||a.removeChild(g)}}else a&&a.remove()}_buildHeaderCell(e,t,o){const i=document.createElement("th");if(i.setAttribute("scope","col"),i.dataset.key=e.key,this._applyCellClasses(i,e,t,o),e.minWidth&&(i.style.minWidth=e.minWidth),e.key===Ce){if(this._readSelectable()==="multi"){const r=document.createElement("input");r.type="checkbox",r.className="select-all-checkbox",r.setAttribute("data-noclick",""),r.setAttribute("aria-label","Select all rows");const{total:a,selected:l}=this._visibleSelectionStats();r.checked=a>0&&l===a,r.indeterminate=l>0&&l<a,r.addEventListener("change",()=>{r.checked?this.selectAll():this.clearSelection()}),i.appendChild(r)}return i}if(i.textContent=e.label??(e.key===Se?"":e.key),e.sortable){i.classList.add("is-sortable");const n=this._sort?.key===e.key,r=document.createElement("span");r.className="sort-indicator";let a="";n&&(a=this._sort.direction==="asc"?" ▲":" ▼"),r.textContent=a,i.appendChild(r),n&&i.classList.add(this._sort.direction==="asc"?"sort-asc":"sort-desc"),i.addEventListener("click",()=>this._cycleSort(e.key))}return i}_buildFilterCell(e,t,o){const i=this._filterCache.get(e.key),n=Array.isArray(e.filterOptions),r=typeof e.filterRender=="function";let a;if(!e.filter&&!n&&!r||e.key===Se||e.key===Ce?a="none":r?a="custom":e.filter==="select"||n?a="select":a="text",i&&i.kind===a){if(i.th.className="",this._applyCellClasses(i.th,e,t,o),a==="select"){const p=i.control,g=this._resolveFilterOptions(e),b=g.map(m=>m.value).join("|");b!==i.optionsKey?(this._populateSelect(p,g,this._filters[e.key]??""),i.optionsKey=b):p.value=this._filters[e.key]??""}else if(a==="text"){const p=i.control,g=this._filters[e.key]??"";p.value!==g&&p.ownerDocument.activeElement!==p&&(p.value=g)}else a==="custom"&&e.filterRender&&e.filterRender(i.th,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e});return i.th}const l=document.createElement("th");if(this._applyCellClasses(l,e,t,o),a==="none")return this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"none"}),l;if(a==="custom"&&e.filterRender)return e.filterRender(l,{value:this._filters[e.key]??"",setValue:p=>this._onFilterChange(e.key,p),col:e}),this._filterCache.set(e.key,{th:l,control:null,optionsKey:"",kind:"custom"}),l;let u,h="";if(a==="select"){const p=document.createElement("select");p.classList.add("filter-select"),p.setAttribute("data-noclick",""),p.setAttribute("aria-label",`Filter ${e.label??e.key}`);const g=this._resolveFilterOptions(e);this._populateSelect(p,g,this._filters[e.key]??""),h=g.map(b=>b.value).join("|"),p.addEventListener("change",()=>{this._onFilterChange(e.key,p.value)}),u=p}else{const p=document.createElement("input");p.type="search",p.classList.add("filter-input"),p.setAttribute("data-noclick",""),p.setAttribute("placeholder","Filter…"),p.setAttribute("aria-label",`Filter ${e.label??e.key}`),p.value=this._filters[e.key]??"",p.addEventListener("input",()=>{this._onFilterChange(e.key,p.value)}),u=p}return l.appendChild(u),this._filterCache.set(e.key,{th:l,control:u,optionsKey:h,kind:a}),l}_populateSelect(e,t,o){e.replaceChildren();const i=document.createElement("option");i.value="",i.textContent="All",e.appendChild(i);for(const n of t){const r=document.createElement("option");r.value=n.value,r.textContent=n.label,n.value===o&&(r.selected=!0),e.appendChild(r)}e.value=o}_resolveFilterOptions(e){return Array.isArray(e.filterOptions)?e.filterOptions:this._uniqueValues(e.key).map(t=>({value:t,label:t}))}_paintBody(e,t,o){if(e.replaceChildren(),this.hasAttribute("loading")){const n=this._readLoadingRows();for(let r=0;r<n;r++)e.appendChild(this._buildSkeletonRow(t,r));return}const i=this._sortedRows(this._filteredRows());if(i.length===0){e.appendChild(this._buildEmptyRow(t.length));return}for(const{row:n,index:r}of i)if(e.appendChild(this._stacked?this._buildStackedRow(n,r,t):this._buildBodyRow(n,r,t,o)),this._expanded.has(r)&&this._subTable){const a=this._subTable(n,r);a&&e.appendChild(this._buildSubTableRow(a,t.length))}}_buildEmptyRow(e){const t=document.createElement("tr");t.classList.add("empty");const o=document.createElement("td");o.colSpan=e;const i=document.createElement("slot");return i.name="empty",i.textContent=this.getAttribute("empty")||"No data",o.appendChild(i),t.appendChild(o),t}_buildSkeletonRow(e,t){const o=document.createElement("tr");if(o.classList.add("skeleton"),o.setAttribute("aria-hidden","true"),this._stacked){o.classList.add("stack-row");const i=document.createElement("td");i.className="stack-body",i.colSpan=Math.max(1,e.length);for(const n of[55+t*7%25,30+t*11%15]){const r=document.createElement("span");r.className="skeleton-bar",r.style.width=`${n}%`,i.appendChild(r)}return o.appendChild(i),o}for(const i of e){const n=document.createElement("td"),r=document.createElement("span");r.className="skeleton-bar";const a=50+(t*7+o.children.length*13)%40;r.style.width=`${a}%`,n.appendChild(r),o.appendChild(n)}return o}_buildBodyRow(e,t,o,i){const n=document.createElement("tr");n.setAttribute("part","row"),n.dataset.rowIndex=String(t);const r=this._getRowId(e,t);n.dataset.rowId=String(r),this._selection.has(r)&&n.classList.add("is-selected"),n.addEventListener("click",a=>{this._onRowClick(e,t,a)});for(let a=0;a<o.length;a++)n.appendChild(this._buildBodyCell(o[a],a,e,t,i));return n}_buildStackedRow(e,t,o){const i=document.createElement("tr");i.setAttribute("part","row"),i.classList.add("stack-row"),i.dataset.rowIndex=String(t);const n=this._getRowId(e,t);i.dataset.rowId=String(n),this._selection.has(n)&&i.classList.add("is-selected"),i.addEventListener("click",u=>{this._onRowClick(e,t,u)});const r=document.createElement("td");r.className="stack-body";let a=0,l=0;for(let u=0;u<o.length;u++){const h=o[u];if(h.key===Ce||h.key===Se){i.appendChild(this._buildBodyCell(h,u,e,t,0));continue}l++;const p=ep(h,a++);if(p==="hidden")continue;const g=document.createElement("div");if(g.className=`stack-cell stack-${p}`,g.dataset.key=h.key,p==="meta"&&h.label){const y=document.createElement("span");y.className="stack-label",y.textContent=h.label,g.appendChild(y)}const b=document.createElement("span");b.className="stack-value";const m=e[h.key],x=Ts(m);h.render?this._mountCellContent(b,h.render(m,e,t)):x!==null?b.appendChild(this._slotFor(x)):m!=null&&(b.textContent=String(m)),g.appendChild(b),r.appendChild(g)}return r.colSpan=Math.max(1,l),i.appendChild(r),i}_buildBodyCell(e,t,o,i,n){const r=document.createElement("td");if(this._applyCellClasses(r,e,t,n),e.minWidth&&(r.style.minWidth=e.minWidth),e.key===Ce){const u=this._getRowId(o,i),h=document.createElement("input");return h.type="checkbox",h.className="select-row-checkbox",h.setAttribute("data-noclick",""),h.setAttribute("aria-label","Select row"),h.checked=this._selection.has(u),h.addEventListener("change",()=>{h.checked?this.select(u):this.deselect(u)}),r.appendChild(h),this._stacked&&(r.setAttribute("data-noclick",""),r.addEventListener("click",p=>{p.target===r&&(h.checked=!h.checked,h.dispatchEvent(new Event("change")))})),r}if(e.key===Se){if(!(this._subTable?!!this._subTable(o,i):!1))return r;const h=this._expanded.has(i),p=document.createElement("button");return p.type="button",p.className="expander",p.setAttribute("data-noclick",""),p.setAttribute("aria-expanded",h?"true":"false"),p.setAttribute("aria-label",h?"Collapse row":"Expand row"),p.textContent=h?"▾":"▸",p.addEventListener("click",g=>{this._toggleRow(i,o,g)}),r.appendChild(p),r}const a=o[e.key],l=Ts(a);if(e.render){const u=e.render(a,o,i);this._mountCellContent(r,u)}else l!==null?r.appendChild(this._slotFor(l)):a!=null&&(r.textContent=String(a));return r}_slotFor(e){const t=document.createElement("slot");return t.name=e,t}_buildSubTableRow(e,t){const o=document.createElement("tr");o.classList.add("subtable"),o.setAttribute("part","subtable-row");const i=document.createElement("td");i.colSpan=t;const n=document.createElement("div");if(n.classList.add("subtable-inner"),e instanceof Node)n.appendChild(e);else if(_a(e))Ee(e,n);else{const r=document.createElement("os-table");r.columns=e.columns,r.data=e.data,e.subTable&&(r.subTable=e.subTable),n.appendChild(r)}return i.appendChild(n),o.appendChild(i),o}_mountCellContent(e,t){if(typeof t=="string"){e.textContent=t;return}if(t instanceof Node){e.appendChild(t);return}_a(t)&&Ee(t,e)}_onFilterChange(e,t){t===""?delete this._filters[e]:this._filters[e]=t,this.emit("os-table-filter-change",{filters:{...this._filters}});const i=this.shadowRoot?.querySelector("tbody");if(i){const n=this._effectiveColumns(),r=this._readStickyColumns();this._lastStickyIndex=this._computeLastStickyIndex(n,r),this._paintBody(i,n,r),this._applyStickyOffsets()}}_onRowClick(e,t,o){const i=o.composedPath?.()??[];for(const n of i){if(n instanceof Element&&n.hasAttribute("data-noclick"))return;if(n===this)break}this.emit("os-table-row-click",{row:e,index:t,originalEvent:o})}_toggleRow(e,t,o){o.stopPropagation();const i=this._expanded.has(e);i?this._expanded.delete(e):this._expanded.add(e),this.emit("os-table-expand-change",{row:t,index:e,expanded:!i}),this._schedulePaint()}_cycleSort(e){!this._sort||this._sort.key!==e?this._sort={key:e,direction:"asc"}:this._sort.direction==="asc"?this._sort={key:e,direction:"desc"}:this._sort=null,this.emit("os-table-sort-change",{sort:this._sort?{...this._sort}:null}),this._schedulePaint()}_emitSelectionChange(){this.emit("os-table-selection-change",{selection:Array.from(this._selection),rows:this.selectedRows})}_filteredRows(){const e=[],t=Object.keys(this._filters).filter(o=>this._filters[o]!=="");for(let o=0;o<this._data.length;o++){const i=this._data[o];let n=!0;for(const r of t){const a=this._columns.find(p=>p.key===r);if(a&&typeof a.filterRender=="function")continue;const l=this._filters[r]??"",u=i[r],h=Ci(u);if(a?.filter==="select"){if(h!==l){n=!1;break}}else if(!h.toLowerCase().includes(l.toLowerCase())){n=!1;break}}n&&e.push({row:i,index:o})}return e}_sortedRows(e){if(!this._sort)return e;const t=this._columns.find(n=>n.key===this._sort.key);if(!t)return e;const o=this._sort.direction==="desc"?-1:1,i=e.slice();return i.sort((n,r)=>{const a=n.row[t.key],l=r.row[t.key],u=t.sortValue?t.sortValue(n.row,a):wa(a),h=t.sortValue?t.sortValue(r.row,l):wa(l);return tp(u,h)*o}),i}_uniqueValues(e){const t=new Set;for(const o of this._data){const i=o[e];i!=null&&t.add(Ci(i))}return Array.from(t).sort()}_visibleSelectionStats(){let e=0,t=0;for(const{row:o,index:i}of this._filteredRows())e++,this._selection.has(this._getRowId(o,i))&&t++;return{total:e,selected:t}}_readStickyColumns(){const e=parseInt(this.getAttribute("sticky-columns")||"0",10);return Number.isFinite(e)&&e>0?e:0}_readLoadingRows(){const e=parseInt(this.getAttribute("loading-rows")||"5",10);return Number.isFinite(e)&&e>0?Math.min(e,100):5}_readSelectable(){const e=this.getAttribute("selectable");return e==="single"?"single":e==="multi"||e===""?"multi":null}_isStickyIndex(e,t,o){return this._stacked||o.sticky===!1?!1:o.sticky===!0?!0:e<t}_computeLastStickyIndex(e,t){let o=-1;for(let i=0;i<e.length;i++)this._isStickyIndex(i,t,e[i])&&(o=i);return o}_applyCellClasses(e,t,o,i){t.key===Se&&e.classList.add("col-expander"),t.key===Ce&&e.classList.add("col-select"),t.align==="center"&&e.classList.add("align-center"),t.align==="end"&&e.classList.add("align-end"),this._isStickyIndex(o,i,t)&&(e.classList.add("is-sticky"),o===this._lastStickyIndex&&e.classList.add("is-sticky-edge"))}_effectiveColumns(){const e=[];return this._readSelectable()&&e.push({key:Ce,label:"",width:"40px",align:"center"}),this._subTable&&e.push({key:Se,label:"",width:"36px",align:"center"}),e.push(...this._columns),e}_applyStickyOffsets(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const o=Array.from(t.children),i=[];let n=0;for(let a=0;a<o.length;a++)i[a]=n,o[a].classList.contains("is-sticky")&&(n+=o[a].offsetWidth);e.querySelectorAll("thead tr, tbody tr:not(.subtable):not(.empty):not(.skeleton)").forEach(a=>{const l=Array.from(a.children);for(let u=0;u<l.length;u++)l[u].classList.contains("is-sticky")&&(l[u].style.insetInlineStart=`${i[u]}px`)}),this._maybeWarnStickyOffsetRace(o,i)}_maybeWarnStickyOffsetRace(e,t){if(this._stickyRaceWarned)return;const o=this._readStickyColumns();if(o<2)return;const i=Math.min(o-1,e.length-1);if(i<=0||t[i]!==0||this.offsetWidth===0)return;this._stickyRaceWarned=!0;const n=e[0]?.offsetWidth??0;console.warn(`[os-table] sticky-columns: column ${i} resolved to inset-inline-start: 0px while the host is visible. ths[0].offsetWidth was ${n}px at measurement time. Likely a layout race — call recomputeLayout() after the panel finishes its mount/transition, or wrap the assignment of \`data\` in a requestAnimationFrame.`)}_measureHeaderHeight(){const e=this.shadowRoot;if(!e)return;const t=e.querySelector("thead tr");if(!t)return;const o=t.offsetHeight;o>0&&this.style.setProperty("--os-ui-table-header-height",`${o}px`)}_maybeWarnStickyHeader(){if(this._stickyHeaderWarned||!this.hasAttribute("sticky-header")||this.hasAttribute("loading")||this._data.length<8)return;const e=this.shadowRoot?.querySelector(".scroll");e&&e.offsetWidth!==0&&e.scrollHeight<=e.clientHeight+1&&(this._stickyHeaderWarned=!0,console.warn("[os-table] sticky-header is set but the table has no scroll container. Set --os-ui-table-max-height on the host (or wrap it in a scrolling parent) so the header has something to stick to."))}};jt.props=["stickyColumns","stickyHeader","striped","hover","compact","bordered","empty","loading","loadingRows","selectable","stacked"],jt.styles=[Qh],jt.help=void 0;let Si=jt;function _a(s){return!!s&&s.__wpdHtml===!0}function ep(s,e){return s.stack?s.stack:e===0?"title":s.label?"meta":"actions"}function Ts(s){return s&&typeof s=="object"&&typeof s.slot=="string"?s.slot:null}function Ci(s){if(s==null)return"";if(Ts(s)!==null){const e=s.text;return e==null?"":String(e)}return String(s)}function wa(s){return Ts(s)!==null?Ci(s):s}function tp(s,e){if(s===e)return 0;if(s==null)return-1;if(e==null)return 1;if(typeof s=="number"&&typeof e=="number")return s-e;if(s instanceof Date&&e instanceof Date)return s.getTime()-e.getTime();const t=Number(s),o=Number(e);return Number.isFinite(t)&&Number.isFinite(o)?t-o:String(s).localeCompare(String(e))}w("os-table",Si);const sp=v`:host{display:inline-block;--_color:var( --os-ui-spinner-color,var( --wp-admin-theme-color,#21759b ) );--_accent:var( --os-ui-spinner-accent,var( --os-ui-fg-on-accent,#fff ) );--_size:var( --os-ui-spinner-size,48px );width:var( --_size );height:var( --_size );color:var( --_color );vertical-align:middle;line-height:0}:host( [ hidden ] ){display:none}:host( [ preset='inline' ] ){--os-ui-spinner-color:currentColor;--os-ui-spinner-size:16px}.root,.root svg{display:block;width:100%;height:100%}.root svg .mark{fill:var( --_accent )}@keyframes os-spinner-spin{to{transform:rotate( 360deg )}}@keyframes os-spinner-scale{0%,100%{transform:scale( 1 )}50%{transform:scale( 1.045 )}}@keyframes os-spinner-opacity{0%,100%{opacity:1}50%{opacity:0.7}}@media ( prefers-reduced-motion:reduce ){.root svg [ style*='animation' ]{animation:none !important}}`,ya=Object.freeze({classic:{sp1:12,sp2:24,sp3:40,a1:28,a2:15,a3:8,gap:4,dir2:1,dir3:-1,pulse:"none",dots:0},comet:{sp1:8,sp2:14,sp3:26,a1:50,a2:28,a3:12,gap:3,dir2:1,dir3:1,pulse:"none",dots:5},orbit:{sp1:10,sp2:10,sp3:32,a1:50,a2:50,a3:8,gap:5,dir2:-1,dir3:-1,pulse:"opacity",dots:3},pulse:{sp1:6,sp2:18,sp3:30,a1:20,a2:12,a3:6,gap:4,dir2:1,dir3:-1,pulse:"both",dots:8},inline:{sp1:8,sp2:8,sp3:8,a1:25,a2:25,a3:25,gap:0,dir2:1,dir3:1,pulse:"none",dots:0}}),K=61.26,B=61.26,xa=58.453,op='<path d="m8.708 61.26c0 20.802 12.089 38.779 29.619 47.298l-25.069-68.686c-2.916 6.536-4.55 13.769-4.55 21.388z"/><path d="m96.74 58.608c0-6.495-2.333-10.993-4.334-14.494-2.664-4.329-5.161-7.995-5.161-12.324 0-4.831 3.664-9.328 8.825-9.328.233 0 .454.029.681.042-9.35-8.566-21.807-13.796-35.489-13.796-18.36 0-34.513 9.42-43.91 23.688 1.233.037 2.395.063 3.382.063 5.497 0 14.006-.667 14.006-.667 2.833-.167 3.167 3.994.337 4.329 0 0-2.847.335-6.015.501l19.138 56.925 11.501-34.493-8.188-22.434c-2.83-.166-5.511-.501-5.511-.501-2.832-.166-2.5-4.496.332-4.329 0 0 8.679.667 13.843.667 5.496 0 14.006-.667 14.006-.667 2.835-.167 3.168 3.994.337 4.329 0 0-2.853.335-6.015.501l18.992 56.494 5.242-17.517c2.272-7.269 4.001-12.49 4.001-16.989z"/><path d="m62.184 65.857-15.768 45.819c4.708 1.384 9.687 2.141 14.846 2.141 6.12 0 11.989-1.058 17.452-2.979-.141-.225-.269-.464-.374-.724z"/><path d="m107.376 36.046c.226 1.674.354 3.471.354 5.404 0 5.333-.996 11.328-3.996 18.824l-16.053 46.413c15.624-9.111 26.133-26.038 26.133-45.426.001-9.137-2.333-17.729-6.438-25.215z"/>',Kt=class Kt extends _{constructor(){super(...arguments),this._paintScheduled=!1}connectedCallback(){super.connectedCallback(),this._schedulePaint()}render(){return c`<div class="root" part="root"></div>`}requestUpdate(){super.requestUpdate(),this._schedulePaint()}_schedulePaint(){this._paintScheduled||!this.isConnected||(this._paintScheduled=!0,queueMicrotask(()=>{this._paintScheduled=!1,this.isConnected&&this._paint()}))}_paint(){this._syncCssVars();const e=this.shadowRoot?.querySelector(".root");e&&(e.innerHTML=this._buildSvg())}_syncCssVars(){const e=(t,o,i)=>{const n=this.getAttribute(t);n===null?this.style.removeProperty(o):this.style.setProperty(o,i?i(n):n)};e("color","--os-ui-spinner-color"),e("accent","--os-ui-spinner-accent"),e("size","--os-ui-spinner-size",t=>/^-?\d+(\.\d+)?$/.test(t.trim())?`${t}px`:t)}_effectiveConfig(){const e=this.getAttribute("preset")??"classic",t=ya[e]??ya.classic,o=(r,a)=>{const l=this.getAttribute(r);if(l===null)return a;const u=parseFloat(l);return Number.isFinite(u)?u:a},i=(r,a)=>{const l=this.getAttribute(r);if(l===null)return a;const u=l.toLowerCase();return u==="-1"||u==="ccw"||u==="reverse"?-1:1},n=()=>{const r=this.getAttribute("pulse");return r==="scale"||r==="opacity"||r==="both"||r==="none"?r:t.pulse};return{sp1:o("sp1",t.sp1),sp2:o("sp2",t.sp2),sp3:o("sp3",t.sp3),a1:o("a1",t.a1),a2:o("a2",t.a2),a3:o("a3",t.a3),gap:o("gap",t.gap),dir2:i("dir2",t.dir2),dir3:i("dir3",t.dir3),pulse:n(),dots:Math.max(0,Math.floor(o("dots",t.dots)))}}_buildInlineSvg(e){const t=ka(this.getAttribute("label")??"Loading"),o=9,i=(e.sp1/10).toFixed(2);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-label="${t}"><circle cx="12" cy="12" r="${o}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-opacity="0.22"/><circle cx="12" cy="12" r="${o}" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-dasharray="${Ds(o,e.a1)}" style="transform-origin:12px 12px;animation: os-spinner-spin ${i}s linear infinite"/></svg>`}_buildSvg(){const e=this._effectiveConfig();if(this.getAttribute("preset")==="inline")return this._buildInlineSvg(e);const t=ka(this.getAttribute("label")??"Loading"),o=e.gap*3+14,i=-o,n=122.52+o*2,r=xa+e.gap+2,a=r+e.gap+2,l=a+e.gap+1.5,u=`animation: os-spinner-spin ${(e.sp1/10).toFixed(2)}s linear infinite`,h=`animation: os-spinner-spin ${(e.sp2/10).toFixed(2)}s linear infinite${e.dir2<0?" reverse":""}`,p=`animation: os-spinner-spin ${(e.sp3/10).toFixed(2)}s linear infinite${e.dir3<0?" reverse":""}`,g=(e.sp1*1.8/10).toFixed(1),b=(e.sp1*2.3/10).toFixed(1);let m="";e.pulse==="scale"?m=`animation: os-spinner-scale ${g}s ease-in-out infinite`:e.pulse==="opacity"?m=`animation: os-spinner-opacity ${b}s ease-in-out infinite`:e.pulse==="both"&&(m=`animation: os-spinner-scale ${g}s ease-in-out infinite, os-spinner-opacity ${b}s ease-in-out infinite`);let x="";if(e.dots>0){const y=l+e.gap+1,k=2*Math.PI*y,f=1.6,A=(e.sp1*.65/10).toFixed(2);for(let $=0;$<e.dots;$++){const R=-($/e.dots)*k;x+=`<circle cx="${K}" cy="${B}" r="${y.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="${f}" stroke-dasharray="${f.toFixed(2)} ${(k-f).toFixed(2)}" stroke-dashoffset="${R.toFixed(2)}" stroke-linecap="round" stroke-opacity="0.65" style="transform-origin:${K}px ${B}px;animation: os-spinner-spin ${A}s linear infinite"/>`}}return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${i} ${i} ${n} ${n}" role="img" aria-label="${t}"><g style="transform-origin:${K}px ${B}px${m?";"+m:""}"><circle cx="${K}" cy="${B}" r="${xa}" fill="currentColor"/><g class="mark">${op}</g></g><circle cx="${K}" cy="${B}" r="${r.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.6" stroke-opacity="0.2"/><circle cx="${K}" cy="${B}" r="${r.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="2.2" stroke-dasharray="${Ds(r,e.a1)}" stroke-linecap="round" style="transform-origin:${K}px ${B}px;${u}"/><circle cx="${K}" cy="${B}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.5" stroke-opacity="0.15"/><circle cx="${K}" cy="${B}" r="${a.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.6" stroke-opacity="0.8" stroke-dasharray="${Ds(a,e.a2)}" stroke-linecap="round" style="transform-origin:${K}px ${B}px;${h}"/><circle cx="${K}" cy="${B}" r="${l.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="0.4" stroke-opacity="0.12"/><circle cx="${K}" cy="${B}" r="${l.toFixed(2)}" fill="none" stroke="currentColor" stroke-width="1.0" stroke-opacity="0.6" stroke-dasharray="${Ds(l,e.a3)}" stroke-linecap="round" style="transform-origin:${K}px ${B}px;${p}"/>`+x+"</svg>"}};Kt.props=["preset","size","color","accent","sp1","sp2","sp3","a1","a2","a3","gap","dir2","dir3","pulse","dots","label"],Kt.styles=[sp],Kt.help=void 0;let Ii=Kt;function Ds(s,e){const t=2*Math.PI*s,o=e/100*t,i=t-o;return`${o.toFixed(2)} ${i.toFixed(2)}`}function ka(s){return String(s).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}w("os-spinner",Ii);const ip=v`:host{display:inline;color:inherit;font:inherit}`,Ps=new Set;let Ue=null;const np=3e4;function rp(){Ue===null&&(Ue=window.setInterval(()=>{for(const s of Ps)s.tick()},np))}function ap(){Ue!==null&&Ps.size===0&&(window.clearInterval(Ue),Ue=null)}function lp(s){if(!s)return null;const e=t=>{const o=new Date(t);return Number.isNaN(o.getTime())?null:o};return cp(s)?e(s):e(s.replace(" ","T")+"Z")}function cp(s){const e=Math.max(s.indexOf("T"),s.indexOf(" ")),t=e===-1?"":s.slice(e+1);return/(?:[Zz]|[+-]\d{2}:?\d{2})$/.test(t)}let Ri=null,Li=null;function $a(){return typeof navigator<"u"&&navigator.language||"en"}function dp(){return Ri||(Ri=new Intl.RelativeTimeFormat($a(),{numeric:"auto"})),Ri}function Aa(){return Li||(Li=new Intl.RelativeTimeFormat($a(),{numeric:"always",style:"narrow"})),Li}function up(s,e){const t=dp(),o=s.getTime()-e,i=Math.round(o/1e3),n=Math.abs;return n(i)<45?t.format(0,"second"):Ea(t,i)}function Ea(s,e){const t=Math.abs,o=Math.round(e/60);if(t(o)<45)return s.format(o,"minute");const i=Math.round(o/60);if(t(i)<22)return s.format(i,"hour");const n=Math.round(i/24);if(t(n)<26)return s.format(n,"day");const r=Math.round(n/30);if(t(r)<11)return s.format(r,"month");const a=Math.round(n/365);return s.format(a,"year")}function hp(s,e){const t=Math.round((s.getTime()-e)/1e3),o=Math.abs;return o(t)<45?Aa().format(0,"second"):o(t)>604800?s.toLocaleDateString(void 0,{month:"short",day:"numeric"}):Ea(Aa(),t)}const Bt=class Bt extends _{connectedCallback(){super.connectedCallback(),Ps.add(this),rp()}disconnectedCallback(){Ps.delete(this),ap()}tick(){this.requestUpdate()}render(){const e=this.datetime,t=lp(e);if(!t)return c`<span>${e??""}</span>`;const o=Date.now(),i=this.hasAttribute("compact")?hp(t,o):up(t,o),n=t.toLocaleString();return c`<time datetime=${t.toISOString()} title=${n}
1449 >${i}</time
1450 >`}};Bt.props=["datetime","compact"],Bt.styles=[ip],Bt.help=void 0;let Ti=Bt;w("os-relative-time",Ti);const pp=v`:host{display:block;position:relative;color:var( --os-ui-fg,#1d2327 );font-family:var( --os-ui-font,-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif );font-size:12px}.head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-block-end:6px}:host(:not( [legend] ):not( [heading] ) ) .head{display:none}.heading{margin:0;font-size:13px;font-weight:600;color:var( --os-ui-fg,#1d2327 )}.heading[hidden]{display:none}.legend{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-inline-start:auto}:host(:not( [legend] ) ) .legend{display:none}.chip{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border:1px solid var( --os-ui-border,#dcdcde );border-radius:999px;background:transparent;color:var( --os-ui-fg-muted,#646970 );font:inherit;cursor:pointer;transition:opacity 0.12s ease,border-color 0.12s ease}.chip[aria-pressed='false']{opacity:0.45}.chip:hover{border-color:var( --os-ui-border-strong,#8c8f94 );color:var( --os-ui-fg,#1d2327 )}.chip:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:1px}.count{font-variant-numeric:tabular-nums;color:var( --os-ui-fg,#1d2327 )}.swatch{display:inline-block;width:10px;height:10px;border-radius:3px;flex:none}.swatch,.seg{background:var( --_tone );fill:var( --_tone )}[data-tone='danger']{--_tone:var( --os-ui-danger,#d63638 )}[data-tone='warning']{--_tone:var( --os-ui-warning,#dba617 )}[data-tone='info']{--_tone:var( --os-ui-info-fg,#72aee6 )}[data-tone='success']{--_tone:var( --os-ui-success,#00a32a )}[data-tone='accent']{--_tone:var( --os-ui-accent,#2271b1 )}[data-tone='neutral']{--_tone:var( --os-ui-fg-muted,#646970 )}.chart{position:relative}svg{display:block;inline-size:100%}.grid{stroke:var( --os-ui-border,#dcdcde );stroke-width:1}.tick{fill:var( --os-ui-fg-muted,#646970 );font-size:10px;font-variant-numeric:tabular-nums}.hit{fill:transparent;cursor:crosshair}.hover{fill:var( --os-ui-surface-raised,rgba( 0,0,0,0.04 ) );pointer-events:none}.empty{padding:40px 0;text-align:center;font-size:13px;color:var( --os-ui-fg-muted,#646970 )}.tooltip{position:absolute;inset-block-start:4px;transform:translateX( -50% );min-inline-size:150px;padding:8px 10px;border-radius:6px;border:1px solid var( --os-ui-border,#dcdcde );background:var( --os-ui-surface-elevated,#fff );box-shadow:var( --os-ui-shadow,0 2px 8px rgba( 0,0,0,0.15 ) );pointer-events:none;z-index:2}.tooltip[hidden]{display:none}.tooltip-head{margin-block-end:6px;color:var( --os-ui-fg-muted,#646970 );font-size:11px}.tooltip-row{display:flex;align-items:center;gap:6px;line-height:1.6}.tooltip-label{flex:1}.tooltip-value{font-variant-numeric:tabular-nums;font-weight:600}`,gp="http://www.w3.org/2000/svg",qe=8,fp=20,Y=8,bp=40,mp=24,Di=2,vp=150,_p=new Set(["danger","warning","info","success","accent","neutral"]);function Sa(s,e){if(!s)return e;try{return JSON.parse(s)}catch{return e}}function wp(s){if(s<=5)return Math.max(1,s);const e=Math.pow(10,Math.floor(Math.log10(s)));for(const t of[1,2,5,10])if(t*e>=s)return t*e;return 10*e}function he(s,e){const t=document.createElementNS(gp,s);for(const[o,i]of Object.entries(e))t.setAttribute(o,i);return t}function yp(s,e,t,o){const i=Math.min(3,o/2,t/2);return`M ${s} ${e+o} L ${s} ${e+i} Q ${s} ${e} ${s+i} ${e} L ${s+t-i} ${e} Q ${s+t} ${e} ${s+t} ${e+i} L ${s+t} ${e+o} Z`}const Gt=class Gt extends _{constructor(){super(...arguments),this._resize=null,this._tooltip=null}connectedCallback(){super.connectedCallback(),typeof ResizeObserver<"u"&&(this._resize=new ResizeObserver(()=>this.paint()),this._resize.observe(this))}disconnectedCallback(){this._resize?.disconnect(),this._resize=null}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this.paint())}get seriesList(){const e=Sa(this.getAttribute("series"),[]);return Array.isArray(e)?e.filter(t=>!!t&&typeof t=="object"&&typeof t.key=="string").map(t=>({key:t.key,label:typeof t.label=="string"?t.label:t.key,tone:t.tone&&_p.has(t.tone)?t.tone:"neutral"})):[]}get columnList(){const e=Sa(this.getAttribute("columns"),[]);return Array.isArray(e)?e.map(t=>Array.isArray(t)?t.map(o=>Number.isFinite(Number(o))?Math.max(0,Number(o)):0):[]):[]}get hiddenSet(){return new Set((this.getAttribute("hidden-series")??"").split(",").map(e=>e.trim()).filter(e=>e!==""))}totals(){const e=this.seriesList,t=e.map(()=>0);for(const o of this.columnList)e.forEach((i,n)=>{t[n]+=o[n]??0});return t}toggleSeries(e){const t=this.hiddenSet;t.has(e)?t.delete(e):t.add(e);const o=Array.from(t);o.length>0?this.setAttribute("hidden-series",o.join(",")):this.removeAttribute("hidden-series"),this.emit("os-series-toggle",{key:e,hidden:o})}render(){const e=this.seriesList,t=this.totals(),o=this.hiddenSet,i=this.getAttribute("heading")??"";return c`
1451 <div class="head" part="head">
1452 <h2 class="heading" part="heading" ?hidden=${i===""}>${i}</h2>
1453 <div class="legend" part="legend" role="group">
1454 ${e.map((n,r)=>c`
1455 <button
1456 type="button"
1457 class="chip"
1458 data-tone=${n.tone??"neutral"}
1459 aria-pressed=${o.has(n.key)?"false":"true"}
1460 @click=${()=>this.toggleSeries(n.key)}
1461 >
1462 <span class="swatch"></span>
1463 <span class="label">${n.label}</span>
1464 <span class="count">${t[r].toLocaleString()}</span>
1465 </button>
1466 `)}
1467 </div>
1468 </div>
1469 <div class="chart" part="chart"></div>
1470 <div class="tooltip" part="tooltip" hidden></div>
1471 `}paint(){const e=this.shadowRoot,t=e?.querySelector(".chart"),o=e?.querySelector(".tooltip");if(!t||!o)return;this._tooltip=o,o.hidden=!0,t.textContent="";const i=this.columnList,n=i.some(D=>D.some(z=>z>0));if(i.length===0||!n){const D=document.createElement("div");D.className="empty",D.textContent=this.getAttribute("empty")??"",t.appendChild(D);return}const r=this.seriesList,a=this.hiddenSet,l=r.map((D,z)=>a.has(D.key)?-1:z).filter(D=>D>=0),u=parseInt(this.getAttribute("height")??"",10),h=Number.isFinite(u)&&u>40?u:vp,p=Math.max(280,this.clientWidth||640),g=p-Y-bp,b=h-qe-fp,m=i.length,x=g/m,y=Math.max(2,Math.min(mp,x-Di)),k=i.reduce((D,z)=>{const te=l.reduce((se,Us)=>se+(z[Us]??0),0);return Math.max(D,te)},0),f=wp(k),A=b/f,$=he("svg",{width:String(p),height:String(h),viewBox:`0 0 ${p} ${h}`,role:"img"});for(const D of[0,.5,1]){const z=f*D,te=qe+b-z*A;$.appendChild(he("line",{class:"grid",x1:String(Y),y1:String(te),x2:String(Y+g),y2:String(te)}));const se=he("text",{class:"tick",x:String(Y+g+6),y:String(te+3.5)});se.textContent=Number.isInteger(z)?z.toLocaleString():String(z),$.appendChild(se)}const R=Number(this.getAttribute("start"))||0,I=Number(this.getAttribute("end"))||R+m,O=Math.max(1,(I-R)/m),H=I-R>36*3600,X=D=>new Date(D*1e3).toLocaleString([],H?{month:"short",day:"numeric"}:{hour:"2-digit",minute:"2-digit"}),ye=D=>new Date(D*1e3).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),af=[[R,Y,"start"],[R+(I-R)/2,Y+g/2,"middle"],[I,Y+g,"end"]];for(const[D,z,te]of af){const se=he("text",{class:"tick",x:String(z),y:String(h-5),"text-anchor":te});se.textContent=X(D),$.appendChild(se)}const Hs=he("rect",{class:"hover",y:String(qe),width:String(x),height:String(b),visibility:"hidden"});$.appendChild(Hs),i.forEach((D,z)=>{const te=Y+z*x+(x-y)/2;let se=qe+b;const Us=l.filter(ps=>(D[ps]??0)>0),lf=Us[Us.length-1];for(const ps of l){const nl=D[ps]??0;if(nl===0)continue;const rl=r[ps].tone??"neutral",rn=nl*A,an=se-rn;ps===lf?$.appendChild(he("path",{class:"seg","data-tone":rl,d:yp(te,an,y,Math.max(1.5,rn))})):$.appendChild(he("rect",{class:"seg","data-tone":rl,x:String(te),y:String(an+Di),width:String(y),height:String(Math.max(1.5,rn-Di))})),se=an}const nn=he("rect",{class:"hit",x:String(Y+z*x),y:String(qe),width:String(x),height:String(b)});nn.addEventListener("pointerenter",()=>{Hs.setAttribute("x",String(Y+z*x)),Hs.setAttribute("visibility","visible"),this.showTooltip(z,D,x,p,{head:`${ye(R+z*O)} – ${X(R+(z+1)*O)}`,series:r,visibleIndexes:l})}),nn.addEventListener("pointerleave",()=>{Hs.setAttribute("visibility","hidden"),o.hidden=!0}),$.appendChild(nn)}),t.appendChild($)}showTooltip(e,t,o,i,n){const r=this._tooltip;if(!r)return;r.textContent="";const a=document.createElement("div");a.className="tooltip-head",a.textContent=n.head,r.appendChild(a);let l=0;for(const h of[...n.visibleIndexes].reverse()){const p=t[h]??0;if(p===0)continue;l++;const g=document.createElement("div");g.className="tooltip-row";const b=document.createElement("span");b.className="swatch",b.dataset.tone=n.series[h].tone??"neutral";const m=document.createElement("span");m.className="tooltip-label",m.textContent=n.series[h].label;const x=document.createElement("span");x.className="tooltip-value",x.textContent=p.toLocaleString(),g.append(b,m,x),r.appendChild(g)}if(l===0){const h=document.createElement("div");h.className="tooltip-row",h.textContent="—",r.appendChild(h)}r.hidden=!1;const u=Y+e*o+o/2;r.style.left=`${Math.max(60,Math.min(u,i-60))}px`}};Gt.props=["heading","series","columns","start","end","hidden-series","legend","empty","height"],Gt.styles=[pp],Gt.help=void 0;let Pi=Gt;w("os-histogram",Pi);const xp=v`:host{--_gap-row:var( --os-ui-facts-row-gap,6px );--_gap-column:var( --os-ui-facts-column-gap,14px );display:block;font-size:var( --os-ui-facts-font-size,13px );min-inline-size:0}:host( [ hidden ] ){display:none}dl{display:grid;grid-template-columns:max-content minmax( 0,1fr );gap:var( --_gap-row ) var( --_gap-column );align-items:var( --os-ui-facts-align,baseline );margin:0}:host( [ layout='between' ] ) dl{display:block}:host( [ layout='between' ] )::slotted( os-fact ){display:flex;justify-content:space-between;gap:var( --_gap-column );margin-block:var( --_gap-row )}:host( [ stacked ] ) dl{display:block}:host( [ stacked ] )::slotted( os-fact ){display:block;margin-block:var( --_gap-row )}`,kp=v`:host{display:contents}:host( [ hidden ] ){display:none}dt{color:var( --os-ui-facts-label-color,var( --os-ui-fg-muted,#646970 ) )}dd{margin:0;overflow-wrap:anywhere}::slotted( os-code ){--os-ui-code-bg:var( --os-ui-facts-code-bg,transparent );--os-ui-code-border:var( --os-ui-facts-code-border,none );--os-ui-code-padding:var( --os-ui-facts-code-padding,0 );--os-ui-code-font-size:var( --os-ui-facts-code-font-size,1em )}`,Xt=class Xt extends _{render(){const e=this.label||"";return c`
1472 <dt part="label"><slot name="label">${e}</slot></dt>
1473 <dd part="value"><slot></slot></dd>
1474 `}};Xt.props=["label"],Xt.styles=[kp],Xt.help=void 0;let Ni=Xt;w("os-fact",Ni);const Zt=class Zt extends _{render(){return c`<dl part="list"><slot></slot></dl>`}};Zt.props=["layout"],Zt.styles=[xp],Zt.help={title:"Facts",summary:'Label/value list — a real <dl> whose rows are <os-fact> children. Labels sit in a content-sized column beside their values; `layout="between"` spreads each pair across its own line and `stacked` puts the label above the value.',status:"stable",props:[{name:"layout",type:"'columns' | 'between'",description:"`columns` (default) aligns every value in one column. `between` gives each pair its own line with the value pushed to the far edge."},{name:"stacked",type:"boolean",description:"Label above the value rather than beside it, for a narrow pane."}],slots:[{name:"(default)",description:"<os-fact> children."}],cssProps:[{name:"--os-ui-facts-font-size",default:"13px"},{name:"--os-ui-facts-row-gap",default:"6px"},{name:"--os-ui-facts-column-gap",default:"14px"},{name:"--os-ui-facts-label-color",default:"var(--os-ui-fg-muted, #646970)"},{name:"--os-ui-facts-align",default:"baseline"}],example:c`
1475 <os-facts>
1476 <os-fact label="File">class-foo.php</os-fact>
1477 <os-fact label="Source">Plugin: Akismet</os-fact>
1478 <os-fact label="Occurrences">1,204</os-fact>
1479 </os-facts>
1480 `};let Mi=Zt;w("os-facts",Mi);const $p=v`:host{--_border:var( --os-ui-stat-border,var( --os-ui-border,#dcdcde ) );--_bg:var( --os-ui-stat-bg,transparent );--_value-color:var( --os-ui-stat-value-color,var( --wp-admin-theme-color,#2271b1 ) );--_value-size:var( --os-ui-stat-value-size,20px );--_label-color:var( --os-ui-stat-label-color,var( --os-ui-fg-muted,#646970 ) );display:flex;flex-direction:column;gap:2px;padding:var( --os-ui-stat-padding,10px 12px );border:1px solid var( --_border );border-radius:var( --os-ui-stat-radius,8px );background:var( --_bg );min-inline-size:0}:host( [ hidden ] ){display:none}.value{font-size:var( --_value-size );font-weight:700;line-height:1.1;color:var( --_value-color );font-variant-numeric:tabular-nums}.label{display:inline-flex;align-items:center;gap:6px;font-size:11px;letter-spacing:0.05em;text-transform:uppercase;color:var( --_label-color )}.caption{font-size:11px;color:var( --_label-color )}.swatch{display:inline-block;inline-size:10px;block-size:10px;border-radius:3px;flex:none;background:var( --os-app-tone,var( --os-ui-fg-muted,#646970 ) )}`,Yt=class Yt extends _{render(){const e=this,t=e.caption||"";return c`
1481 <span class="value" part="value">${e.value||""}</span>
1482 <span class="label" part="label">
1483 ${this.hasAttribute("swatch")?c`<i class="swatch" aria-hidden="true"></i>`:""}
1484 ${e.label||""}
1485 </span>
1486 ${t?c`<span class="caption" part="caption">${t}</span>`:""}
1487 `}};Yt.props=["value","label","caption","swatch"],Yt.styles=[$p],Yt.help=void 0;let zi=Yt;w("os-stat",zi);const Ap=v`:host{display:inline-flex;position:relative;width:var( --os-ui-avatar-size,32px );height:var( --os-ui-avatar-size,32px );flex:0 0 auto;vertical-align:middle;line-height:0;perspective:calc( var( --os-ui-avatar-size,32px ) * 8 );--os-ui-avatar-tilt-x:0deg;--os-ui-avatar-tilt-y:0deg;--os-ui-avatar-hover:0;--os-ui-avatar-glare-x:50%;--os-ui-avatar-glare-y:50%}:host( [ hidden ] ){display:none}.os-avatar__tile{position:relative;width:100%;height:100%;border-radius:50%;overflow:hidden;background:var( --os-window-bg,#f0f0f1 );color:var( --os-ui-fg-on-accent,#fff );display:flex;align-items:center;justify-content:center;font-weight:700;font-size:calc( var( --os-ui-avatar-size,32px ) * 0.48 );line-height:1;letter-spacing:0;font-feature-settings:'tnum' 1;user-select:none;transform-style:preserve-3d;transform:rotateX( var( --os-ui-avatar-tilt-x ) ) rotateY( var( --os-ui-avatar-tilt-y ) ) scale( calc( 1 + var( --os-ui-avatar-hover ) * 0.07 ) );transition:transform 220ms cubic-bezier( 0.2,0.8,0.2,1 ),box-shadow 220ms cubic-bezier( 0.2,0.8,0.2,1 );box-shadow:inset 0 0 0 1px rgba( 255,255,255,calc( 0.18 + 0.22 * var( --os-ui-avatar-hover ) ) ),inset 0 0 0 calc( 1px + var( --os-ui-avatar-hover ) * 1px ) rgba( 0,0,0,calc( 0.08 + 0.04 * var( --os-ui-avatar-hover ) ) ),0 calc( 1px + var( --os-ui-avatar-hover ) * 8px ) calc( 6px + var( --os-ui-avatar-hover ) * 18px ) rgba( 0,0,0,calc( 0.08 + 0.18 * var( --os-ui-avatar-hover ) ) )}.os-avatar__tile::after{content:'';position:absolute;inset:0;border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),var( --os-ui-scrim,rgba( 255,255,255,0.55 ) ) 0%,var( --os-ui-hover,rgba( 255,255,255,0 ) ) 55% );opacity:var( --os-ui-avatar-hover );mix-blend-mode:overlay;pointer-events:none;transition:opacity 220ms cubic-bezier( 0.2,0.8,0.2,1 )}.os-avatar__tile::before{content:'';position:absolute;inset:calc( var( --os-ui-avatar-hover ) * -3px );border-radius:50%;background:radial-gradient( circle at var( --os-ui-avatar-glare-x ) var( --os-ui-avatar-glare-y ),color-mix( in srgb,var( --os-ui-avatar-halo,rgb( 99,102,241 ) ) calc( 35% * var( --os-ui-avatar-hover ) ),transparent ) 0%,transparent 70% );filter:blur( 4px );pointer-events:none;z-index:-1;transition:inset 220ms cubic-bezier( 0.2,0.8,0.2,1 ),background 220ms}.os-avatar__tile img{width:calc( 100% + 2px );height:calc( 100% + 2px );margin:-1px;object-fit:cover;display:block;transform:translateZ( 1px )}.os-avatar__dot{position:absolute;bottom:0;inset-inline-end:0;width:calc( var( --os-ui-avatar-size,32px ) * 0.32 );height:calc( var( --os-ui-avatar-size,32px ) * 0.32 );min-width:8px;min-height:8px;border-radius:50%;box-sizing:border-box;border:2px solid var( --os-ui-avatar-dot-ring,var( --os-window-bg,#fff ) );background:var( --os-ui-avatar-dot-color,transparent );z-index:2}.os-avatar__dot--online{background:var( --os-ui-success-fg,#00a32a )}.os-avatar__dot--online::after{content:'';position:absolute;inset:-2px;border-radius:50%;border:1px solid var( --os-ui-success-fg,#00a32a );animation:os-avatar-presence 6s var( --os-ui-ease-out,cubic-bezier( 0.22,0.9,0.28,1 ) ) infinite;pointer-events:none}@keyframes os-avatar-presence{0%{opacity:0.6;transform:scale( 1 )}20%{opacity:0;transform:scale( 2.2 )}100%{opacity:0;transform:scale( 2.2 )}}.os-avatar__dot--inactive{background:var( --os-ui-warning-fg,#dba617 )}.os-avatar__dot--offline{background:var( --os-ui-fg-muted,#8c8f94 )}@media ( prefers-reduced-motion:reduce ){.os-avatar__dot--online::after{animation:none;opacity:0.6}.os-avatar__tile{transform:none;transition:box-shadow 200ms}.os-avatar__tile::after,.os-avatar__tile::before{display:none}}`,Ca={xs:20,sm:24,md:40,lg:64,xl:96},Ia=new Set(["online","inactive","offline"]),Jt=class Jt extends _{constructor(){super(...arguments),this._presenceHandler=null,this._imgFailed=!1,this._onPointerMove=null,this._onPointerEnter=null,this._onPointerLeave=null,this._tiltRaf=0,this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%"}connectedCallback(){super.connectedCallback(),this._maybeAttachPresenceListener(),this._attachHoverEffect()}disconnectedCallback(){this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null),this._detachHoverEffect()}attributeChangedCallback(e,t,o){super.attributeChangedCallback(e,t,o),e==="src"&&(this._imgFailed=!1),(e==="user-id"||e==="presence")&&this._maybeAttachPresenceListener()}render(){const e=this._attr("src"),t=this._attr("name")||"",o=this._attr("alt"),i=o!==null?o:t,n=this._attr("size"),r=this._resolveSize(n),a=this._presenceForRender(),l=this._attr("clickable")!==null;this.style.setProperty("--os-ui-avatar-size",`${r}px`);const u=e&&!this._imgFailed?"":this._initialsBg(t),h=e&&!this._imgFailed?c`<img
1488 src=${e}
1489 alt=${i}
1490 @error=${()=>this._onImgError()}
1491 loading="lazy"
1492 />`:this._initials(t),p=a?c`<span
1493 class=${`os-avatar__dot os-avatar__dot--${a}`}
1494 aria-label=${this._presenceLabel(a)}
1495 ></span>`:c``;return l?c`
1496 <button
1497 type="button"
1498 class="os-avatar__tile"
1499 aria-label=${i||"User"}
1500 style=${u?`background:${u};`:""}
1501 @click=${g=>this._onClick(g)}
1502 >${h}</button>
1503 ${p}
1504 `:c`
1505 <div
1506 class="os-avatar__tile"
1507 role="img"
1508 aria-label=${i||"User"}
1509 style=${u?`background:${u};`:""}
1510 >${h}</div>
1511 ${p}
1512 `}_attr(e){return this.getAttribute(e)}_resolveSize(e){if(!e)return 32;if(e in Ca)return Ca[e];const t=Number(e);return Number.isFinite(t)&&t>0?t:32}_initials(e){const t=e.trim();return t?Array.from(t)[0]?.toUpperCase()??"?":"?"}_initialsBg(e){const t=sr(e);return`linear-gradient(135deg, hsl(${t} 62% 55%), hsl(${(t+24)%360} 58% 42%))`}_presenceForRender(){const e=this._attr("presence");return e&&Ia.has(e)?e:null}_presenceLabel(e){switch(e){case"online":return"Online";case"inactive":return"Inactive";case"offline":return"Offline"}}_onImgError(){this._imgFailed=!0,this.requestUpdate()}_onClick(e){const t=this._attr("user-id"),o={userId:t!==null&&Number(t)||null,originalEvent:e};this.emit("os-avatar-click",o)}_attachHoverEffect(){typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches||(this._onPointerEnter=()=>{this.style.setProperty("--os-ui-avatar-hover","1")},this._onPointerLeave=()=>{this.style.setProperty("--os-ui-avatar-hover","0"),this._pendingTiltX="0deg",this._pendingTiltY="0deg",this._pendingGlareX="50%",this._pendingGlareY="50%",this._flushTilt()},this._onPointerMove=t=>{const o=this.getBoundingClientRect();if(o.width===0||o.height===0)return;const i=(t.clientX-o.left)/o.width-.5,n=(t.clientY-o.top)/o.height-.5,r=14;this._pendingTiltY=`${(i*r).toFixed(2)}deg`,this._pendingTiltX=`${(-n*r).toFixed(2)}deg`;const a=Math.max(0,Math.min(100,(i+.5)*100)),l=Math.max(0,Math.min(100,(n+.5)*100));this._pendingGlareX=`${a.toFixed(1)}%`,this._pendingGlareY=`${l.toFixed(1)}%`,this._tiltRaf||(this._tiltRaf=requestAnimationFrame(()=>this._flushTilt()))},this.addEventListener("pointerenter",this._onPointerEnter),this.addEventListener("pointerleave",this._onPointerLeave),this.addEventListener("pointermove",this._onPointerMove))}_flushTilt(){this._tiltRaf=0,this.style.setProperty("--os-ui-avatar-tilt-x",this._pendingTiltX),this.style.setProperty("--os-ui-avatar-tilt-y",this._pendingTiltY),this.style.setProperty("--os-ui-avatar-glare-x",this._pendingGlareX),this.style.setProperty("--os-ui-avatar-glare-y",this._pendingGlareY)}_detachHoverEffect(){this._onPointerMove&&(this.removeEventListener("pointermove",this._onPointerMove),this._onPointerMove=null),this._onPointerEnter&&(this.removeEventListener("pointerenter",this._onPointerEnter),this._onPointerEnter=null),this._onPointerLeave&&(this.removeEventListener("pointerleave",this._onPointerLeave),this._onPointerLeave=null),this._tiltRaf&&(cancelAnimationFrame(this._tiltRaf),this._tiltRaf=0)}_maybeAttachPresenceListener(){const e=this._attr("user-id"),t=this._attr("presence"),o=!!e&&!t;o&&!this._presenceHandler?(this._presenceHandler=i=>{const n=i.detail;n&&String(n.userId)===String(e)&&n.newStatus&&Ia.has(n.newStatus)&&this.setAttribute("presence",n.newStatus)},document.addEventListener("os-presence-changed",this._presenceHandler)):!o&&this._presenceHandler&&(document.removeEventListener("os-presence-changed",this._presenceHandler),this._presenceHandler=null)}};Jt.props=["src","alt","name","size","presence","userId","clickable"],Jt.styles=[Ap],Jt.help=void 0;let Oi=Jt;w("os-avatar",Oi);const Ep=v` ${C} ${_o}: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-textarea__label{font-size:12px;color:var( --os-ui-fg-muted,#646970 )}textarea{appearance:none;-webkit-appearance:none;display:block;width:100%;min-width:0;box-sizing:border-box;padding:8px 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 );line-height:1.45;color:var( --os-ui-fg,#1d2327 );resize:vertical}textarea:disabled{opacity:0.55;cursor:not-allowed;background:var( --os-ui-hover,rgba( 0,0,0,0.03 ) )}textarea[ aria-invalid='true' ],textarea[ aria-invalid='true' ]:hover:not(:disabled ){border-color:var( --os-ui-danger,#d63638 )}textarea[ aria-invalid='true' ]:focus,textarea[ 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 )}:host( [ auto-grow ] ) textarea{resize:none;overflow:hidden}`,Qt=class Qt extends _{constructor(){super(...arguments),this._textareaEl=null}connectedCallback(){super.connectedCallback(),He(this)}render(){const e=this._attr("label")||"",t=this._attr("value")??"",o=this._attr("placeholder")||"",i=this._boolAttr("disabled"),n=this._boolAttr("readonly"),r=this._attr("aria-label")||e,a=this._attr("name")||"",l=Number(this._attr("rows"))||3,u=this._attr("maxlength"),h=this._attr("minlength"),p=this._boolAttr("invalid"),b=`${this.id||"os-unnamed"}__field`;return c`
1513 ${e?c`<label class="os-textarea__label" for=${b}>${e}</label>`:c``}
1514 <textarea
1515 id=${b}
1516 part="textarea"
1517 .value=${t}
1518 placeholder=${o}
1519 ?disabled=${i}
1520 ?readonly=${n}
1521 rows=${l}
1522 maxlength=${u??""}
1523 minlength=${h??""}
1524 name=${a}
1525 aria-invalid=${p?"true":"false"}
1526 aria-label=${r||""}
1527 @input=${m=>this._onInput(m)}
1528 @change=${m=>this._onChange(m)}
1529 @keydown=${m=>this._onKeyDown(m)}
1530 ></textarea>
1531 `}_attr(e){return this.getAttribute(e)}_boolAttr(e){return this.getAttribute(e)!==null}_onInput(e){const t=e.target;this._textareaEl=t,this.setAttribute("value",t.value),this.emit("os-input-change",{value:t.value}),this._boolAttr("auto-grow")&&this._autosize(t)}_onChange(e){const t=e.target;this.emit("os-input-commit",{value:t.value})}_onKeyDown(e){if(!(!this._boolAttr("submit-on-enter")||e.isComposing||e.keyCode===229)&&e.key==="Enter"&&!e.shiftKey&&!e.altKey&&!e.metaKey&&!e.ctrlKey){e.preventDefault();const t=e.target;this.emit("os-submit",{value:t.value})}}_autosize(e){const t=Number(this._attr("max-rows"))||8,o=window.getComputedStyle(e),i=parseFloat(o.fontSize)||13,n=o.lineHeight,r=n==="normal"?i*1.45:parseFloat(n)||i*1.45,a=parseFloat(o.paddingTop)||0,l=parseFloat(o.paddingBottom)||0,u=(parseFloat(o.borderTopWidth)||0)+(parseFloat(o.borderBottomWidth)||0),h=r*t+a+l+u;e.style.height="auto",e.style.overflowY="hidden";const p=e.value?e.scrollHeight+u:r*(Number(this._attr("rows"))||3)+a+l+u,g=Math.min(p,h);e.style.height=`${Math.ceil(g)}px`,e.style.overflowY=p>Math.ceil(h)?"auto":"hidden"}refreshAutosize(){this._textareaEl&&this._boolAttr("auto-grow")&&this._autosize(this._textareaEl)}focusInput(){(this.shadowRoot??this).querySelector("textarea")?.focus()}clear(){this.setAttribute("value","");const t=(this.shadowRoot??this).querySelector("textarea");t&&(t.value="",this._boolAttr("auto-grow")&&this._autosize(t))}};Qt.props=["label","value","placeholder","disabled","readonly","ariaLabel","name","rows","maxlength","minlength","invalid","autoGrow","maxRows","submitOnEnter"],Qt.styles=[Ep],Qt.help=void 0;let Wi=Qt;w("os-textarea",Wi);const Sp=v` ${C}:host{display:inline-flex;max-width:100%;vertical-align:middle}:host( [ hidden ] ){display:none}.os-chip{display:inline-flex;align-items:center;gap:var( --os-ui-chip-gap,4px );padding:var( --os-ui-chip-padding,2px 8px );border-radius:var( --os-ui-chip-radius,999px );font-size:var( --os-ui-chip-font-size,12px );line-height:var( --os-ui-chip-line-height,1.6 );font-weight:var( --os-ui-chip-font-weight,500 );background:var( --os-ui-chip-bg,var( --os-ui-surface,#f0f0f1 ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) );border:var( --os-ui-chip-border,1px solid transparent );max-width:100%;box-sizing:border-box;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease,transform 0.12s ease,opacity 0.12s ease}:host( [ tone='accent' ] ) .os-chip{background:var( --os-ui-chip-bg,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 14%,transparent ) );color:var( --os-ui-chip-fg,var( --wp-admin-theme-color,#2271b1 ) )}:host( [ tone='positive' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 30,132,73,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ tone='warning' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 217,119,6,0.18 ) );color:var( --os-ui-chip-fg,var( --os-ui-warning-fg,#8a4a06 ) )}:host( [ tone='danger' ] ) .os-chip{background:var( --os-ui-chip-bg,rgba( 214,54,56,0.14 ) );color:var( --os-ui-chip-fg,var( --os-ui-danger-hover,#a02622 ) )}:host( [ pending ] ) .os-chip{opacity:0.65;animation:os-chip-pulse 1.2s ease-in-out infinite}@keyframes os-chip-pulse{0%,100%{opacity:0.55}50%{opacity:0.95}}.os-chip__label{max-width:var( --os-ui-chip-label-max,220px );overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-chip__icon{display:inline-flex;align-items:center;flex-shrink:0}.os-chip__icon::slotted( * ){display:inline-flex}.os-chip__dismiss{appearance:none;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:16px;height:16px;margin-inline-start:2px;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.55;transition:opacity 0.12s ease,background-color 0.12s ease}.os-chip__dismiss:hover,.os-chip__dismiss:focus-visible{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.12 ) );outline:none}.os-chip__dismiss:focus-visible{box-shadow:var( --_holo-focus )}.os-chip__dismiss[ disabled ]{opacity:0.35;cursor:not-allowed}.os-chip__dismiss svg{display:block;width:14px;height:14px}:host( [ disabled ] ) .os-chip{opacity:0.55;cursor:not-allowed}:host( [ size='compact' ] ) .os-chip{padding:var( --os-ui-chip-padding,1px 6px );font-size:var( --os-ui-chip-font-size,11px )}:host( [ selected ] ) .os-chip{position:relative;background:var( --os-ui-chip-bg,var( --os-ui-accent-soft,rgba( 34,113,177,0.14 ) ) );color:var( --os-ui-chip-fg,var( --os-ui-fg,#1d2327 ) )}:host( [ selected ] ) .os-chip::after{content:'';position:absolute;inset:0;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}`,es=class es extends _{constructor(){super(...arguments),this._onHostKeyDown=e=>{if(this.dismissible!==null&&(e.key==="Backspace"||e.key==="Delete")){if(e.preventDefault(),this.disabled!==null)return;const i=this.label??"";this.emit("os-chip-dismiss",{label:i})}}}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onHostKeyDown)}disconnectedCallback(){this.removeEventListener("keydown",this._onHostKeyDown)}render(){const e=this.label??"",t=this.dismissible!==null,o=this.disabled!==null;return c`
1532 <span part="chip" class="os-chip">
1533 <span class="os-chip__icon">
1534 <slot name="icon"></slot>
1535 </span>
1536 <span class="os-chip__label">
1537 ${e===""?c`<slot></slot>`:e}
1538 </span>
1539 ${t?c`
1540 <button
1541 part="dismiss"
1542 class="os-chip__dismiss"
1543 type="button"
1544 aria-label=${`Remove ${e||"chip"}`}
1545 ?disabled=${o}
1546 @click=${i=>this._onDismiss(i)}
1547 >
1548 ${N("close",{size:null})}
1549 </button>
1550 `:c``}
1551 </span>
1552 `}_onDismiss(e){if(e.stopPropagation(),this.disabled!==null)return;const o=this.label??"";this.emit("os-chip-dismiss",{label:o})}};es.props=["label","tone","size","dismissible","disabled","pending","selected"],es.styles=[Sp],es.help=void 0;let Hi=es;w("os-chip",Hi);const Cp=v`:host{display:inline-flex;max-width:100%}.os-tag-input{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-tag-input-gap,4px );padding:var( --os-ui-tag-input-padding,2px );min-height:24px;max-width:100%}.os-tag-input__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-tag-input-gap,4px );min-width:0}.os-tag-input__add{appearance:none;display:inline-flex;align-items:center;gap:3px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-tag-input-add-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-tag-input-add-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-tag-input__add:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-tag-input-add-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-tag-input-add-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-tag-input__add:focus-visible{outline:none;border-style:solid;box-shadow:var( --os-ui-focus-ring,0 0 0 2px rgba( 12,11,15,0.9 ),0 0 0 4px #2271b1 )}.os-tag-input__add:disabled{opacity:0.5;cursor:not-allowed}.os-tag-input__add svg{display:block}.os-tag-input__editor{position:relative;display:inline-flex;align-items:center;flex:0 1 auto;min-width:120px}.os-tag-input__input{appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );line-height:1.4;padding:2px 8px;border:1px solid var( --os-ui-tag-input-input-border,var( --os-ui-border,#2271b1 ) );border-radius:999px;background:var( --os-ui-tag-input-input-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-tag-input-input-fg,var( --os-ui-fg,#1d2327 ) );min-width:80px;max-width:240px}.os-tag-input__input:focus{outline:none;border-color:var( --os-ui-accent,#2271b1 );box-shadow:var( --os-ui-focus-ring-field,0 0 0 1px #2271b1,0 0 0 4px rgba( 34,113,177,0.18 ) )}.os-tag-input__suggestions{position:absolute;top:calc( 100% + 4px );left:0;min-width:220px;max-width:320px;max-height:240px;overflow-y:auto;padding:4px 0;background:var( --os-ui-tag-input-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-tag-input-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-tag-input-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:50}.os-tag-input__suggestion-item{display:flex;align-items:center;gap:6px;padding:6px 12px;font-size:13px;cursor:pointer;user-select:none}.os-tag-input__suggestion-item[ aria-selected='true' ]{background:color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 10%,transparent );color:var( --wp-admin-theme-color,#2271b1 )}.os-tag-input__suggestion-create{font-style:italic;color:var( --os-ui-tag-input-create-fg,var( --os-ui-fg-muted,#50575e ) );border-top:1px solid var( --os-ui-tag-input-pop-divider,var( --os-ui-border,#f0f0f1 ) )}.os-tag-input__suggestion-create[ aria-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 )}.os-tag-input__suggestion-empty,.os-tag-input__suggestion-loading{display:flex;align-items:center;gap:8px;padding:8px 12px;font-size:12px;color:var( --os-ui-tag-input-pop-muted,var( --os-ui-fg-muted,#646970 ) )}.os-tag-input__suggestion-spinner{display:inline-block;width:10px;height:10px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-tag-input-spin 0.8s linear infinite}@keyframes os-tag-input-spin{to{transform:rotate( 360deg )}}:host( [ disabled ] ) .os-tag-input{opacity:0.6;pointer-events:none}`,ts=class ts extends _{constructor(){super(...arguments),this._value=[],this._suggestions=[],this._suggestionsLoading=!1,this._query="",this._highlight=-1,this._focusedChip=-1,this._onDocumentPointerDown=e=>{!this.isOpen||e.composedPath().includes(this)||this.closeInput()}}get _input(){const e=this.shadowRoot;return e?e.querySelector(".os-tag-input__input"):null}get value(){return this._value}set value(e){this._value=Array.isArray(e)?e.slice():[],this._focusedChip>=this._value.length&&(this._focusedChip=-1),this.requestUpdate()}get suggestions(){return this._suggestions}set suggestions(e){this._suggestions=Array.isArray(e)?e.slice():[],this._highlight=this._suggestions.length>0?0:-1,this._suggestionsLoading=!1,this.requestUpdate()}get suggestionsLoading(){return this._suggestionsLoading}set suggestionsLoading(e){this._suggestionsLoading=!!e,this.requestUpdate()}get query(){return this._query}get isOpen(){return this.open!==null}openInput(){this.isOpen||(this.open="",this._query="",this._highlight=-1,this.emit("os-tag-open",{}),queueMicrotask(()=>{this._input?.focus(),this._emitSuggest("")}))}closeInput(){this.isOpen&&(this.open=null,this._query="",this._suggestions=[],this._highlight=-1,this._suggestionsLoading=!1,this.emit("os-tag-close",{}),this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocumentPointerDown,!0)}disconnectedCallback(){document.removeEventListener("pointerdown",this._onDocumentPointerDown,!0)}render(){const e=this.isOpen,t=this.disabled!==null,o=this.readonly!==null,i=this.removable!==null||this.removable===null&&!o,n=this.creatable!==null,r=this["add-label"]||"Add",a=this.placeholder||"Add a tag…";return c`
1553 <span
1554 class="os-tag-input"
1555 role="group"
1556 aria-label=${this.label??""}
1557 >
1558 ${this._renderChips(i,t)}
1559 ${this._renderTrailing({isOpen:e,readonly:o,disabled:t,placeholder:a,creatable:n,addLabel:r})}
1560 </span>
1561 `}_renderTrailing(e){return e.isOpen?this._renderEditor(e.placeholder,e.creatable):e.readonly||e.disabled?c``:this._renderTrigger(e.addLabel)}_renderChips(e,t){const o=this._value;return o.length===0?c``:c`
1562 <span class="os-tag-input__chips" role="list">
1563 ${o.map((i,n)=>{const r=i.tone??"neutral";return c`
1564 <os-chip
1565 role="listitem"
1566 size="compact"
1567 tone=${r}
1568 label=${i.label}
1569 ?dismissible=${e&&!t}
1570 ?disabled=${t}
1571 ?pending=${!!i.pending}
1572 tabindex=${n===this._focusedChip?"0":"-1"}
1573 data-idx=${String(n)}
1574 @os-chip-dismiss=${a=>this._onChipDismiss(a,i)}
1575 @focus=${()=>this._focusedChip=n}
1576 ></os-chip>
1577 `})}
1578 </span>
1579 `}_renderTrigger(e){const t=this.disabled!==null;return c`
1580 <button
1581 type="button"
1582 class="os-tag-input__add"
1583 aria-label=${e}
1584 aria-haspopup="listbox"
1585 aria-expanded="false"
1586 ?disabled=${t}
1587 @click=${()=>this.openInput()}
1588 >
1589 ${Ip()}
1590 <span>${e}</span>
1591 </button>
1592 `}_renderEditor(e,t){const o=this._suggestions.length>0||this._suggestionsLoading||t&&this._query.trim().length>0;return c`
1593 <span class="os-tag-input__editor">
1594 <input
1595 class="os-tag-input__input"
1596 type="text"
1597 autocomplete="off"
1598 autocapitalize="off"
1599 spellcheck="false"
1600 placeholder=${e}
1601 .value=${this._query}
1602 aria-autocomplete="list"
1603 aria-expanded=${o?"true":"false"}
1604 aria-activedescendant=${this._highlight>=0?`os-tag-suggestion-${this._highlight}`:""}
1605 @input=${i=>this._onInput(i)}
1606 @keydown=${i=>this._onInputKeyDown(i)}
1607 @blur=${i=>this._onInputBlur(i)}
1608 />
1609 ${o?this._renderSuggestions(t):c``}
1610 </span>
1611 `}_renderSuggestions(e){const t=this._query.trim(),o=this._suggestions,i=e&&t.length>0&&!o.some(n=>n.label.toLowerCase()===t.toLowerCase())&&!this._value.some(n=>n.label.toLowerCase()===t.toLowerCase());return c`
1612 <div
1613 class="os-tag-input__suggestions"
1614 role="listbox"
1615 >
1616 ${this._suggestionsLoading?c`
1617 <div class="os-tag-input__suggestion-loading">
1618 <span class="os-tag-input__suggestion-spinner" aria-hidden="true"></span>
1619 <span>Searching…</span>
1620 </div>
1621 `:c``}
1622 ${o.length===0&&!this._suggestionsLoading&&!i?c`
1623 <div class="os-tag-input__suggestion-empty">
1624 ${t.length>0?"No matches.":"Type to search."}
1625 </div>
1626 `:c``}
1627 ${o.map((n,r)=>{const a=r===this._highlight;return c`
1628 <div
1629 id=${`os-tag-suggestion-${r}`}
1630 role="option"
1631 aria-selected=${a?"true":"false"}
1632 class="os-tag-input__suggestion-item"
1633 @mousedown=${l=>{l.preventDefault(),this._addSuggestion(n,!1)}}
1634 @mouseenter=${()=>{this._highlight=r,this.requestUpdate()}}
1635 >
1636 <span>${n.label}</span>
1637 </div>
1638 `})}
1639 ${i?c`
1640 <div
1641 id=${`os-tag-suggestion-${o.length}`}
1642 role="option"
1643 aria-selected=${this._highlight===o.length?"true":"false"}
1644 class="os-tag-input__suggestion-item os-tag-input__suggestion-create"
1645 @mousedown=${n=>{n.preventDefault(),this._addSuggestion({label:t},!0)}}
1646 @mouseenter=${()=>{this._highlight=o.length,this.requestUpdate()}}
1647 >
1648 Create "${t}"
1649 </div>
1650 `:c``}
1651 </div>
1652 `}_onChipDismiss(e,t){e.stopPropagation(),this.emit("os-tag-remove",{tag:t})}_onInput(e){const t=e.target.value;this._query=t,this._emitSuggest(t)}_emitSuggest(e){const t=parseInt(this["min-query"]||"0",10)||0;if(e.length<t){this._suggestions=[],this._suggestionsLoading=!1,this.requestUpdate();return}this._suggestionsLoading=!0,this.requestUpdate(),this.emit("os-tag-suggest",{query:e})}_onInputKeyDown(e){const t=this.creatable!==null,o=this._suggestions,i=this._query.trim(),n=t&&i.length>0&&!o.some(a=>a.label.toLowerCase()===i.toLowerCase())&&!this._value.some(a=>a.label.toLowerCase()===i.toLowerCase()),r=o.length+(n?1:0);switch(e.key){case"ArrowDown":{if(r===0)return;e.preventDefault(),this._highlight=this._highlight+1>=r?0:this._highlight+1,this.requestUpdate();return}case"ArrowUp":{if(r===0)return;e.preventDefault(),this._highlight=this._highlight<=0?r-1:this._highlight-1,this.requestUpdate();return}case"Enter":{if(e.preventDefault(),this._highlight>=0&&this._highlight<o.length){this._addSuggestion(o[this._highlight],!1);return}if(this._highlight===o.length&&n){this._addSuggestion({label:i},!0);return}if(n&&i.length>0){this._addSuggestion({label:i},!0);return}return}case"Escape":{e.preventDefault(),this.closeInput();return}case"Backspace":{if(this._query===""&&this._value.length>0){e.preventDefault();const a=this._value.length-1;this._focusedChip===a?(this.emit("os-tag-remove",{tag:this._value[a]}),this._focusedChip=-1):(this._focusedChip=a,this.requestUpdate())}return}default:this._focusedChip!==-1&&(this._focusedChip=-1)}}_onInputBlur(e){queueMicrotask(()=>{this.shadowRoot?.activeElement||this.closeInput()})}_addSuggestion(e,t){if(this._value.some(i=>i.label.toLowerCase()===e.label.toLowerCase())){this._query="",this._highlight=-1,this._suggestions=[],this.requestUpdate(),this._input?.focus();return}this.emit("os-tag-add",{tag:e,isNew:t}),this._query="",this._highlight=-1,this._suggestions=[],this._suggestionsLoading=!1,this.requestUpdate(),queueMicrotask(()=>{this._input?.focus()})}};ts.props=["name","label","placeholder","add-label","creatable","removable","disabled","readonly","size","min-query","open"],ts.styles=[Cp],ts.help=void 0;let Ui=ts;w("os-tag-input",Ui);function Ip(){return N("plus",{size:14})}const Rp=v`:host{display:block;container-type:inline-size;container-name:os-form;font-size:13px;color:var( --os-ui-fg,#1d2327 )}:host( [ hidden ] ){display:none}.header{margin:0 0 18px}.header:empty{display:none}.fields{display:grid;grid-template-columns:1fr;gap:14px 16px;margin:0 0 18px}@container os-form ( min-width:480px ){.fields{grid-template-columns:repeat( 2,minmax( 0,1fr ) )}}@container os-form ( min-width:760px ){:host( [ columns="3" ] ) .fields{grid-template-columns:repeat( 3,minmax( 0,1fr ) )}}:host( [ columns="1" ] ) .fields{grid-template-columns:1fr}:host( [ columns="2" ] ) .fields{grid-template-columns:repeat( 2,minmax( 0,1fr ) )}::slotted( [ full-width ] ){grid-column:1 / -1}::slotted( [ slot ] ){display:contents}.error{margin:0 0 14px;padding:10px 12px;border-radius:6px;background:var( --os-ui-notice-error-bg,rgba( 179,45,46,0.10 ) );color:var( --os-ui-danger-hover,#b32d2e );font-size:13px;line-height:1.4}.error[ hidden ]{display:none}.footer{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:flex-end;border-top:1px solid var( --os-ui-border,#dcdcde );padding-top:14px}:host( [ align="start" ] ) .footer{justify-content:flex-start}:host( [ align="stretch" ] ) .footer{justify-content:stretch}:host( [ align="stretch" ] ) .footer .footer-actions{flex:1 1 auto}.footer-leading,.footer-trailing{display:contents}.footer-actions{display:inline-flex;gap:8px;align-items:center;margin-inline-start:auto}:host( [ align="start" ] ) .footer-actions{margin-inline-start:0}:host( [ busy ] ){pointer-events:none}:host( [ busy ] ) .fields{opacity:0.6}:host( [ busy ] ) .footer{pointer-events:auto}.busy-spinner{display:inline-flex;width:14px;height:14px;border-radius:50%;border:2px solid currentColor;border-right-color:transparent;animation:os-form-spin 0.7s linear infinite;vertical-align:-2px;margin-inline-end:6px}@keyframes os-form-spin{to{transform:rotate( 360deg )}}@media ( prefers-reduced-motion:reduce ){.busy-spinner{animation-duration:2s}}`;function Ra(s){if(s===null||typeof s!="object")return s;try{return structuredClone(s)}catch{return s}}const ss=class ss extends _{constructor(){super(...arguments),this._initial=new Map,this._captured=!1,this._fieldChangeListener=null,this._enterSubmitListener=null}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._captureInitialValues()),this._fieldChangeListener=e=>this._onAnyFieldInput(e),this.addEventListener("os-input-change",this._fieldChangeListener),this.addEventListener("os-input-commit",this._fieldChangeListener),this.addEventListener("os-checkbox-change",this._fieldChangeListener),this.addEventListener("os-select-change",this._fieldChangeListener),this.addEventListener("os-range-change",this._fieldChangeListener),this.addEventListener("os-color-change",this._fieldChangeListener),this.addEventListener("change",this._fieldChangeListener),this._enterSubmitListener=()=>this.submit(),this.addEventListener("os-submit",this._enterSubmitListener)}disconnectedCallback(){this._fieldChangeListener&&(this.removeEventListener("os-input-change",this._fieldChangeListener),this.removeEventListener("os-input-commit",this._fieldChangeListener),this.removeEventListener("os-checkbox-change",this._fieldChangeListener),this.removeEventListener("os-select-change",this._fieldChangeListener),this.removeEventListener("os-range-change",this._fieldChangeListener),this.removeEventListener("os-color-change",this._fieldChangeListener),this.removeEventListener("change",this._fieldChangeListener),this._fieldChangeListener=null),this._enterSubmitListener&&(this.removeEventListener("os-submit",this._enterSubmitListener),this._enterSubmitListener=null)}render(){const e=this["submit-label"]||"Submit",t=this["reset-label"]||"Reset",o=this.error||"",i=this.busy!==null,r=this["show-reset"]!=="false";return c`
1653 <div class="header" part="header">
1654 <slot name="header"></slot>
1655 </div>
1656 <div class="fields" part="fields" ?inert=${i}>
1657 <slot></slot>
1658 </div>
1659 <slot name="error">
1660 ${o?c`<p class="error" role="alert" part="error">${o}</p>`:c`<p class="error" role="alert" part="error" hidden></p>`}
1661 </slot>
1662 <footer class="footer" part="footer">
1663 <span class="footer-leading"
1664 ><slot name="footer-leading"></slot
1665 ></span>
1666 <span class="footer-actions">
1667 ${r?c`<os-button
1668 variant="ghost"
1669 data-os-form-action="reset"
1670 ?disabled=${i}
1671 @click=${()=>this.reset()}
1672 >${t}</os-button>`:c``}
1673 <os-button
1674 variant="primary"
1675 data-os-form-action="submit"
1676 ?disabled=${i}
1677 @click=${()=>this.submit()}
1678 >
1679 ${i?c`<span class="busy-spinner" aria-hidden="true"></span>`:c``}
1680 ${e}
1681 </os-button>
1682 </span>
1683 <span class="footer-trailing"
1684 ><slot name="footer-trailing"></slot
1685 ></span>
1686 </footer>
1687 `}getValues(){const e={};for(const t of this._namedFields()){const o=t.getAttribute("name");o&&(e[o]=this._readField(t))}return e}setValues(e){for(const[t,o]of Object.entries(e)){const i=this._fieldByName(t);i&&this._writeField(i,o)}}setBusy(e){e?this.setAttribute("busy",""):this.removeAttribute("busy")}setError(e){e?this.setAttribute("error",e):this.removeAttribute("error")}setFieldInvalid(e,t=!0,o=null){const i=this._fieldByName(e);i&&(t?(i.setAttribute("invalid",""),o!==null&&i.setAttribute("error",o)):(i.removeAttribute("invalid"),i.removeAttribute("error")))}clearErrors(){this.setError(null);for(const e of this._namedFields())e.removeAttribute("invalid"),e.removeAttribute("error")}reset(){this.clearErrors();for(const[e,t]of this._initial.entries()){const o=this._fieldByName(e);if(o){if(t.checked!==null){o.checked=t.checked,t.checked?o.setAttribute("checked",""):o.removeAttribute("checked");continue}this._writeField(o,Ra(t.value))}}this.dispatchEvent(new CustomEvent("os-form-reset",{bubbles:!0,composed:!0,detail:{form:this}}))}submit(){if(this.hasAttribute("busy"))return;const e=[];for(const i of this._namedFields()){const n=i.getAttribute("name");if(!n||!i.hasAttribute("required"))continue;const a=this._readField(i);if(a==null||a===""||Array.isArray(a)&&a.length===0){i.setAttribute("invalid","");const u=i.getAttribute("label");e.push(u||n)}}if(e.length>0){const i=e.join(", ");this.setError(`Required: ${i}`);return}const t=this.getValues(),o=new CustomEvent("os-form-submit",{bubbles:!0,composed:!0,cancelable:!0,detail:{values:t,form:this}});this.dispatchEvent(o)}_captureInitialValues(){if(this._captured)return;const e=this._namedFields();if(e.length!==0){for(const t of e){const o=t.getAttribute("name");if(!o)continue;const i=t.tagName==="OS-SWITCH"||t.tagName==="OS-CHECKBOX"||t.tagName==="OS-CHECKBOX-LABEL"||t.tagName==="INPUT"&&t.type==="checkbox";this._initial.set(o,{value:Ra(this._readField(t)),checked:i?!!this._readField(t):null})}this._captured=!0}}_namedFields(){return Array.from(this.querySelectorAll("[name]"))}_fieldByName(e){const t=typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(e):e.replace(/["\\]/g,"\\$&");return this.querySelector(`[name="${t}"]`)}_readField(e){const t=e.tagName.toUpperCase();return t==="OS-SWITCH"||t==="OS-CHECKBOX"||t==="OS-CHECKBOX-LABEL"||t==="INPUT"&&e.type==="checkbox"?typeof e.checked=="boolean"?e.checked:e.hasAttribute("checked"):e.value!==void 0&&e.value!==null?e.value:e.getAttribute("value")??""}_writeField(e,t){const o=e.tagName.toUpperCase();if(o==="OS-SWITCH"||o==="OS-CHECKBOX"||o==="OS-CHECKBOX-LABEL"||o==="INPUT"&&e.type==="checkbox"){const r=!!t;e.checked=r,r?e.setAttribute("checked",""):e.removeAttribute("checked");return}if(t!==null&&typeof t=="object"||e.value!==null&&typeof e.value=="object"){e.value=t;return}const n=t==null?"":String(t);e.value=n,e.setAttribute("value",n)}_onAnyFieldInput(e){const t=e.target;if(!t)return;const o=t.getAttribute?.("name");o&&(this.dispatchEvent(new CustomEvent("os-form-input",{bubbles:!0,composed:!0,detail:{name:o,value:this._readField(t),form:this}})),t.hasAttribute("invalid")&&t.removeAttribute("invalid"))}};ss.props=["submit-label","reset-label","error","busy","columns","min-column","show-reset","align"],ss.styles=[Rp],ss.help=void 0;let qi=ss;w("os-form",qi);const Lp=v`:host{display:inline-flex;align-items:center;gap:6px;font-size:var( --os-ui-save-status-font-size,11px );line-height:1;color:var( --os-ui-save-status-fg,currentColor );vertical-align:middle;min-width:0;opacity:1;pointer-events:auto}.os-save-status__indicator{display:inline-flex;align-items:center;justify-content:center;width:var( --os-ui-save-status-size,12px );height:var( --os-ui-save-status-size,12px );border-radius:50%;flex-shrink:0;box-sizing:border-box;background:var( --os-ui-save-status-bg,transparent );border:2px solid var( --os-ui-save-status-idle-color,color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 55%,transparent ) );color:var( --wp-admin-theme-color,#2271b1 );transition:background-color 0.2s ease,border-color 0.2s ease,box-shadow 0.2s ease}:host( [ phase='pending' ] ) .os-save-status__indicator,:host( [ phase='saving' ] ) .os-save-status__indicator{background:var( --os-ui-save-status-bg,var( --wp-admin-theme-color,#2271b1 ) );border-color:transparent;color:var( --wp-admin-theme-color,#2271b1 );animation:os-save-status-pulse 1.2s ease-in-out infinite}:host( [ animation='modem' ][ phase='pending' ] ) .os-save-status__indicator,:host( [ animation='modem' ][ phase='saving' ] ) .os-save-status__indicator{background:var( --os-ui-save-status-bg,var( --wp-admin-theme-color,#2271b1 ) );border-color:transparent;color:var( --wp-admin-theme-color,#2271b1 );animation:os-save-status-modem-stutter 1.8s ease-in-out infinite,os-save-status-modem-glow 2.4s ease-in-out infinite}@keyframes os-save-status-modem-stutter{0%,4%{opacity:1}5%,30%{opacity:0.22}31%,36%{opacity:1}37%,39%{opacity:0.22}40%,44%{opacity:1}45%,67%{opacity:0.22}68%,76%{opacity:1}77%,100%{opacity:0.22}}@keyframes os-save-status-modem-glow{0%,12%{box-shadow:0 0 0 0 transparent}13%,22%{box-shadow:0 0 4px 0 currentColor}23%,50%{box-shadow:0 0 0 0 transparent}51%,58%{box-shadow:0 0 4px 0 currentColor}59%,84%{box-shadow:0 0 0 0 transparent}85%,94%{box-shadow:0 0 5px 0 currentColor}95%,100%{box-shadow:0 0 0 0 transparent}}@media ( prefers-reduced-motion:reduce ){:host( [ phase='pending' ] ) .os-save-status__indicator,:host( [ phase='saving' ] ) .os-save-status__indicator,:host( [ animation='modem' ][ phase='pending' ] ) .os-save-status__indicator,:host( [ animation='modem' ][ phase='saving' ] ) .os-save-status__indicator{animation:none;opacity:0.85}}:host( [ phase='saved' ] ) .os-save-status__indicator{background:var( --os-ui-save-status-saved-bg,var( --os-ui-success-fg,#1d6f42 ) );border-color:transparent;color:var( --os-ui-save-status-saved-bg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ phase='failed' ] ) .os-save-status__indicator{background:var( --os-ui-save-status-failed-bg,var( --os-ui-danger,#d63638 ) );border-color:transparent;color:var( --os-ui-save-status-failed-bg,var( --os-ui-danger,#d63638 ) );animation:os-save-status-pulse 0.8s ease-in-out 2}:host( [ variant='ring' ] ) .os-save-status__indicator{background:transparent}:host( [ variant='ring' ][ phase='pending' ] ) .os-save-status__indicator,:host( [ variant='ring' ][ phase='saving' ] ) .os-save-status__indicator{background:transparent;border-color:var( --os-ui-save-status-ring-color,var( --os-ui-save-status-bg,var( --wp-admin-theme-color,#2271b1 ) ) );animation:os-save-status-ring-pulse 1.6s var( --os-ui-ease-loop,ease-in-out ) infinite}:host( [ variant='ring' ][ phase='failed' ] ) .os-save-status__indicator{background:transparent;border-color:var( --os-ui-save-status-failed-bg,var( --os-ui-danger,#d63638 ) );animation:os-save-status-ring-alert 0.62s var( --os-ui-ease-out,ease-out ) 1}:host( [ variant='ring' ][ phase='failed' ] ) .os-save-status__glyph{color:var( --os-ui-save-status-failed-bg,var( --os-ui-danger,#d63638 ) )}:host( [ variant='ring' ][ phase='saved' ] ) .os-save-status__indicator{background:var( --os-ui-save-status-saved-bg,var( --wp-admin-theme-color,#2271b1 ) );border-color:transparent;animation:os-save-status-ring-land 0.42s var( --os-ui-ease-out,ease-out ) 1}:host( [ variant='ring' ][ phase='saved' ] ) .os-save-status__glyph,:host( [ variant='ring' ][ phase='failed' ] ) .os-save-status__glyph{animation:os-save-status-glyph-in 0.24s var( --os-ui-ease-out,ease-out ) 0.08s 1 backwards}@keyframes os-save-status-ring-pulse{0%,100%{opacity:0.45;scale:0.9}50%{opacity:1;scale:1}}@keyframes os-save-status-ring-land{0%{scale:0.82}55%{scale:1.06}100%{scale:1}}@keyframes os-save-status-ring-alert{0%{scale:0.9}25%{scale:1.08}50%{scale:0.98}75%{scale:1.04}100%{scale:1}}@keyframes os-save-status-glyph-in{0%{opacity:0;scale:0.4}100%{opacity:1;scale:1}}@media ( prefers-reduced-motion:reduce ){:host( [ variant='ring' ] ) .os-save-status__indicator,:host( [ variant='ring' ] ) .os-save-status__glyph{animation:none;opacity:1;scale:1}}@keyframes os-save-status-pulse{0%,100%{opacity:0.55;transform:scale( 0.9 )}50%{opacity:1;transform:scale( 1 )}}:host( [ mode='pill' ] ) .os-save-status{display:inline-flex;align-items:center;gap:6px;padding:2px 10px;border-radius:999px;background:var( --os-ui-save-status-pill-bg,transparent );font-weight:500;white-space:nowrap}:host( [ mode='pill' ][ phase='saving' ] ) .os-save-status,:host( [ mode='pill' ][ phase='pending' ] ) .os-save-status{background:var( --os-ui-save-status-pill-bg,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );color:var( --os-ui-save-status-pill-fg,var( --os-ui-fg-muted,#50575e ) )}:host( [ mode='pill' ][ phase='saved' ] ) .os-save-status{background:var( --os-ui-save-status-pill-bg,rgba( 30,132,73,0.12 ) );color:var( --os-ui-save-status-pill-fg,var( --os-ui-success-fg,#1d6f42 ) )}:host( [ mode='pill' ][ phase='failed' ] ) .os-save-status{background:var( --os-ui-save-status-pill-bg,rgba( 214,54,56,0.12 ) );color:var( --os-ui-save-status-pill-fg,var( --os-ui-danger-hover,#a02622 ) )}.os-save-status__label{min-width:0;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host( [ phase='saved' ] ) .os-save-status__glyph,:host( [ phase='failed' ] ) .os-save-status__glyph{display:inline-block;color:var( --os-ui-fg-on-accent,#fff );width:calc( var( --os-ui-save-status-size,12px ) * 0.66 );height:calc( var( --os-ui-save-status-size,12px ) * 0.66 )}.os-save-status__glyph{display:none}.os-save-status__glyph svg{display:block;width:100%;height:100%}`,La="os-settings-save-lifecycle",Tp=2200,Dp=6e3,os=class os extends _{constructor(){super(...arguments),this._autoTimer=null,this._docListener=null}connectedCallback(){super.connectedCallback(),this.auto!==null&&this._installAutoListener()}disconnectedCallback(){this._removeAutoListener(),this._autoTimer!==null&&(window.clearTimeout(this._autoTimer),this._autoTimer=null)}attributeChangedCallback(e,t,o){if(super.attributeChangedCallback(e,t,o),(e==="auto"||e==="event")&&(this._removeAutoListener(),this.auto!==null&&this._installAutoListener()),e==="phase"){this._scheduleAutoClear();const i={phase:this.phase??"idle",error:this.error??void 0};this.emit("os-save-status-change",i)}}render(){const e=this.phase??"idle",t=this.mode??"dot",i=(this.error??"")||this._labelForPhase(e);return i?this.setAttribute("title",i):this.removeAttribute("title"),this.setAttribute("aria-live",e==="failed"?"assertive":"polite"),this.setAttribute("role",e==="failed"?"alert":"status"),c`
1688 <span class="os-save-status">
1689 <span class="os-save-status__indicator" aria-hidden="true">
1690 <span class="os-save-status__glyph">${this._renderGlyph(e)}</span>
1691 </span>
1692 ${t==="pill"?c`<span class="os-save-status__label"
1693 >${this._labelForPhase(e)}</span
1694 >`:c``}
1695 </span>
1696 `}_renderGlyph(e){return e==="saved"?Pp():e==="failed"?Np():""}_labelForPhase(e){switch(e){case"pending":case"saving":return this["saving-label"]??"Saving…";case"saved":return this["saved-label"]??"Saved";case"failed":return(this.error??"")||"Couldn’t save";default:return this["idle-label"]??""}}_installAutoListener(){const e=this.event||La;this._docListener=t=>{const o=t.detail;!o||typeof o.phase!="string"||(this.phase=o.phase,o.error?this.error=o.error:o.phase!=="failed"&&this.error&&this.removeAttribute("error"))},document.addEventListener(e,this._docListener)}_removeAutoListener(){if(!this._docListener)return;const e=this.event||La;document.removeEventListener(e,this._docListener),this._docListener=null}_scheduleAutoClear(){this._autoTimer!==null&&(window.clearTimeout(this._autoTimer),this._autoTimer=null);const e=this.phase??"idle",t=this._autoClearMsFor(e);t<=0||(this._autoTimer=window.setTimeout(()=>{this._autoTimer=null,this.phase="idle"},t))}_autoClearMsFor(e){if(e==="saved"){const t=this["auto-clear-saved-ms"];return parseInt(t||"",10)||Tp}if(e==="failed"){const t=this["auto-clear-failed-ms"];return parseInt(t||"",10)||Dp}return 0}};os.props=["phase","mode","variant","animation","auto","event","error","saving-label","saved-label","idle-label","auto-clear-saved-ms","auto-clear-failed-ms"],os.styles=[Lp],os.help=void 0;let Fi=os;w("os-save-status",Fi);function Pp(){return c`
1697 <svg
1698 viewBox="0 0 12 12"
1699 aria-hidden="true"
1700 focusable="false"
1701 fill="none"
1702 stroke="currentColor"
1703 stroke-width="2"
1704 stroke-linecap="round"
1705 stroke-linejoin="round"
1706 >
1707 <path d="M2.5 6 L5 8.5 L9.5 4" />
1708 </svg>
1709 `}function Np(){return c`
1710 <svg
1711 viewBox="0 0 12 12"
1712 aria-hidden="true"
1713 focusable="false"
1714 fill="currentColor"
1715 >
1716 <path
1717 d="M5 2 H7 V7 H5 z M5 8.5 H7 V10.5 H5 z"
1718 />
1719 </svg>
1720 `}const Mp=v`:host{display:flex;width:100%;min-width:0;max-width:100%;align-items:stretch}.os-cat{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:var( --os-ui-cat-padding,2px );min-height:24px;max-width:100%;width:100%}.os-cat__chips{display:inline-flex;flex-wrap:wrap;align-items:center;gap:var( --os-ui-cat-gap,4px );min-width:0}.os-cat__chains{display:flex;flex-wrap:wrap;gap:4px;min-width:0}.os-cat__viz-host{display:flex;align-items:center;gap:4px;min-width:0;flex:1 1 auto;max-width:100%;min-height:28px;cursor:pointer;position:relative}.os-cat__viz-svg{display:block;width:100%;max-width:100%;min-width:0;overflow:visible;flex:1 1 auto}.os-cat__viz-svg .os-cat-edge{fill:none;stroke:var( --os-ui-cat-edge-color,currentColor );stroke-width:1.25;stroke-linecap:round;opacity:0.55;transition:stroke-width 0.18s ease,opacity 0.18s ease}.os-cat__viz-svg .os-cat-edge[ data-active='true' ]{stroke-width:2;opacity:1}.os-cat__viz-svg .os-cat-node{cursor:pointer;transition:r 0.2s cubic-bezier( 0.34,1.56,0.64,1 ),fill 0.18s ease,stroke-width 0.18s ease,filter 0.18s ease}.os-cat__viz-svg .os-cat-node[ data-selected='true' ]{filter:drop-shadow( 0 0 6px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.18 ) ) )}.os-cat__viz-svg .os-cat-node:hover,.os-cat__viz-svg .os-cat-node:focus-visible{filter:drop-shadow( 0 0 8px var( --os-ui-cat-node-glow,rgba( 0,0,0,0.3 ) ) );outline:none}.os-cat__viz-svg .os-cat-label{font-family:var( --os-ui-font,system-ui,sans-serif );font-size:10.5px;fill:var( --os-ui-cat-label-fg,var( --os-ui-fg,#1d2327 ) );font-weight:500;pointer-events:none;user-select:none}.os-cat__viz-svg .os-cat-label[ data-selected='false' ]{fill:var( --os-ui-cat-label-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-weight:400;font-style:italic}.os-cat__trigger{appearance:none;display:inline-flex;align-items:center;gap:4px;padding:1px 8px;min-height:22px;font:inherit;font-size:11px;font-weight:500;line-height:1;color:var( --os-ui-cat-trigger-fg,var( --os-ui-fg-muted,#50575e ) );background:transparent;border:1px dashed var( --os-ui-cat-trigger-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease,border-color 0.12s ease}.os-cat__trigger:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) );color:var( --os-ui-cat-trigger-fg-hover,var( --os-ui-fg,#1d2327 ) );border-color:var( --os-ui-cat-trigger-border-hover,var( --os-ui-border-strong,#8c8f94 ) )}.os-cat__trigger:focus-visible{outline:none;border-style:solid;box-shadow:0 0 0 2px var( --wp-admin-theme-color,#2271b1 )}.os-cat__trigger svg{display:block}.os-cat__uncategorized{display:inline-flex;align-items:center;gap:4px;padding:1px 10px;min-height:22px;font-size:11px;font-weight:500;line-height:1.6;color:var( --os-ui-cat-uncat-fg,var( --os-ui-fg-muted,#8c8f94 ) );background:transparent;border:1px dashed var( --os-ui-cat-uncat-border,var( --os-ui-border,#c3c4c7 ) );border-radius:999px;font-style:italic}.os-cat__popover{position:fixed;top:0;left:0;min-width:280px;max-width:360px;max-height:360px;display:flex;flex-direction:column;background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );color:var( --os-ui-cat-pop-fg,var( --os-ui-fg,#1d2327 ) );border:1px solid var( --os-ui-cat-pop-border,var( --os-ui-border,#c3c4c7 ) );border-radius:8px;box-shadow:0 6px 16px rgba( 0,0,0,0.08 ),0 1px 2px rgba( 0,0,0,0.06 );z-index:1000}.os-cat__editor{position:relative;display:inline-flex;align-items:center}.os-cat__search{appearance:none;font:inherit;font-size:13px;padding:8px 12px;border:0;border-bottom:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );background:transparent;color:inherit;outline:none}.os-cat__search:focus{border-bottom-color:var( --wp-admin-theme-color,#2271b1 )}.os-cat__tree{flex:1 1 auto;min-height:0;overflow-y:auto;padding:4px 0}.os-cat__row-block{display:contents}.os-cat__row{display:flex;align-items:center;gap:6px;padding:4px 8px 4px var( --os-ui-cat-row-indent,12px );cursor:pointer;user-select:none;font-size:13px;line-height:1.4;position:relative}.os-cat__row:hover,.os-cat__row[ data-focused='true' ]{background:var( --os-ui-hover,rgba( 0,0,0,0.04 ) )}.os-cat__row[ data-selected='true' ]{color:var( --wp-admin-theme-color,#2271b1 );font-weight:600}.os-cat__row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__expander{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:0;background:transparent;color:inherit;cursor:pointer;flex-shrink:0;opacity:0.65}.os-cat__expander:hover{opacity:1}.os-cat__expander svg{display:block;transition:transform 0.12s ease}.os-cat__row[ data-expanded='true' ] .os-cat__expander svg{transform:rotate( 90deg )}.os-cat__expander--placeholder{visibility:hidden}.os-cat__create-row{display:flex;align-items:center;padding:2px 8px 2px var( --os-ui-cat-row-indent,28px );position:relative}.os-cat__create-row::before{content:'';position:absolute;left:0;top:0;bottom:0;width:var( --os-ui-cat-guide-width,0px );border-left:1px dotted var( --os-ui-cat-guide-color,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) )}.os-cat__create-wrap{display:inline-flex;align-items:center;flex:1 1 auto;min-width:0;gap:4px;padding:1px 1px 1px 0;border:1px solid transparent;border-radius:6px;background:transparent;transition:border-color 0.12s ease,background-color 0.12s ease,box-shadow 0.12s ease}.os-cat__create-wrap:hover{border-color:var( --os-ui-border,rgba( 0,0,0,0.12 ) );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) )}.os-cat__create-wrap:focus-within{border-color:var( --wp-admin-theme-color,#2271b1 );background:var( --os-ui-cat-pop-bg,var( --os-ui-surface,#fff ) );box-shadow:0 0 0 2px color-mix( in srgb,var( --wp-admin-theme-color,#2271b1 ) 15%,transparent )}.os-cat__create-input{flex:1 1 auto;min-width:0;appearance:none;font:inherit;font-size:var( --os-ui-field-font-size-compact,12px );padding:3px 6px;border:0;background:transparent;color:inherit;outline:none}.os-cat__create-input::placeholder{color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );font-style:italic;opacity:1}.os-cat__create-submit{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;flex-shrink:0;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#8c8f94 ) );cursor:pointer;transition:background-color 0.12s ease,color 0.12s ease}.os-cat__create-wrap:focus-within .os-cat__create-submit:not( [ disabled ] ){background:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__create-submit:hover:not( [ disabled ] ){filter:brightness( 1.05 )}.os-cat__create-submit[ disabled ]{cursor:default;opacity:0.5}.os-cat__create-submit svg{display:block}.os-cat__create-spinner{display:inline-block;width:12px;height:12px;margin:0 4px;border-radius:50%;border:2px solid var( --wp-admin-theme-color,#2271b1 );border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;flex-shrink:0}.os-cat__check{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;border:1.5px solid var( --os-ui-cat-check-border,var( --os-ui-border,#8c8f94 ) );border-radius:3px;color:transparent;transition:background-color 0.12s ease,border-color 0.12s ease,color 0.12s ease}.os-cat__row[ data-selected='true' ] .os-cat__check{background:var( --wp-admin-theme-color,#2271b1 );border-color:var( --wp-admin-theme-color,#2271b1 );color:var( --os-ui-accent-ink,var( --os-ui-fg-on-accent,#fff ) )}.os-cat__check svg{display:block;width:14px;height:14px}.os-cat__label{min-width:0;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.os-cat__delete{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:18px;height:18px;border:0;border-radius:50%;padding:0;background:transparent;color:var( --os-ui-cat-delete-color,var( --os-ui-danger,#d63638 ) );cursor:pointer;opacity:0;transition:opacity 0.12s ease,background-color 0.12s ease}.os-cat__row:hover .os-cat__delete,.os-cat__row[ data-focused='true' ] .os-cat__delete,.os-cat__delete:focus-visible{opacity:1}.os-cat__delete:hover,.os-cat__delete:focus-visible{background:var( --os-ui-badge-danger-bg,rgba( 214,54,56,0.12 ) )}.os-cat__delete svg{display:block;width:14px;height:14px}.os-cat__match{background:var( --os-ui-search-highlight-bg,rgba( 252,211,77,0.45 ) );border-radius:2px;padding:0 1px}.os-cat__empty,.os-cat__loading{padding:12px;font-size:12px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );text-align:center}.os-cat__loading-spinner{display:inline-block;width:12px;height:12px;border-radius:50%;border:2px solid currentColor;border-top-color:transparent;animation:os-cat-spin 0.8s linear infinite;margin-inline-end:8px;vertical-align:middle}@keyframes os-cat-spin{to{transform:rotate( 360deg )}}.os-cat__footer{padding:8px 12px;font-size:11px;color:var( --os-ui-cat-pop-muted,var( --os-ui-fg-muted,#646970 ) );border-top:1px solid var( --os-ui-cat-pop-divider,var( --os-ui-border,#f0f0f1 ) );border-radius:10px;background:var( --os-ui-cat-pop-footer-bg,var( --os-ui-surface,#fafafb ) );display:flex;align-items:center;gap:6px;line-height:1.4}.os-cat__footer .dashicons{font-size:14px;width:14px;height:14px;flex-shrink:0}:host( [ disabled ] ) .os-cat{opacity:0.6;pointer-events:none}`,ee="10px",zp=v`:host{display:inline-flex;max-width:100%;align-items:center;min-width:0;font-family:var( --os-ui-font,system-ui,sans-serif );font-size:12px;line-height:1;font-weight:500}.os-crumb-chain{display:inline-flex;flex-wrap:nowrap;align-items:stretch;max-width:100%;min-width:0;min-height:22px;border-radius:999px;overflow:hidden;filter:drop-shadow( 0 1px 1px rgba( 0,0,0,0.06 ) )}.os-crumb{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:22px;padding:2px 12px;background:var( --os-ui-crumb-bg,var( --os-ui-surface,#c3c4c7 ) );color:var( --os-ui-crumb-fg,var( --os-ui-fg,#1d2327 ) );text-align:center;min-width:0;max-width:100%;flex-shrink:1;font-size:12px;font-weight:500;letter-spacing:0.01em;white-space:nowrap;cursor:grab;transition:filter 0.15s ease,transform 0.15s ease,background-color 0.12s ease}.os-crumb:active{cursor:grabbing}.os-crumb:hover{filter:brightness( 1.06 )}.os-crumb__remove{cursor:pointer}.os-crumb--first{padding-inline-end:22px;clip-path:polygon( 0 0,calc( 100% - ${ee} ) 0,100% 50%,calc( 100% - ${ee} ) 100%,0 100% )}.os-crumb--middle{padding-inline:22px;margin-inline-start:calc( -1 * ${ee} );clip-path:polygon( ${ee} 0,calc( 100% - ${ee} ) 0,100% 50%,calc( 100% - ${ee} ) 100%,${ee} 100%,0 50% )}.os-crumb--last{padding-inline-start:22px;padding-inline-end:14px;margin-inline-start:calc( -1 * ${ee} );clip-path:polygon( ${ee} 0,100% 0,100% 100%,${ee} 100%,0 50% )}.os-crumb--solo{padding:2px 12px;border-radius:999px}.os-crumb__label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.4}.os-crumb__remove{appearance:none;display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;padding:0;border:0;border-radius:50%;background:transparent;color:inherit;cursor:pointer;opacity:0.65;transition:opacity 0.12s ease,background-color 0.12s ease,transform 0.12s ease}.os-crumb__remove:hover,.os-crumb__remove:focus-visible{opacity:1;background:var( --os-ui-scrim,rgba( 0,0,0,0.22 ) );outline:none;transform:scale( 1.1 )}.os-crumb__remove svg{display:block;width:100%;height:100%}.os-crumb-chain:hover{filter:drop-shadow( 0 2px 3px rgba( 0,0,0,0.12 ) )}:host( [ disabled ] ) .os-crumb-chain{opacity:0.55;pointer-events:none}`,is=class is extends _{constructor(){super(...arguments),this._segments=[]}get segments(){return this._segments}set segments(e){this._segments=Array.isArray(e)?e.slice():[],this.requestUpdate()}render(){const e=this.removable!==null,t=this._segments;return t.length===0?c``:c`
1721 <div class="os-crumb-chain" role="group">
1722 ${t.map((o,i)=>{const n=Pa(i,t.length),r=o.color,a=r?`--os-ui-crumb-bg: ${r}; --os-ui-crumb-fg: ${Na(r)};`:"";return c`
1723 <span
1724 class=${`os-crumb os-crumb--${n}`}
1725 style=${a}
1726 title=${o.name}
1727 draggable="true"
1728 @click=${l=>this._onSegmentClick(l,i,o)}
1729 @dragstart=${l=>this._onSegmentDragStart(l,i,o)}
1730 >
1731 <span class="os-crumb__label">${o.name}</span>
1732 ${e?c`
1733 <button
1734 type="button"
1735 class="os-crumb__remove"
1736 aria-label=${`Remove ${o.name}`}
1737 draggable="false"
1738 @click=${l=>this._onRemove(l,i,o)}
1739 >${Up()}</button>
1740 `:c``}
1741 </span>
1742 `})}
1743 </div>
1744 `}_onSegmentDragStart(e,t,o){if(e.target?.closest(".os-crumb__remove")){e.preventDefault();return}const n=this._segments.slice(t);if(e.dataTransfer){const r=Wp(n);document.body.appendChild(r);const a=e.currentTarget?.getBoundingClientRect(),l=a?Math.min(30,a.width/2):16,u=a?Math.min(16,a.height/2):12;e.dataTransfer.setDragImage(r,l,u),requestAnimationFrame(()=>r.remove())}this.emit("os-chain-segment-dragstart",{index:t,id:o.id,segment:o,segments:n,dragEvent:e})}_onSegmentClick(e,t,o){e.target?.closest(".os-crumb__remove")||this.emit("os-chain-segment-click",{index:t,id:o.id,segment:o})}_onRemove(e,t,o){e.stopPropagation(),this.emit("os-chain-remove",{index:t,id:o.id,segment:o})}};is.props=["removable","disabled"],is.styles=[zp],is.help=void 0;let Vi=is;w("os-crumb-chain",Vi);const Op=10;function Wp(s){const e=document.createElement("div");e.style.cssText=["display: inline-flex","align-items: stretch","border-radius: 999px","overflow: hidden","filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.18 ) )",'font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',"font-size: 12px","line-height: 1","font-weight: 500","position: fixed","top: -10000px","left: -10000px","pointer-events: none","z-index: 2147483647"].join("; ");const t=s.length,o=Hp();return s.forEach((i,n)=>{const r=document.createElement("span"),a=i.color??o.bg,l=i.color?Na(i.color):o.fg,u=Pa(n,t),h=["display: inline-flex","align-items: center","justify-content: center","min-height: 22px",`background: ${a}`,`color: ${l}`,"white-space: nowrap","box-sizing: border-box","letter-spacing: 0.01em"],p=Op;u==="solo"?h.push("padding: 2px 12px","border-radius: 999px"):u==="first"?h.push("padding: 2px 22px 2px 12px",`clip-path: polygon( 0 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, 0 100% )`):u==="middle"?h.push("padding: 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, calc( 100% - ${p}px ) 0, 100% 50%, calc( 100% - ${p}px ) 100%, ${p}px 100%, 0 50% )`):h.push("padding: 2px 14px 2px 22px",`margin-inline-start: -${p}px`,`clip-path: polygon( ${p}px 0, 100% 0, 100% 100%, ${p}px 100%, 0 50% )`),r.style.cssText=h.join("; "),r.textContent=i.name,e.appendChild(r)}),e}const Ta="rgba( 0, 0, 0, 0.08 )",Da="#1d2327";function Hp(){if(typeof document>"u"||!document.body)return{bg:Ta,fg:Da};const s=getComputedStyle(document.body);return{bg:s.getPropertyValue("--os-ui-crumb-bg").trim()||Ta,fg:s.getPropertyValue("--os-ui-crumb-fg").trim()||Da}}function Pa(s,e){return e===1?"solo":s===0?"first":s===e-1?"last":"middle"}let Fe=null;function Na(s){Fe||(Fe=document.createElement("canvas"),Fe.width=1,Fe.height=1);const e=Fe.getContext("2d",{willReadFrequently:!0});if(!e)return"#1d2327";try{e.clearRect(0,0,1,1),e.fillStyle=s,e.fillRect(0,0,1,1);const t=e.getImageData(0,0,1,1).data,o=t[3]/255,i=t[0]*o+255*(1-o),n=t[1]*o+255*(1-o),r=t[2]*o+255*(1-o),a=u=>{const h=u/255;return h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)};return .2126*a(i)+.7152*a(n)+.0722*a(r)>.55?"#1d2327":"#fff"}catch{return"#1d2327"}}function Up(){return N("close",{size:null})}const Ma="uncategorized",qp=1;function Ns(s){return s.id===qp?!0:(s.name||"").toLowerCase()===Ma}const ns=class ns extends _{constructor(){super(...arguments),this._items=[],this._value=[],this._query="",this._collapsed=new Set,this._focusedRow=-1,this._creatingValues=new Map,this._creatingPending=new Set,this._onCellClick=e=>{if(e.target?.closest(".os-cat-node")||this.isOpen)return;const o=this.disabled!==null,i=this.readonly!==null;o||i||this.openPicker()},this._onDocPointerDown=e=>{!this.isOpen||e.composedPath().includes(this)||this.closePicker()},this._onLayoutChange=()=>{this.isOpen&&this.closePicker()},this._onDocKeydown=e=>{this.isOpen&&e.key==="Escape"&&(e.preventDefault(),this.closePicker())}}get items(){return this._items}set items(e){this._items=Array.isArray(e)?e.slice():[],this.requestUpdate()}get value(){return this._value}set value(e){this._value=Array.isArray(e)?e.slice():[],this.requestUpdate()}get isOpen(){return this.open!==null}openPicker(){this.isOpen||(this.open="",this._query="",this._focusedRow=0,this.emit("os-categories-open",{}),queueMicrotask(()=>{this._positionPopover(),this._searchInput?.focus()}))}closePicker(){this.isOpen&&(this.open=null,this._query="",this._focusedRow=-1,this.emit("os-categories-close",{}),this.requestUpdate())}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onDocPointerDown,!0),document.addEventListener("keydown",this._onDocKeydown,!0),window.addEventListener("resize",this._onLayoutChange,{passive:!0}),window.addEventListener("scroll",this._onLayoutChange,{passive:!0,capture:!0})}disconnectedCallback(){document.removeEventListener("pointerdown",this._onDocPointerDown,!0),document.removeEventListener("keydown",this._onDocKeydown,!0),window.removeEventListener("resize",this._onLayoutChange),window.removeEventListener("scroll",this._onLayoutChange,{capture:!0})}get _searchInput(){return this.shadowRoot?.querySelector(".os-cat__search")??null}render(){const e=this.isOpen,t=this.disabled!==null,o=this.readonly!==null,i=this.loading!==null,n=this["add-label"]||"Categorize",r=this.placeholder||"Search categories…",a=Math.max(0,parseInt(this["max-visible"]||"2",10)||2);return c`
1745 <span class="os-cat" role="group">
1746 ${this._renderChipRow(a,o,t,n)}
1747 ${e?this._renderPopover(r,i):c``}
1748 </span>
1749 `}_renderChipRow(e,t,o,i){const n=this._selectedItemsInOrder();if(n.length===0)return c`
1750 <span class="os-cat__chips" role="list">
1751 <span
1752 class="os-cat__uncategorized"
1753 title=${'Posts with no category appear as "Uncategorized" in WordPress.'}
1754 @click=${this._onCellClick}
1755 >${"Uncategorized"}</span>
1756 </span>
1757 `;const r=this._buildChains(n);return c`
1758 <div
1759 class="os-cat__chains"
1760 role="list"
1761 @click=${this._onCellClick}
1762 >
1763 ${r.map(a=>this._renderChain(a,t,o))}
1764 </div>
1765 `}_buildChains(e){const t=new Map;for(const a of this._items)t.set(a.id,a);const o=new Set(e.map(a=>a.id)),i=a=>{for(const l of o){if(l===a)continue;let u=t.get(l),h=16;for(;u&&h-- >0;){if(u.parent===a)return!0;if(!u.parent)break;u=t.get(u.parent)}}return!1},n=e.filter(a=>!i(a.id)),r=[];for(const a of n){const l=[];let u=a,h=16;for(;u&&h-- >0&&((u===a||o.has(u.id))&&l.unshift(u),!!u.parent);)u=t.get(u.parent);const p=l.map(g=>({id:g.id,name:g.name}));r.push({id:a.id,segments:p})}return r}_renderChain(e,t,o){const i=!t&&!o,n=a=>{a.stopPropagation();const l=a.detail,u=typeof l?.index=="number"?l.index:e.segments.length-1,h=new Set;for(const g of e.segments.slice(u))typeof g.id=="number"&&h.add(g.id);const p=this._value.filter(g=>!h.has(g));p.length!==this._value.length&&this.emit("os-categories-change",{value:p})},r=document.createElement("os-crumb-chain");return r.segments=e.segments,i&&r.setAttribute("removable",""),r.addEventListener("os-chain-remove",n),c`<div role="listitem">${r}</div>`}_renderPopover(e,t){const o=this._buildTree(),i=this._filterTree(o,this._query),n=this._flattenForDisplay(i);return this._focusedRow>=n.length&&(this._focusedRow=n.length>0?n.length-1:-1),c`
1766 <div class="os-cat__popover" role="dialog" aria-label="Choose categories">
1767 <input
1768 class="os-cat__search"
1769 type="text"
1770 autocomplete="off"
1771 placeholder=${e}
1772 .value=${this._query}
1773 @input=${r=>this._onSearchInput(r)}
1774 @keydown=${r=>this._onSearchKeydown(r,n)}
1775 />
1776 <div class="os-cat__tree" role="listbox" aria-multiselectable="true">
1777 ${this._renderCreateRow(0,12,0,"")}
1778 ${this._renderTreeBody(t,n)}
1779 </div>
1780 <div class="os-cat__footer">
1781 <span class="dashicons dashicons-info-outline" aria-hidden="true"></span>
1782 <span>
1783 Posts with no category appear as
1784 <strong>Uncategorized</strong>.
1785 </span>
1786 </div>
1787 </div>
1788 `}_renderTreeBody(e,t){return e?c`
1789 <div class="os-cat__loading">
1790 <span class="os-cat__loading-spinner" aria-hidden="true"></span>
1791 ${"Loading categories…"}
1792 </div>
1793 `:t.length===0?c`
1794 <div class="os-cat__empty">
1795 ${this._items.length===0?"No categories yet — create one in WordPress to assign.":"No matches."}
1796 </div>
1797 `:t.map((o,i)=>this._renderRow(o,i,t.length))}_renderRow(e,t,o){const{node:i,hasChildren:n}=e,r=this._value.includes(i.item.id),a=!this._collapsed.has(i.item.id),l=12+i.depth*16,u=i.depth>0?i.depth*16:0,h=t===this._focusedRow;return c`
1798 <div class="os-cat__row-block">
1799 <div
1800 class="os-cat__row"
1801 role="option"
1802 aria-selected=${r?"true":"false"}
1803 data-selected=${r?"true":"false"}
1804 data-expanded=${a?"true":"false"}
1805 data-focused=${h?"true":"false"}
1806 data-row-id=${String(i.item.id)}
1807 style=${`--os-ui-cat-row-indent: ${l}px; --os-ui-cat-guide-width: ${u}px;`}
1808 @mouseenter=${()=>{this._focusedRow=t,this.requestUpdate()}}
1809 @click=${p=>{p.preventDefault(),this._toggleSelection(i.item.id)}}
1810 >
1811 ${n?c`<button
1812 type="button"
1813 class="os-cat__expander"
1814 aria-label=${a?"Collapse":"Expand"}
1815 @click=${p=>{p.stopPropagation(),this._toggleExpand(i.item.id)}}
1816 >${za()}</button>`:c`<span class="os-cat__expander os-cat__expander--placeholder" aria-hidden="true">${za()}</span>`}
1817 <span class="os-cat__check" aria-hidden="true">${Vp()}</span>
1818 <span class="os-cat__label">${this._highlight(i.item.name,this._query)}</span>
1819 ${Ns(i.item)?c``:c`<button
1820 type="button"
1821 class="os-cat__delete"
1822 aria-label=${`Delete ${i.item.name}`}
1823 title=${`Delete ${i.item.name}`}
1824 @click=${p=>this._onDeleteClick(p,i.item)}
1825 >${jp()}</button>`}
1826 </div>
1827 ${a&&!Ns(i.item)?this._renderCreateRow(i.item.id,12+(i.depth+1)*16,(i.depth+1)*16,i.item.name):c``}
1828 </div>
1829 `}_renderCreateRow(e,t,o,i){const n=this._creatingValues.get(e)??"",r=this._creatingPending.has(e),a=e===0?"Add new category…":`Add child of "${i}"…`;return c`
1830 <div
1831 class="os-cat__create-row"
1832 style=${`--os-ui-cat-row-indent: ${t}px; --os-ui-cat-guide-width: ${o}px;`}
1833 @click=${l=>l.stopPropagation()}
1834 >
1835 <div class="os-cat__create-wrap">
1836 <input
1837 class="os-cat__create-input"
1838 type="text"
1839 autocomplete="off"
1840 spellcheck="false"
1841 placeholder=${a}
1842 aria-label=${a}
1843 .value=${n}
1844 ?disabled=${r}
1845 @input=${l=>this._onCreateInput(l,e)}
1846 @keydown=${l=>this._onCreateKeydown(l,e)}
1847 />
1848 ${r?c`<span class="os-cat__create-spinner" aria-hidden="true"></span>`:c`<button
1849 type="button"
1850 class="os-cat__create-submit"
1851 aria-label=${e===0?"Create category":`Create child of ${i}`}
1852 ?disabled=${n.trim().length===0}
1853 @click=${l=>{l.stopPropagation(),this._submitCreate(e)}}
1854 >${Fp()}</button>`}
1855 </div>
1856 </div>
1857 `}_onCreateInput(e,t){const o=e.target.value;o===""?this._creatingValues.delete(t):this._creatingValues.set(t,o),this.requestUpdate()}_onCreateKeydown(e,t){if(e.key==="Escape"){e.preventDefault(),this._creatingValues.delete(t),this.requestUpdate();return}e.key==="Enter"&&(e.preventDefault(),this._submitCreate(t))}_submitCreate(e){const t=(this._creatingValues.get(e)??"").trim();!t||this._creatingPending.has(e)||(this._creatingPending.add(e),this.requestUpdate(),this.emit("os-categories-create",{name:t,parent:e}))}endCreating(e=0){this._creatingPending.delete(e),this._creatingValues.delete(e),this.requestUpdate()}failCreating(e=0,t){this._creatingPending.delete(e),this.requestUpdate()}_buildTree(){const e=new Map;for(const n of this._items)e.set(n.id,{item:n,children:[],depth:0});const t=[];for(const n of e.values()){const r=n.item.parent;r&&e.has(r)?e.get(r).children.push(n):t.push(n)}const o=(n,r)=>{n.depth=r;for(const a of n.children)o(a,r+1)};for(const n of t)o(n,0);const i=n=>{n.sort((r,a)=>{const l=Ns(r.item),u=Ns(a.item);return l!==u?l?-1:1:r.item.name.localeCompare(a.item.name)});for(const r of n)i(r.children)};return i(t),t}_filterTree(e,t){const o=t.trim().toLowerCase();if(!o)return e;const i=n=>{if(n.item.name.toLowerCase().includes(o))return{item:n.item,children:n.children.slice(),depth:n.depth};const a=n.children.map(i).filter(l=>l!==null);return a.length>0?{item:n.item,children:a,depth:n.depth}:null};return e.map(i).filter(n=>n!==null)}_flattenForDisplay(e){const t=[],o=this._query.trim()!=="",i=n=>{for(const r of n)t.push({node:r,visible:!0,hasChildren:r.children.length>0}),!(this._collapsed.has(r.item.id)&&!o)&&r.children.length>0&&i(r.children)};return i(e),t}_selectedItemsInOrder(){const e=new Map;for(const i of this._items)e.set(i.id,i);const t=[],o=[];for(const i of this._value){const n=e.get(i);n&&(n.name.toLowerCase()===Ma||n.id===1?o.push(n):t.push(n))}return t.length>0?t:o.length>0?[]:t}_highlight(e,t){const o=t.trim();if(!o)return e;const i=e.toLowerCase(),n=o.toLowerCase(),r=i.indexOf(n);return r===-1?e:c`${e.slice(0,r)}<span class="os-cat__match"
1858 >${e.slice(r,r+o.length)}</span
1859 >${e.slice(r+o.length)}`}_toggleSelection(e){const t=this._value.includes(e)?this._value.filter(o=>o!==e):[...this._value,e];this.emit("os-categories-change",{value:t})}_onDeleteClick(e,t){e.stopPropagation(),e.preventDefault(),this.emit("os-categories-delete",{id:t.id,name:t.name})}_toggleExpand(e){this._collapsed.has(e)?this._collapsed.delete(e):this._collapsed.add(e),this.requestUpdate()}_onSearchInput(e){this._query=e.target.value,this._focusedRow=0,this.requestUpdate()}_onSearchKeydown(e,t){switch(e.key){case"ArrowDown":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow+1>=t.length?0:this._focusedRow+1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowUp":{if(t.length===0)return;e.preventDefault(),this._focusedRow=this._focusedRow<=0?t.length-1:this._focusedRow-1,this.requestUpdate(),this._scrollFocusedIntoView();return}case"ArrowRight":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"ArrowLeft":{if(this._focusedRow<0||this._focusedRow>=t.length)return;const o=t[this._focusedRow];o.hasChildren&&!this._collapsed.has(o.node.item.id)&&(e.preventDefault(),this._toggleExpand(o.node.item.id));return}case"Enter":case" ":{if(this._focusedRow<0||this._focusedRow>=t.length)return;e.preventDefault();const o=t[this._focusedRow];this._toggleSelection(o.node.item.id);return}case"Escape":e.preventDefault(),this.closePicker()}}_scrollFocusedIntoView(){queueMicrotask(()=>{const e=this.shadowRoot?.querySelector(".os-cat__tree");if(!e)return;const t=e.querySelector('.os-cat__row[data-focused="true"]');if(!t)return;const o=t.getBoundingClientRect(),i=e.getBoundingClientRect();o.top<i.top?t.scrollIntoView({block:"nearest"}):o.bottom>i.bottom&&t.scrollIntoView({block:"nearest"})})}_positionPopover(){const e=this.shadowRoot?.querySelector(".os-cat__popover");if(!e)return;const t=this.getBoundingClientRect(),o=e.getBoundingClientRect(),i=window.innerWidth,n=window.innerHeight,r=8;let a=t.bottom+4;const l=a+o.height+r>n,u=t.top-4-o.height>=r;l&&u?a=t.top-4-o.height:l&&(a=Math.max(r,n-o.height-r));let h=t.left;h+o.width+r>i&&(h=t.right-o.width),h=Math.max(r,Math.min(h,i-o.width-r)),e.style.top=`${a}px`,e.style.left=`${h}px`}};ns.props=["placeholder","add-label","disabled","readonly","open","loading","max-visible"],ns.styles=[Mp],ns.help=void 0;let ji=ns;w("os-category-picker",ji);function za(){return N("chevron-right",{size:14})}function Fp(){return N("plus",{size:16})}function Vp(){return N("check",{size:null})}function jp(){return N("close",{size:null})}const Kp=v` ${C} ${ks}:host(:not( [ interactive ] ) ) .os-holo-glint,:host( [ disabled ] ) .os-holo-glint{display:none}:host{display:flex;flex-direction:column;position:relative;gap:var( --os-ui-card-gap,12px );padding:var( --os-ui-card-padding,16px );border:1px solid var( --os-ui-card-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-radius:var( --os-ui-card-radius,12px );background:var( --os-ui-card-bg,var( --os-ui-surface,#fff ) );background-image:var( --os-ui-panel-bg-image,none );background-repeat:var( --os-ui-panel-bg-image-repeat,repeat );background-size:var( --os-ui-panel-bg-image-size,auto );background-position:var( --os-ui-panel-bg-image-position,center );color:var( --os-ui-card-fg,inherit );box-sizing:border-box;min-width:0;transition:transform 180ms ease,box-shadow 180ms ease,border-color 180ms ease}:host( [ hidden ] ){display:none}:host( [ compact ] ){padding:var( --os-ui-card-padding-compact,10px );gap:var( --os-ui-card-gap-compact,6px );border-radius:var( --os-ui-card-radius-compact,8px )}:host( [ interactive ] ){cursor:pointer;outline-offset:2px}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:translateY( -2px );box-shadow:var( --os-ui-card-shadow-hover,0 4px 16px rgba( 0,0,0,0.08 ) );border-color:var( --os-ui-card-border-hover,var( --os-ui-border-strong,rgba( 0,0,0,0.16 ) ) )}:host( [ interactive ]:focus-visible ){outline:none;box-shadow:var( --_holo-focus )}:host( [ selected ] ){border-color:var( --os-ui-card-border-selected,var( --wp-admin-theme-color,#2271b1 ) );box-shadow:var( --os-ui-card-shadow-selected,0 0 0 1px var( --wp-admin-theme-color,#2271b1 ) inset )}:host( [ selected ] )::after{content:'';position:absolute;inset:-1px;border-radius:inherit;padding:1px;background-image:var( --_holo-edge );pointer-events:none;-webkit-mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );-webkit-mask-composite:xor;mask:linear-gradient( #000 0 0 ) content-box,linear-gradient( #000 0 0 );mask-composite:exclude}:host( [ disabled ] ){opacity:0.55;pointer-events:none;cursor:not-allowed}@media ( prefers-reduced-motion:reduce ){:host{transition:none}:host( [ interactive ]:hover ),:host( [ interactive ]:focus-visible ){transform:none}}::slotted( header ){display:flex;align-items:center;gap:12px;min-width:0}::slotted( footer ){display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto}`,Oa="[data-noclick]",rs=class rs extends _{constructor(){super(...arguments),this._onClick=e=>{!this.hasAttribute("interactive")||this.hasAttribute("disabled")||e.target?.closest(Oa)||this._emitCardClick(e)},this._onKeyDown=e=>{if(!this.hasAttribute("interactive")||this.hasAttribute("disabled")||e.key!=="Enter"&&e.key!==" "&&e.key!=="Spacebar")return;const t=e.target;t&&t!==this&&t.closest(Oa)||t instanceof HTMLElement&&t!==this&&(t.tagName==="BUTTON"||t.tagName==="A"||t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT")||(e.preventDefault(),this._emitCardClick(e))}}connectedCallback(){super.connectedCallback(),this._syncRoles(),this.addEventListener("click",this._onClick),this.addEventListener("keydown",this._onKeyDown)}disconnectedCallback(){this.removeEventListener("click",this._onClick),this.removeEventListener("keydown",this._onKeyDown)}render(){return this._syncRoles(),c`<span class="os-holo-glint" aria-hidden="true"></span
1860 ><slot name="header"></slot><slot></slot><slot name="footer"></slot>`}_syncRoles(){const e=this.hasAttribute("interactive"),t=this.hasAttribute("disabled");e?(this.hasAttribute("role")||this.setAttribute("role","button"),this.setAttribute("tabindex",t?"-1":"0"),this.setAttribute("aria-disabled",t?"true":"false")):(this.removeAttribute("role"),this.removeAttribute("tabindex"),this.removeAttribute("aria-disabled"))}_emitCardClick(e){this.dispatchEvent(new CustomEvent("os-card-click",{detail:{originalEvent:e},bubbles:!0,composed:!0}))}};rs.props=["interactive","selected","compact","disabled"],rs.styles=[Kp],rs.help=void 0;let Ki=rs;w("os-card",Ki);const Bp=v`:host{display:block;--_track:var( --os-ui-rating-track,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-rating-fill,linear-gradient( 90deg,#f5af00 0%,#ffd245 100% ) );--_star:var( --os-ui-rating-star,#f5af00 );--_star-empty:var( --os-ui-rating-star-empty,var( --os-ui-fg-faint,rgba( 0,0,0,0.18 ) ) );--_surface:var( --os-ui-rating-surface,var( --os-ui-surface-elevated,rgba( 255,255,255,0.7 ) ) );--_border:var( --os-ui-rating-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );--_fg:var( --os-ui-rating-fg,var( --os-ui-fg,inherit ) );--_fg-muted:var( --os-ui-rating-fg-muted,var( --os-ui-fg-muted,#666 ) )}:host( [ hidden ] ){display:none}.summary-card{display:grid;grid-template-columns:minmax( 140px,180px ) 1fr;gap:28px;align-items:center;padding:18px 20px;background:var( --_surface );border:1px solid var( --_border );border-radius:14px;color:var( --_fg )}.summary{display:flex;flex-direction:column;align-items:center;gap:8px;padding-inline-end:20px;border-inline-end:1px solid var( --_border )}.big{font-size:44px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums;letter-spacing:-0.02em;color:var( --_fg )}.stars{display:inline-flex;gap:2px;color:var( --_star )}.stars svg{width:16px;height:16px;display:block}.stars .empty{color:var( --_star-empty )}.total{font-size:12px;color:var( --_fg-muted )}.bars{display:grid;gap:6px;min-width:0}.row{display:grid;grid-template-columns:42px 1fr 60px;gap:12px;align-items:center;font-size:12.5px;color:var( --_fg-muted )}.row__label{display:inline-flex;align-items:center;gap:4px;font-variant-numeric:tabular-nums;font-weight:600}.row__label svg{width:11px;height:11px;color:var( --_star )}.row__track{position:relative;height:10px;background:var( --_track );border-radius:999px;overflow:hidden}.row__fill{position:absolute;inset:0;background:var( --_fill );border-radius:999px;transform-origin:left center;transform:scaleX( var( --ratio,0 ) );transition:transform 600ms cubic-bezier( 0.2,0.8,0.2,1 )}:host(:dir( rtl ) ) .row__fill,:host-context( [ dir='rtl' ] ) .row__fill{transform-origin:right center}.row__count{text-align:end;font-variant-numeric:tabular-nums;color:var( --_fg )}@media ( prefers-reduced-motion:reduce ){.row__fill{transition:none}}@media ( max-width:540px ){.summary-card{grid-template-columns:1fr;gap:16px}.summary{padding-inline-end:0;border-inline-end:0;border-block-end:1px solid var( --_border );padding-block-end:14px}}`,as=class as extends _{constructor(){super(...arguments),this._ratings={}}get ratings(){return{...this._ratings}}set ratings(e){this._ratings=e?{...e}:{},this.requestUpdate()}render(){const e=Gp(Wa(this,"rating")),t=e/100*5,o=Wa(this,"total"),i=o>0?o:(this._ratings[5]??0)+(this._ratings[4]??0)+(this._ratings[3]??0)+(this._ratings[2]??0)+(this._ratings[1]??0),n=new Intl.NumberFormat,r=e>0?(e/100*5).toFixed(1):"—";return c`
1861 <div class="summary-card" role="img" aria-label=${Xp(e,i)}>
1862 <div class="summary">
1863 <div class="big">${r}</div>
1864 <div class="stars" aria-hidden="true">
1865 ${Zp(t)}
1866 </div>
1867 <div class="total">
1868 ${i===1?"1 rating":`${n.format(i)} ratings`}
1869 </div>
1870 </div>
1871 <div class="bars">
1872 ${[5,4,3,2,1].map(a=>{const l=this._ratings[String(a)]??0,u=i===0?0:l/i;return c`
1873 <div
1874 class="row"
1875 role="presentation"
1876 aria-label=${`${a} stars: ${n.format(l)}`}
1877 >
1878 <span class="row__label">
1879 ${a} ${Ha()}
1880 </span>
1881 <span class="row__track">
1882 <span
1883 class="row__fill"
1884 style=${`--ratio: ${u.toFixed(4)}`}
1885 ></span>
1886 </span>
1887 <span class="row__count">${n.format(l)}</span>
1888 </div>
1889 `})}
1890 </div>
1891 </div>
1892 `}};as.props=["rating","total"],as.styles=[Bp],as.help=void 0;let Bi=as;function Wa(s,e){const t=s.getAttribute(e);if(t===null||t==="")return 0;const o=Number(t);return Number.isFinite(o)?o:0}function Gp(s){return s<0?0:s>100?100:s}function Xp(s,e){return e===0?"No ratings yet":`Average rating ${(s/100*5).toFixed(1)} out of 5, from ${e} ratings`}function Zp(s){const e=Math.floor(s),t=s-e>=.5?1:0,o=5-e-t,i=[];for(let n=0;n<e;n++)i.push(Ha());for(let n=0;n<t;n++)i.push(Yp());for(let n=0;n<o;n++)i.push(Jp());return i}function Ha(){return c`
1893 <svg viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
1894 <path
1895 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
1896 />
1897 </svg>
1898 `}function Yp(){return c`
1899 <svg viewBox="0 0 16 16" aria-hidden="true">
1900 <defs>
1901 <linearGradient id="os-half-star">
1902 <stop offset="50%" stop-color="currentColor" />
1903 <stop
1904 offset="50%"
1905 stop-color="currentColor"
1906 stop-opacity="0.22"
1907 />
1908 </linearGradient>
1909 </defs>
1910 <path
1911 fill="url(#os-half-star)"
1912 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
1913 />
1914 </svg>
1915 `}function Jp(){return c`
1916 <svg
1917 class="empty"
1918 viewBox="0 0 16 16"
1919 fill="currentColor"
1920 aria-hidden="true"
1921 >
1922 <path
1923 d="M8 1.5l2.06 4.17 4.6.67-3.33 3.25.79 4.58L8 12L3.88 14.17l.79-4.58L1.34 6.34l4.6-.67L8 1.5z"
1924 />
1925 </svg>
1926 `}w("os-rating-summary",Bi);const Qp=v`:host{display:flex;align-items:flex-start;gap:10px;width:100%;box-sizing:border-box;padding:10px 14px;font:var( --os-ui-notice-font,13px/1.5 var( --os-font,system-ui ) );color:var( --os-ui-notice-color,var( --os-ui-fg,#1d2327 ) );background:var( --os-ui-notice-bg,var( --os-ui-hover,rgba( 0,0,0,0.04 ) ) );border-block-end:1px solid var( --os-ui-notice-border,var( --os-ui-border,rgba( 0,0,0,0.08 ) ) );border-inline-start:4px solid var( --os-ui-notice-accent,var( --os-ui-border,#646970 ) )}:host( [ hidden ] ){display:none}.os-notice__icon{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;color:var( --os-ui-notice-accent,var( --os-ui-accent,#646970 ) )}.os-notice__icon[ hidden ]{display:none}.os-notice__label{flex:1;min-width:0;word-wrap:break-word}::slotted( a ){color:var( --os-ui-notice-link,var( --wp-admin-theme-color,#2271b1 ) );border-radius:2px}::slotted( a:hover ),::slotted( a:focus-visible ){color:var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) )}::slotted( a:focus-visible ){outline:2px solid var( --os-ui-notice-link-hover,var( --os-ui-accent-strong,#135e96 ) );outline-offset:2px}::slotted( p:first-child ){margin-block-start:0}::slotted( p:last-child ){margin-block-end:0}.os-notice__close{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;background:transparent;color:inherit;opacity:0.6;cursor:pointer;border-radius:4px;transition:opacity 0.12s ease,background-color 0.12s ease}.os-notice__close:hover{opacity:1;background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) )}.os-notice__close:focus-visible{opacity:1;outline:2px solid var( --wp-admin-theme-color,#2271b1 );outline-offset:1px}.os-notice__close[ hidden ]{display:none}.os-notice__close svg{width:14px;height:14px}:host( [ tone='info' ] ){--os-ui-notice-accent:var( --os-ui-notice-info,var( --os-ui-info-fg,#0969da ) );--os-ui-notice-bg:var( --os-ui-notice-info-bg,rgba( 9,105,218,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-info-border,rgba( 9,105,218,0.16 ) )}:host( [ tone='success' ] ){--os-ui-notice-accent:var( --os-ui-notice-success,var( --os-ui-success-fg,#1a7f37 ) );--os-ui-notice-bg:var( --os-ui-notice-success-bg,rgba( 26,127,55,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-success-border,rgba( 26,127,55,0.16 ) )}:host( [ tone='warning' ] ){--os-ui-notice-accent:var( --os-ui-notice-warning,var( --os-ui-warning-fg,#9a6700 ) );--os-ui-notice-bg:var( --os-ui-notice-warning-bg,rgba( 154,103,0,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-warning-border,rgba( 154,103,0,0.16 ) )}:host( [ tone='error' ] ),:host( [ tone='danger' ] ){--os-ui-notice-accent:var( --os-ui-notice-error,var( --os-ui-danger,#cf222e ) );--os-ui-notice-bg:var( --os-ui-notice-error-bg,rgba( 207,34,46,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-error-border,rgba( 207,34,46,0.16 ) )}:host( [ tone='neutral' ] ){--os-ui-notice-accent:var( --os-ui-notice-neutral,var( --os-ui-fg-muted,#57606a ) );--os-ui-notice-bg:var( --os-ui-notice-neutral-bg,rgba( 87,96,106,0.08 ) );--os-ui-notice-border:var( --os-ui-notice-neutral-border,rgba( 87,96,106,0.16 ) )}`,eg="desktop-mode-notice-dismissed";function tg(){const e=window.wp?.os?.config?.currentUserId;return typeof e=="number"&&e>0?String(e):"anon"}function Ua(){return`${eg}:${tg()}`}function Gi(){try{const s=window.localStorage.getItem(Ua());if(!s)return{};const e=JSON.parse(s);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return{}}function qa(s){try{window.localStorage.setItem(Ua(),JSON.stringify(s))}catch{}}function sg(s){return s?Gi()[s]===!0:!1}function og(s){if(!s)return;const e=Gi();e[s]=!0,qa(e)}function ig(s){if(!s)return;const e=Gi();e[s]&&(delete e[s],qa(e))}const ls=class ls extends _{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role","status"),this.hasAttribute("tone")||this.setAttribute("tone","info");const e=this.getAttribute("notice-id");e&&sg(e)&&(this.hidden=!0)}dismiss(){this.hidden=!0;const e=this.getAttribute("notice-id");e&&og(e),this.emit("os-notice-dismiss",{noticeId:e??void 0})}undismiss(){const e=this.getAttribute("notice-id");e&&ig(e),this.hidden=!1}render(){const e=this.getAttribute("icon"),t=!this.hasAttribute("not-dismissible");return c`
1927 <span
1928 class="os-notice__icon dashicons ${e??""}"
1929 ?hidden=${!e}
1930 aria-hidden="true"
1931 ></span>
1932 <span class="os-notice__label"><slot></slot></span>
1933 <button
1934 type="button"
1935 class="os-notice__close"
1936 ?hidden=${!t}
1937 aria-label=${d("Dismiss notice")}
1938 @click=${o=>this._onDismiss(o)}
1939 >
1940 ${N("close",{size:null})}
1941 </button>
1942 `}_onDismiss(e){e.preventDefault(),e.stopPropagation(),this.dismiss()}};ls.props=["tone","notDismissible","icon","noticeId"],ls.styles=[Qp],ls.help=void 0;let Xi=ls;w("os-notice",Xi);const ng=v` ${C} ${Pr}:host{display:block;--_track-bg:var( --os-ui-progress-track-bg,var( --os-ui-surface-sunken,rgba( 0,0,0,0.08 ) ) );--_fill:var( --os-ui-progress-fill,var( --wp-admin-theme-color,#2271b1 ) );--_height:var( --os-ui-progress-height,6px );--_radius:var( --os-ui-progress-radius,999px );--_label-color:var( --os-ui-progress-label-color,inherit );--_label-size:var( --os-ui-progress-label-size,12px );--_label-gap:var( --os-ui-progress-label-gap,4px );width:100%;font:inherit;color:var( --_label-color )}:host( [ hidden ] ){display:none}.header{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:var( --_label-gap );font-size:var( --_label-size );line-height:1.3}.label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.percent{font-variant-numeric:tabular-nums;opacity:0.75;flex-shrink:0}.track{position:relative;width:100%;height:var( --_height );background:var( --_track-bg );border-radius:var( --_radius );overflow:hidden}.fill{position:absolute;inset-block:0;inset-inline-start:0;width:0;background:var( --_fill );border-radius:inherit;transition:width 0.18s ease-out}:host( [ tone='success' ] ){--os-ui-progress-fill:var( --os-ui-success-fg,#3a8a3a )}:host( [ tone='warning' ] ){--os-ui-progress-fill:var( --os-ui-warning-fg,#dba617 )}:host( [ tone='danger' ] ){--os-ui-progress-fill:var( --os-ui-danger,#d63638 )}:host( [ indeterminate ] ) .fill{width:100%;transition:none;background-image:var( --_fill );background-size:300% 300%;background-repeat:no-repeat;animation:os-holo-shimmer 2.4s var( --_holo-loop ) infinite}:host( [ indeterminate ][ tone ] ) .fill{width:33%;background-image:none;animation:os-progress-sweep 1.1s linear infinite}@keyframes os-progress-sweep{0%{transform:translateX( -120% )}100%{transform:translateX( 320% )}}@media ( prefers-reduced-motion:reduce ){.fill{transition:none}:host( [ indeterminate ] ) .fill,:host( [ indeterminate ][ tone ] ) .fill{animation:none;width:100%;opacity:0.6}}`,cs=class cs extends _{constructor(){super(...arguments),this._ownedAriaLabel=null}render(){return c`<div class="root" part="root">
1943 <div class="header" part="header" hidden>
1944 <span class="label" part="label"></span>
1945 <span class="percent" part="percent"></span>
1946 </div>
1947 <div class="track" part="track">
1948 <div class="fill" part="fill"></div>
1949 </div>
1950 </div>`}requestUpdate(){super.requestUpdate(),queueMicrotask(()=>this._paint())}connectedCallback(){super.connectedCallback(),queueMicrotask(()=>this._paint())}_paint(){const e=this.shadowRoot;if(!e)return;const t=this._readMax(),o=this.hasAttribute("indeterminate")||t<=0,i=o?0:this._readValue(t),n=o?0:i/t,r=Math.round(n*100),a=this.getAttribute("label")??"",l=this.hasAttribute("show-percent"),u=e.querySelector(".fill");u&&!o?u.style.width=`${(n*100).toFixed(2)}%`:u&&o&&u.style.removeProperty("width");const h=e.querySelector(".header"),p=e.querySelector(".label"),g=e.querySelector(".percent");if(h&&p&&g){const m=a||l&&!o;h.hidden=!m,p.textContent=a,g.hidden=!(l&&!o),g.textContent=`${r}%`}this._syncAria(t,i,o,a);const b=e.querySelector(".track");b&&(b.setAttribute("role","progressbar"),b.setAttribute("aria-valuemin","0"),o?(b.removeAttribute("aria-valuenow"),b.removeAttribute("aria-valuemax")):(b.setAttribute("aria-valuemax",String(t)),b.setAttribute("aria-valuenow",String(i))),a?b.setAttribute("aria-label",a):b.removeAttribute("aria-label"))}_syncAria(e,t,o,i){this.setAttribute("role","progressbar"),this.setAttribute("aria-valuemin","0"),o?(this.removeAttribute("aria-valuenow"),this.removeAttribute("aria-valuemax")):(this.setAttribute("aria-valuemax",String(e)),this.setAttribute("aria-valuenow",String(t)));const n=this.getAttribute("aria-label");i?(n===null||n===this._ownedAriaLabel)&&(this.setAttribute("aria-label",i),this._ownedAriaLabel=i):n!==null&&n===this._ownedAriaLabel&&(this.removeAttribute("aria-label"),this._ownedAriaLabel=null)}_readMax(){const e=this.getAttribute("max");if(e===null)return 100;const t=parseFloat(e);return Number.isFinite(t)?t:100}_readValue(e){const t=parseFloat(this.getAttribute("value")??"0");return!Number.isFinite(t)||t<0?0:t>e?e:t}};cs.props=["value","max","indeterminate","tone","label","showPercent"],cs.styles=[ng],cs.help=void 0;let Zi=cs;w("os-progress-bar",Zi);const rg=v`:host{--_gap:var( --os-ui-field-row-gap,6px );--_label-width:var( --os-ui-field-row-label-width,12rem );display:flex;flex-direction:column;gap:var( --_gap );container-type:inline-size}:host( [ hidden ] ){display:none}.os-field-row__head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:0}.os-field-row__head:empty{display:none}.os-field-row__label{font-size:13px;font-weight:500;line-height:1.4;color:var( --os-ui-fg,#1d2327 );cursor:default}.os-field-row__required{margin-inline-start:2px;color:var( --os-ui-danger,#d63638 )}.os-field-row__action:empty{display:none}.os-field-row__control{min-width:0}.os-field-row__hint,.os-field-row__error{margin:0;font-size:12px;line-height:1.4}.os-field-row__hint{color:var( --os-ui-fg-muted,#646970 )}.os-field-row__error{color:var( --os-ui-danger,#d63638 )}:host( [ layout='inline' ] ){display:grid;grid-template-columns:var( --_label-width ) minmax( 0,1fr );align-items:start;column-gap:12px;row-gap:2px}:host( [ layout='inline' ] ) .os-field-row__head{grid-column:1;grid-row:1;padding-block-start:5px}:host( [ layout='inline' ] ) .os-field-row__control{grid-column:2;grid-row:1}:host( [ layout='inline' ] ) .os-field-row__hint,:host( [ layout='inline' ] ) .os-field-row__error{grid-column:2;grid-row:2}@container ( max-width:30rem ){:host( [ layout='inline' ] ){display:flex;flex-direction:column;gap:var( --_gap )}:host( [ layout='inline' ] ) .os-field-row__head{padding-block-start:0}}::slotted( input:where(:not( [ type='checkbox' ],[ type='radio' ] ) ) ),::slotted( select ),::slotted( textarea ){box-sizing:border-box;width:100%;padding:6px 8px;border-radius:4px;background:var( --os-ui-field-bg,#fff );border:1px solid var( --os-ui-field-border,#8c8f94 );color:var( --os-ui-field-fg,#2c3338 );font:inherit}`,ag='input, select, textarea, [contenteditable="true"], [role="textbox"], [role="combobox"], [os-field-control]';let lg=0;const ds=class ds extends _{constructor(){super(...arguments),this.uid=`os-field-row-${++lg}`,this.syncControl=()=>{const e=this.control;if(!e)return;const t=this.error,o=this.hint,i=this.hasAttribute("required");let n="";t?n=`${this.uid}-error`:o&&(n=`${this.uid}-hint`);const r=(e.getAttribute("aria-describedby")??"").split(/\s+/).filter(l=>l&&!l.startsWith(this.uid)),a=n?[...r,n]:r;a.length?e.setAttribute("aria-describedby",a.join(" ")):e.removeAttribute("aria-describedby"),t?e.setAttribute("aria-invalid","true"):e.getAttribute("aria-invalid")==="true"&&e.removeAttribute("aria-invalid"),i&&(e.setAttribute("required",""),e.setAttribute("aria-required","true"))},this.focusControl=()=>{const e=this.control;e&&e.focus?.()}}get control(){const e=this["control-id"];return e?Array.from(this.querySelectorAll("[id]")).find(t=>t.id===e)??null:this.querySelector(ag)}render(){const e=this.label||"",t=this.hint||"",o=this.error||"",i=this.hasAttribute("required");queueMicrotask(this.syncControl);let n=null;return o?n=c`<p
1951 class="os-field-row__error"
1952 id="${this.uid}-error"
1953 role="alert"
1954 >
1955 ${o}
1956 </p>`:t&&(n=c`<p class="os-field-row__hint" id="${this.uid}-hint">
1957 ${t}
1958 </p>`),c`
1959 <div class="os-field-row__head">
1960 ${e?c`<span
1961 class="os-field-row__label"
1962 id="${this.uid}-label"
1963 @click=${this.focusControl}
1964 >
1965 ${e}${i?c`<span
1966 class="os-field-row__required"
1967 aria-hidden="true"
1968 >*</span
1969 >`:null}
1970 </span>`:null}
1971 <span class="os-field-row__action"><slot name="action"></slot></span>
1972 </div>
1973 <div class="os-field-row__control">
1974 <slot @slotchange=${this.syncControl}></slot>
1975 </div>
1976 ${n}
1977 `}};ds.props=["label","hint","error","required","layout","control-id"],ds.styles=[rg],ds.help=void 0;let Yi=ds;w("os-field-row",Yi);const cg=v`:host{--_gap:var( --os-ui-repeater-gap,8px );--_row-bg:var( --os-ui-repeater-row-bg,var( --os-ui-surface,#fff ) );--_border:var( --os-ui-repeater-row-border,var( --os-ui-border,#dcdcde ) );display:flex;flex-direction:column;gap:var( --_gap )}:host( [ hidden ] ){display:none}.os-repeater__rows{display:flex;flex-direction:column;gap:var( --_gap )}.os-repeater__row{display:flex;align-items:start;gap:6px;padding:8px;border:1px solid var( --_border );border-radius:6px;background:var( --_row-bg )}.os-repeater__content{flex:1 1 auto;min-width:0}.os-repeater__handles{display:flex;flex-direction:column;gap:2px;flex:0 0 auto}.os-repeater__handle,.os-repeater__remove{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:4px;background:transparent;color:var( --os-ui-fg-muted,#646970 );cursor:pointer}.os-repeater__handle:hover:not(:disabled ),.os-repeater__remove:hover:not(:disabled ){background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) );color:var( --os-ui-fg,#1d2327 )}.os-repeater__remove:hover:not(:disabled ){color:var( --os-ui-danger,#d63638 )}.os-repeater__handle:disabled,.os-repeater__remove:disabled{opacity:0.4;cursor:default}.os-repeater__handle:focus-visible,.os-repeater__remove:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:1px}.os-repeater__remove{flex:0 0 auto}.os-repeater__empty{padding:12px;border:1px dashed var( --_border );border-radius:6px;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-repeater__empty:has( slot[ name='empty' ]:not(:has( * ) ) ):empty{display:none}.os-repeater__footer{display:flex;align-items:center;gap:8px}`,us=class us extends _{constructor(){super(...arguments),this._keys=[],this.onAdd=()=>{this.isDisabled||this.emit("os-repeater-add",{keys:[...this._keys]})},this.onKeydown=e=>{if(!e.altKey||!this.hasAttribute("reorderable"))return;let t=0;if(e.key==="ArrowUp"?t=-1:e.key==="ArrowDown"&&(t=1),t===0)return;const i=e.target?.closest?.('[slot^="row-"]')?.getAttribute("slot")?.slice(4);i&&(e.preventDefault(),this.onMove(i,t))}}get keys(){return this._keys}set keys(e){this._keys=Array.isArray(e)?[...e]:[],this.requestUpdate()}get isDisabled(){return this.hasAttribute("disabled")}numeric(e){const t=this.getAttribute(e);if(t===null||t.trim()==="")return null;const o=Number(t);return Number.isFinite(o)?o:null}onRemove(e){if(this.isDisabled)return;const t=this._keys.indexOf(e);this.emit("os-repeater-remove",{key:e,index:t,keys:this._keys.filter(o=>o!==e)})}onMove(e,t){if(this.isDisabled)return;const o=this._keys.indexOf(e),i=o+t;if(o<0||i<0||i>=this._keys.length)return;const n=[...this._keys];n.splice(i,0,...n.splice(o,1)),this.emit("os-repeater-move",{key:e,from:o,to:i,keys:n})}render(){const e=this._keys,t=this.isDisabled,o=this.hasAttribute("reorderable"),i=this,n=i["row-label"]||"row",r=i["add-label"]||"Add row",a=i["empty-text"]||"",l=this.numeric("min"),u=this.numeric("max"),h=l===null||e.length>l,p=u===null||e.length<u;return c`
1978 <div class="os-repeater__rows" @keydown=${this.onKeydown}>
1979 ${e.length===0?c`<div class="os-repeater__empty">
1980 <slot name="empty">${a}</slot>
1981 </div>`:e.map((g,b)=>c`
1982 <div class="os-repeater__row" data-key=${g}>
1983 ${o?c`<div class="os-repeater__handles">
1984 <button
1985 type="button"
1986 class="os-repeater__handle"
1987 ?disabled=${t||b===0}
1988 aria-label="Move ${n} up"
1989 @click=${()=>this.onMove(g,-1)}
1990 >
1991 <os-icon name="arrow-up-alt2" size="14"></os-icon>
1992 </button>
1993 <button
1994 type="button"
1995 class="os-repeater__handle"
1996 ?disabled=${t||b===e.length-1}
1997 aria-label="Move ${n} down"
1998 @click=${()=>this.onMove(g,1)}
1999 >
2000 <os-icon name="arrow-down-alt2" size="14"></os-icon>
2001 </button>
2002 </div>`:null}
2003 <div class="os-repeater__content">
2004 <slot name="row-${g}"></slot>
2005 </div>
2006 <button
2007 type="button"
2008 class="os-repeater__remove"
2009 ?disabled=${t||!h}
2010 aria-label="Remove ${n}"
2011 @click=${()=>this.onRemove(g)}
2012 >
2013 <os-icon name="trash" size="14"></os-icon>
2014 </button>
2015 </div>
2016 `)}
2017 </div>
2018 <div class="os-repeater__footer">
2019 <os-button
2020 variant="secondary"
2021 size="small"
2022 ?disabled=${t||!p}
2023 @click=${this.onAdd}
2024 >${r}</os-button
2025 >
2026 <slot name="footer"></slot>
2027 </div>
2028 `}};us.props=["add-label","empty-text","disabled","reorderable","min","max","row-label"],us.styles=[cg],us.help=void 0;let Ji=us;w("os-repeater",Ji);const dg=v`:host{--_bg:var( --os-ui-token-field-bg,var( --os-ui-field-bg,#fff ) );--_border:var( --os-ui-token-field-border,var( --os-ui-field-border,#8c8f94 ) );--_fg:var( --os-ui-token-field-fg,var( --os-ui-field-fg,#2c3338 ) );--_chip-bg:var( --os-ui-token-field-chip-bg,var( --os-ui-surface-raised,rgba( 0,0,0,0.06 ) ) );display:block;position:relative}:host( [ hidden ] ){display:none}.os-token-field{display:flex;flex-direction:column;gap:6px}.os-token-field__label{font-size:13px;font-weight:500;color:var( --os-ui-fg,#1d2327 )}.os-token-field__input{box-sizing:border-box;width:100%;padding:6px 8px;border-radius:4px;background:var( --_bg );border:1px solid var( --_border );color:var( --_fg );font:inherit;resize:vertical}.os-token-field__input:focus-visible{outline:2px solid var( --os-ui-accent,#2271b1 );outline-offset:1px}.os-token-field__input:disabled{opacity:0.6}.os-token-field__toolbar{display:flex;align-items:center;gap:6px}.os-token-field__catalogue{position:absolute;inset-inline-start:0;inset-block-start:100%;z-index:20;max-height:18rem;overflow-y:auto;width:100%;padding:4px;box-sizing:border-box;border:1px solid var( --os-ui-border,#dcdcde );border-radius:6px;background:var( --os-ui-surface-elevated,#fff );box-shadow:0 8px 24px rgba( 0,0,0,0.18 )}.os-token-field__group{margin:6px 6px 2px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.04em;color:var( --os-ui-fg-faint,#8c8f94 )}.os-token-field__option{display:grid;grid-template-columns:minmax( 0,1fr ) auto;gap:2px 8px;width:100%;padding:6px 8px;border:0;border-radius:4px;background:transparent;color:var( --os-ui-fg,#1d2327 );font:inherit;text-align:start;cursor:pointer}.os-token-field__option:hover,.os-token-field__option:focus-visible{background:var( --os-ui-hover,rgba( 0,0,0,0.06 ) );outline:none}.os-token-field__option-label{font-size:13px;min-width:0}.os-token-field__option-token{grid-column:2;grid-row:1;padding:1px 5px;border-radius:3px;background:var( --_chip-bg );font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-token-field__option-sample,.os-token-field__option-description{grid-column:1 / -1;font-size:11px;color:var( --os-ui-fg-muted,#646970 )}.os-token-field__option-sample{font-style:italic}.os-token-field__hint{margin:0;font-size:12px;color:var( --os-ui-fg-muted,#646970 )}.os-token-field__preview{display:flex;gap:6px;margin:0;font-size:12px;line-height:1.4;color:var( --os-ui-fg-muted,#646970 )}.os-token-field__preview-label{flex:0 0 auto;font-weight:600}.os-token-field__preview-body{min-width:0;overflow-wrap:anywhere;white-space:pre-wrap}`,hs=class hs extends _{constructor(){super(...arguments),this._tokens=[],this._value="",this.caret=null,this.onInput=e=>{const t=e.target;this._value=t.value,this.emit("os-token-field-input",{value:this._value}),this.requestUpdate()},this.rememberCaret=()=>{const e=this.field;e&&(this.caret={start:e.selectionStart??e.value.length,end:e.selectionEnd??e.value.length})},this.toggleCatalogue=()=>{if(!(this.hasAttribute("disabled")||this.hasAttribute("readonly"))){if(this.isOpen){this.removeAttribute("open");return}this.rememberCaret(),this.setAttribute("open","")}},this.onKeydown=e=>{e.key==="Escape"&&this.isOpen&&(e.stopPropagation(),this.removeAttribute("open"),this.field?.focus())}}get tokens(){return this._tokens}set tokens(e){this._tokens=Array.isArray(e)?[...e]:[],this.requestUpdate()}get value(){return this._value}set value(e){this._value=typeof e=="string"?e:"";const t=this.field;t&&t.value!==this._value&&(t.value=this._value),this.requestUpdate()}get field(){return this.shadowRoot?.querySelector(".os-token-field__input")??null}get isOpen(){return this.hasAttribute("open")}grouped(){const e=new Map;for(const t of this._tokens){const o=t.group??"",i=e.get(o);i?i.push(t):e.set(o,[t])}return[...e.entries()].sort((t,o)=>t[0]===""?1:o[0]===""?-1:0)}preview(){let e=this._value,t=!1;for(const o of this._tokens)!o.sample||!e.includes(o.token)||(e=e.split(o.token).join(o.sample),t=!0);return t?e:null}insert(e){const t=this.field,o=this.caret??{start:this._value.length,end:this._value.length},i=this._value.slice(0,o.start),n=this._value.slice(o.end);this._value=`${i}${e.token}${n}`,this.removeAttribute("open"),t&&(t.value=this._value),this.emit("os-token-insert",{token:e.token,value:this._value}),this.emit("os-token-field-input",{value:this._value}),this.requestUpdate();const r=i.length+e.token.length;this.caret={start:r,end:r},queueMicrotask(()=>{const a=this.field;a?.focus(),a?.setSelectionRange?.(r,r)})}render(){const e=this.label||"",t=this.hint||"",o=this.placeholder||"",i=this,n=i["insert-label"]||"Insert a value",r=i["preview-label"]||"Reads as",a=this.hasAttribute("multiline"),l=this.hasAttribute("disabled"),u=this.hasAttribute("readonly"),h=Number(this.getAttribute("rows"))||4,p=this.preview(),g=this.grouped(),b=a?c`<textarea
2029 class="os-token-field__input"
2030 rows=${h}
2031 placeholder=${o}
2032 ?disabled=${l}
2033 ?readonly=${u}
2034 .value=${this._value}
2035 @input=${this.onInput}
2036 @keyup=${this.rememberCaret}
2037 @click=${this.rememberCaret}
2038 @blur=${this.rememberCaret}
2039 ></textarea>`:c`<input
2040 type="text"
2041 class="os-token-field__input"
2042 placeholder=${o}
2043 ?disabled=${l}
2044 ?readonly=${u}
2045 .value=${this._value}
2046 @input=${this.onInput}
2047 @keyup=${this.rememberCaret}
2048 @click=${this.rememberCaret}
2049 @blur=${this.rememberCaret}
2050 />`;return c`
2051 <div class="os-token-field" @keydown=${this.onKeydown}>
2052 ${e?c`<span class="os-token-field__label">${e}</span>`:null}
2053 ${b}
2054 <div class="os-token-field__toolbar">
2055 <os-button
2056 variant="ghost"
2057 size="small"
2058 ?disabled=${l||u||g.length===0}
2059 aria-expanded=${this.isOpen?"true":"false"}
2060 @click=${this.toggleCatalogue}
2061 >
2062 <os-icon name="editor-code" size="14"></os-icon>
2063 ${n}
2064 </os-button>
2065 <slot name="action"></slot>
2066 </div>
2067 ${this.isOpen?c`<div
2068 class="os-token-field__catalogue"
2069 role="listbox"
2070 aria-label=${n}
2071 >
2072 ${g.map(([m,x])=>c`
2073 ${m?c`<p class="os-token-field__group">${m}</p>`:null}
2074 ${x.map(y=>c`
2075 <button
2076 type="button"
2077 role="option"
2078 class="os-token-field__option"
2079 @click=${()=>this.insert(y)}
2080 >
2081 <span class="os-token-field__option-label"
2082 >${y.label}</span
2083 >
2084 <code class="os-token-field__option-token"
2085 >${y.token}</code
2086 >
2087 ${y.sample?c`<span class="os-token-field__option-sample"
2088 >${y.sample}</span
2089 >`:null}
2090 ${y.description?c`<span
2091 class="os-token-field__option-description"
2092 >${y.description}</span
2093 >`:null}
2094 </button>
2095 `)}
2096 `)}
2097 </div>`:null}
2098 ${t?c`<p class="os-token-field__hint">${t}</p>`:null}
2099 ${p!==null?c`<p class="os-token-field__preview">
2100 <span class="os-token-field__preview-label"
2101 >${r}</span
2102 >
2103 <span class="os-token-field__preview-body">${p}</span>
2104 </p>`:null}
2105 </div>
2106 `}};hs.props=["label","placeholder","hint","multiline","rows","disabled","readonly","insert-label","preview-label","open"],hs.styles=[dg],hs.help=void 0;let Qi=hs;w("os-token-field",Qi);const ug=["os-section","os-button","os-swatch","os-swatch-grid","os-segmented","os-segment","os-select","os-option","os-multiselect","os-color-field","os-range-field","os-text-field","os-number-field","os-checkbox","os-checkbox-label","os-switch","os-toast","os-toast-container","os-tabs","os-tab","os-tabpanel","os-window-button","os-menu","os-menu-item","os-action-menu","os-context-menu","os-context-menu-option","os-confirm-dialog","os-modal","os-user-search","os-role-picker","os-flyout","os-coachmark","os-tooltip","os-tab-chip","os-stack","os-cluster","os-icon","os-body","os-panel","os-row","os-grid","os-app-frame","os-split","os-display","os-disclosure","os-empty-state","os-key","os-code","os-badge","os-ribbon","os-tile","os-log","os-steps","os-step","os-table","os-spinner","os-relative-time","os-histogram","os-fact","os-facts","os-stat","os-avatar","os-textarea","os-chip","os-tag-input","os-form","os-save-status","os-category-picker","os-crumb-chain","os-card","os-rating-summary","os-notice","os-progress-bar","os-field-row","os-repeater","os-token-field"];function hg(s,e,t,o){const i=[s,e,...o];if(t){i.push(t.summary??"",t.status??"");for(const n of[t.props,t.slots,t.events,t.parts,t.cssProps])for(const r of n??[]){const{name:a,description:l}=r;i.push(a??"",l??"")}}return i.join(" ").toLowerCase()}function Fa(s,e){return e.toLowerCase().split(/\s+/).filter(Boolean).every(o=>s.haystack.includes(o))}function pg(s){const e=s.replace(/^os-/,"").replace(/-/g," ");return e.charAt(0).toUpperCase()+e.slice(1)}function en(){const s=[];for(const e of ug){const t=customElements.get(e);if(!t)continue;const o=t.help??null,i=o?.title??pg(e),n=t.props??[];s.push({tag:e,title:i,help:o,props:n,haystack:hg(e,i,o,n)})}return s.sort((e,t)=>e.title.localeCompare(t.title)),s}const gg=["<!-- 1 — invented name, nothing close in the registry. -->","<os-example-console-fail-due-to-unregistered-component>","</os-example-console-fail-due-to-unregistered-component>","","<!-- 2 — typo within edit distance of a real tag. -->","<os-buton></os-buton>"].join(`
2107 `);let Va=!1;function fg(){if(Va)return;Va=!0,console.log(`%c⚠ wp.os — INTENTIONAL DEMO%c
2108 The next two console.error entries are fired ON PURPOSE by the
2109 OpenStation Preferences → Components tab to demonstrate the <os-*> missing-
2110 import warner. They are not real bugs.
2111
2112 1. <os-example-console-fail-due-to-unregistered-component>
2113 2. <os-buton> (typo of <os-button>)
2114
2115 Source: apps/os-settings/parts/components.ts — the "Missing-import
2116 warner — live demo" section. Remove that section in your fork
2117 if you want a quieter Components tab.`,"background: #ffb400;color: #1a1a1a;font-weight: 700;font-size: 12px;padding: 4px 8px;border-radius: 3px","color: #b25c00;font-weight: 500")}const bg=s=>{switch(s){case"experimental":return d("Experimental");case"planned":return d("Planned");default:return d("Stable")}},Ms=(s,e,t)=>e?.length?c`<section class="os-settings__help-group">
2118 <h4>${s}</h4>
2119 <ul class="os-settings__help-list">${e.map(o=>c`<li>${t(o)}</li>`)}</ul>
2120 </section>`:"",zs=s=>s?c` — ${s}`:"";function mg(s){const e=s.help?.props??[],t=new Set(e.map(i=>i.name)),o=s.props.filter(i=>!t.has(i));return e.length===0&&o.length===0?"":c`
2121 <section class="os-settings__help-group">
2122 <h4>${d("Props")}</h4>
2123 <table class="os-settings__help-table">
2124 <thead>
2125 <tr>
2126 <th>${d("Name")}</th>
2127 <th>${d("Type")}</th>
2128 <th>${d("Default")}</th>
2129 <th>${d("Description")}</th>
2130 </tr>
2131 </thead>
2132 <tbody>
2133 ${e.map(i=>c`<tr>
2134 <td><code>${i.name}</code></td>
2135 <td>${i.type??"—"}</td>
2136 <td>${i.default??"—"}</td>
2137 <td>${i.description??""}</td>
2138 </tr>`)}
2139 ${o.map(i=>c`<tr>
2140 <td><code>${i}</code></td>
2141 <td>—</td>
2142 <td>—</td>
2143 <td><em>${d("Undocumented — declared via static props.")}</em></td>
2144 </tr>`)}
2145 </tbody>
2146 </table>
2147 </section>
2148 `}function vg(s){const e=s.help,t=e?.status??"stable";return c`
2149 <header class="os-settings__help-head">
2150 <h3 class="os-settings__help-title">${s.title}</h3>
2151 <code class="os-settings__help-code">&lt;${s.tag}&gt;</code>
2152 <span class="os-settings__help-badge is-${t}">${bg(t)}</span>
2153 </header>
2154 ${e?.summary?c`<p class="os-settings__help-summary">${e.summary}</p>`:""}
2155 ${e?.example?c`<section class="os-settings__help-group">
2156 <h4>${d("Example")}</h4>
2157 <div class="os-settings__help-example">${e.example}</div>
2158 </section>`:""}
2159 ${mg(s)}
2160 ${Ms(d("Slots"),e?.slots,o=>c`<code>${o.name}</code>${zs(o.description)}`)}
2161 ${Ms(d("Events"),e?.events,o=>c`<code>${o.name}</code>${o.detail?c` — <code>${o.detail}</code>`:""}${zs(o.description)}`)}
2162 ${Ms(d("Shadow parts"),e?.parts,o=>c`<code>::part(${o.name})</code>${zs(o.description)}`)}
2163 ${Ms(d("CSS custom properties"),e?.cssProps,o=>c`<code>${o.name}</code>${o.default?c` (${d("default")} <code>${o.default}</code>)`:""}${zs(o.description)}`)}
2164 ${e?"":c`<p class="os-settings__help-note">
2165 ${d("This component has no help descriptor yet. Add `static help` to its class for a fuller reference.")}
2166 </p>`}
2167 `}const _g=()=>c`
2168 <os-disclosure
2169 class="os-settings__help-warner-section"
2170 heading=${d("Missing-import warner — live demo")}
2171 hint=${d("Developer mode")}
2172 >
2173 <div class="os-settings__help-warner">
2174 <p class="os-settings__help-warner-text">
2175 ${d('Both <os-*> tags in the next piece of code are intentionally bogus, one per answer the warner has. Open the browser console: within ~2 seconds you should see two console.error entries from the framework, each pointing the developer at the fix — a name nothing in the registry comes close to, and a typo the warner can suggest a fix for ("did you mean"). Live copies of the same two tags are rendered off-screen, so the demo fires without affecting layout — including while this section is folded away. Remove this section in your fork if you want a quieter Components tab.')}
2176 </p>
2177 <pre class="os-settings__help-warner-code"><code>${gg}</code></pre>
2178 </div>
2179 </os-disclosure>
2180 <!--
2181 The live copies. Real elements, because the warner watches the
2182 document for tags nothing registered. Clipped rather than
2183 display:none, and OUTSIDE the disclosure (a closed disclosure's
2184 body is display:none), so the upgrade path runs exactly as it
2185 would on a visible element.
2186 -->
2187 <div
2188 class="os-settings__help-warner-demo"
2189 aria-hidden="true"
2190 os-preserve
2191 style="position:absolute;width:0;height:0;overflow:hidden;clip:rect(0 0 0 0);"
2192 >
2193 <os-example-console-fail-due-to-unregistered-component></os-example-console-fail-due-to-unregistered-component>
2194 <os-buton></os-buton>
2195 </div>
2196 `;function ja(s){const e=S(s).components;return e.entries??(e.entries=en()),e.entries}function Ka(s){const e=S(s).components,t=ja(s).filter(o=>Fa(o,e.query));return t.find(o=>o.tag===e.activeTag)??t[0]}const wg=(s,e)=>{const t=S(e).components;s.developerModeEnabled&&fg();const o=ja(e).filter(n=>Fa(n,t.query)),i=Ka(e);return c`
2197 ${s.developerModeEnabled?_g():""}
2198 <div class="os-settings__help-layout">
2199 <div class="os-settings__help-sidebar">
2200 <os-text-field
2201 class="os-settings__help-search"
2202 type="search"
2203 label=${d("Search components")}
2204 placeholder=${d("Name, tag, prop, event…")}
2205 autocomplete="off"
2206 value=${t.query}
2207 @os-input-change=${n=>{t.query=W(n).trim(),e.repaint()}}
2208 ></os-text-field>
2209 <nav class="os-settings__help-nav" aria-label=${d("Components")}>
2210 ${o.length?"":c`<p class="os-settings__help-nav-empty">${d("No components match.")}</p>`}
2211 ${o.map(n=>c`<button
2212 type="button"
2213 class=${n.tag===i?.tag?"os-settings__help-nav-item is-active":"os-settings__help-nav-item"}
2214 aria-pressed=${n.tag===i?.tag?"true":"false"}
2215 @click=${()=>{t.activeTag=n.tag,e.repaint()}}
2216 >
2217 <span class="os-settings__help-nav-title">${n.title}</span>
2218 <span class="os-settings__help-nav-tag">&lt;${n.tag}&gt;</span>
2219 </button>`)}
2220 </nav>
2221 </div>
2222 <div class="os-settings__help-detail">
2223 ${i?vg(i):c`<p>${d("No components registered.")}</p>`}
2224 </div>
2225 </div>
2226 `};function yg(s){const e=S(s).components,t=s.root.querySelector(".os-settings__help-detail");if(!t)return;const o=Ka(s),i=o?.tag??"";i!==e.paintedTag&&(t.scrollTop=0,e.paintedTag=i);const n=o?.help?.exampleInit,r=t.querySelector(".os-settings__help-example");if(!(!n||!r||r.hasAttribute("data-os-example-ready"))){r.setAttribute("data-os-example-ready",""),customElements.upgrade(r);try{n(r)}catch(a){console.error(`[openstation] <${i}> exampleInit threw:`,a)}}}const Ba="https://openstation.blog/",Ga="https://openstation.blog/feed/",xg="https://github.com/WordPress/openstation/";function tn(s){if(typeof s!="string"||s==="")return"";try{const e=new URL(s,window.location.href);return e.protocol==="http:"||e.protocol==="https:"?e.href:""}catch{return""}}const Ie=s=>typeof s=="string"?s.trim():"";function kg(s){if(!s||typeof s!="object")return null;const e=s,t=(Array.isArray(e.items)?e.items:[]).map(o=>{if(!o||typeof o!="object")return null;const i=o,n=Ie(i.title),r=tn(i.url);return n===""||r===""?null:{title:n,url:r,author:Ie(i.author),publishedAt:Ie(i.publishedAt),excerpt:Ie(i.excerpt)}}).filter(o=>o!==null).slice(0,5);return{title:Ie(e.title)||d("OpenStation"),description:Ie(e.description)||d("A public dev diary — building a desktop OS for wp-admin."),homeUrl:tn(e.homeUrl)||Ba,feedUrl:tn(e.feedUrl)||Ga,items:t,stale:e.stale===!0}}function $g(s){if(s==="")return"";const e=new Date(s);return Number.isNaN(e.getTime())?"":e.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Xa(s){const e=$g(s.publishedAt);return e&&s.author?F("%1$s · %2$s",e,s.author):e||s.author}const Ag=s=>c`
2227 <article class="os-settings__about-featured">
2228 <a href=${s.url} target="_blank" rel="noopener noreferrer">
2229 <div class="os-settings__about-featured-copy">
2230 <span class="os-settings__about-kicker">${d("Latest dispatch")}</span>
2231 <h3>${s.title}</h3>
2232 ${s.excerpt?c`<p>${s.excerpt}</p>`:""}
2233 </div>
2234 <footer>
2235 <span>${Xa(s)}</span>
2236 <strong>${d("Read the dispatch")} <span aria-hidden="true">↗</span></strong>
2237 </footer>
2238 </a>
2239 </article>
2240 `,Eg=s=>c`
2241 <article class="os-settings__about-card" role="listitem">
2242 <a href=${s.url} target="_blank" rel="noopener noreferrer">
2243 <span class="os-settings__about-card-meta">${Xa(s)}</span>
2244 <h3>${s.title}</h3>
2245 ${s.excerpt?c`<p>${s.excerpt}</p>`:""}
2246 <strong>${d("Read more")} <span aria-hidden="true">↗</span></strong>
2247 </a>
2248 </article>
2249 `,sn=(s,e,t,o="",i=!1)=>c`
2250 <div class=${`os-settings__about-status${o}`} role=${t} aria-live=${t==="status"?"polite":null}>
2251 ${i?c`<span class="os-settings__about-spinner" aria-hidden="true"></span>`:c`<span class="dashicons dashicons-rss" aria-hidden="true"></span>`}
2252 <div>
2253 <strong>${s}</strong>
2254 <span>${e}</span>
2255 </div>
2256 </div>
2257 `;function Sg(s){if(s.kind==="loading")return sn(d("Opening the journal…"),d("The latest posts are arriving over RSS."),"status","",!0);if(s.kind==="error")return sn(d("The journal could not be reached."),d("You can still read every post on openstation.blog."),"alert"," os-settings__about-status--error");if(s.feed.items.length===0)return sn(d("No dispatches yet."),d("The journal is open and waiting for its next post."),"status");const[e,...t]=s.feed.items;return c`
2258 ${s.feed.stale?c`<p class="os-settings__about-stale" role="status">
2259 ${d("Showing the last saved copy while the journal reconnects.")}
2260 </p>`:""}
2261 <section class="os-settings__about-feed" aria-label=${d("Latest journal posts")}>
2262 ${Ag(e)}
2263 ${t.length>0?c`<div class="os-settings__about-grid" role="list">${t.map(Eg)}</div>`:""}
2264 </section>
2265 `}function Cg(s,e){const t=e.kind==="ready"?e.feed:null,o=`${s.pluginUrl??""}/assets/images/openstation-mark.svg`,i=s.pluginVersion??"";return c`
2266 <div class="os-settings__about-inner">
2267 <header class="os-settings__about-overview">
2268 <div class="os-settings__about-identity">
2269 <img src=${o} alt="" width="64" height="64" />
2270 <div>
2271 <span class="os-settings__about-eyebrow">${d("About OpenStation")}</span>
2272 <h2>${d("A desktop for WordPress.")}</h2>
2273 <p>
2274 ${d("OpenStation reshapes wp-admin into a personal workspace, with movable windows, a dock, themes, and focused tools that keep your site close at hand.")}
2275 </p>
2276 </div>
2277 </div>
2278 <div class="os-settings__about-story">
2279 <p>
2280 ${d("It is a playful, open-source experiment by Automattic exploring what WordPress can feel like when the dashboard becomes a place of its own.")}
2281 </p>
2282 <div class="os-settings__about-meta">
2283 <span>
2284 <strong>OpenStation${i?` ${i}`:""}</strong>
2285 <small>${d("An experiment by Automattic")}</small>
2286 </span>
2287 <a href=${xg} target="_blank" rel="noopener noreferrer">
2288 ${d("View the project")} <span aria-hidden="true">↗</span>
2289 </a>
2290 </div>
2291 </div>
2292 </header>
2293 <div class="os-settings__about-journal-head">
2294 <div>
2295 <span class="os-settings__about-eyebrow">${d("OpenStation Journal")}</span>
2296 <h2>${d("Latest from the station")}</h2>
2297 <p>${t?.description||d("A public dev diary — building a desktop OS for wp-admin.")}</p>
2298 </div>
2299 <a class="os-settings__about-journal-link" href=${t?.homeUrl||Ba} target="_blank" rel="noopener noreferrer">
2300 ${d("Visit the journal")} <span aria-hidden="true">↗</span>
2301 </a>
2302 </div>
2303 ${Sg(e)}
2304 <footer class="os-settings__about-footer">
2305 <p>
2306 <strong>${d("OpenStation Journal")}</strong>
2307 <span>${d("News and field notes, delivered over RSS.")}</span>
2308 </p>
2309 <a href=${t?.feedUrl||Ga} target="_blank" rel="noopener noreferrer">
2310 <span class="dashicons dashicons-rss" aria-hidden="true"></span>
2311 ${d("RSS feed")}
2312 </a>
2313 </footer>
2314 </div>
2315 `}const Ig=(s,e)=>c`<div class="os-settings__about">${Cg(de(e),S(e).about??{kind:"loading"})}</div>`;function Rg(s){const e=S(s);if(s.state.tab!=="about"||e.about!==null)return;e.about={kind:"loading"};const t=de(s).aboutFeedUrl;if(!t){e.about={kind:"error"},s.repaint();return}(async()=>{try{const o=await s.fetch(t,{credentials:"same-origin"});if(!o.ok)throw new Error(`about feed returned ${o.status}`);const i=await o.json(),n=i.success?kg(i.data):null;if(!n)throw new Error("about feed returned an invalid payload");e.about={kind:"ready",feed:n}}catch(o){console.error("[openstation/about] journal feed failed:",o),e.about={kind:"error"}}s.repaint()})()}const ve={size:null},ie={appearance:()=>N("color",ve),themes:()=>{const s=document.createElementNS("http://www.w3.org/2000/svg","svg");return s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("fill","currentColor"),s.setAttribute("aria-hidden","true"),s.innerHTML='<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-1.5 0a6.5 6.5 0 0 1-6.5 6.5v-13a6.5 6.5 0 0 1 6.5 6.5Z" />',s},windows:()=>N("windows",ve),navigation:()=>{const s=document.createElementNS("http://www.w3.org/2000/svg","svg");return s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("fill","currentColor"),s.setAttribute("aria-hidden","true"),s.innerHTML='<path d="M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 14.5c-3.6 0-6.5-2.9-6.5-6.5S8.4 5.5 12 5.5s6.5 2.9 6.5 6.5-2.9 6.5-6.5 6.5zM9 16l4.5-3L15 8.4l-4.5 3L9 16z" />',s},mobile:()=>N("window",ve),features:()=>N("settings",ve),help:()=>N("widgets",ve),"os-file-associations":()=>{const s=document.createElementNS("http://www.w3.org/2000/svg","svg");return s.setAttribute("viewBox","0 0 24 24"),s.setAttribute("fill","currentColor"),s.setAttribute("aria-hidden","true"),s.innerHTML='<path d="M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" /><path d="M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" />',s},about:()=>N("info",ve)};function Lg(s,e){return e&&xu(e)?()=>N(e,ve):ie[s]}const Za=s=>`os-settings-tab-host-${s}`;function _e(s,e=""){return c`
2316 <header class="os-settings__page-header">
2317 <h2 class="os-settings__page-title">${s}</h2>
2318 ${e?c`<p class="os-settings__page-description">${e}</p>`:""}
2319 </header>
2320 `}function Tg(s,e){return s.capability==="manage_options"?e:!0}function Ya(s){return s<20?1:s<40?2:3}function Ve(s){const e=s.data.isAdmin,t=[{id:"appearance",order:10,label:d("Appearance"),icon:ie.appearance,panel:(o,i)=>c`${_e(d("Appearance"),d("Personalize your desktop. Changes apply instantly and are saved to this browser."))}${gd(o,Hd(o,i))}`},{id:"themes",order:12,label:d("Themes"),icon:ie.themes,panel:(o,i)=>c`${_e(d("Themes"),d("A desktop theme repaints every token at once. A coarser version of what Appearance does one control at a time."))}${hu(o,i)}`},{id:"windows",order:18,label:d("Windows"),icon:ie.windows,panel:(o,i)=>c`${_e(d("Windows"),d("How windows look, how they arrive, and how they behave when they are not the one you are using."))}${jd(o)}`},{id:"navigation",order:22,label:d("Navigation"),icon:ie.navigation,panel:(o,i)=>c`${_e(d("Navigation"))}${yu(o)}`},{id:"mobile",order:24,label:d("Mobile"),icon:ie.mobile,panel:(o,i)=>c`${_e(d("Mobile"),d("On a phone the desktop becomes a home screen, one full-screen app at a time, and a tab bar. Choose when that happens and what the bar holds."))}${Au(o)}`},{id:"features",order:30,label:d("Features"),icon:ie.features,panel:(o,i)=>c`${_e(d("Features"),d("The assistant, developer tools, and beta features for your account, plus site-wide Extended options for administrators."))}${eu(o,i)}`}];e&&t.push({id:"help",order:40,label:d("Components"),icon:ie.help,panel:(o,i)=>c`${_e(d("Components"),d("Every <os-*> web component shipped by this plugin, with its props, slots, and a live example."))}${wg(o,i)}`}),t.push({id:"about",order:Number.MAX_SAFE_INTEGER,label:d("About"),icon:ie.about,padding:"0",panel:Ig});for(const o of Gc())Tg(o,e)&&t.push({id:`ext-${o.id}`,order:o.order??100,label:o.label,icon:Lg(o.id,o.icon),tab:o,panel:()=>c`<div data-host=${Za(o.id)}></div>`});return t.sort((o,i)=>o.order-i.order),t}function Dg(s,e){const t=S(s);for(const o of e){const i=o.tab;if(!i)continue;const n=s.root.querySelector(`[data-host="${Za(i.id)}"]`);if(!(!n||t.mountedTabs.get(n)===i)){t.mountedTabs.set(n,i);try{i.render(n,{isAdmin:s.data.isAdmin,getOsSettings:P,subscribeOsSettings:fn})}catch(r){console.error("[openstation] settings tab render threw:",i.id,r)}}}}const Pg=["heading","description","label","aria-label","placeholder"];function Ng(s,e){const t=new Map;for(const o of e){const i=s.querySelector(`os-tabpanel[for="${o.id}"]`),n=[o.label,i?.textContent??""];for(const r of Array.from(i?.querySelectorAll("[heading],[description],[label],[aria-label],[placeholder]")??[]))for(const a of Pg)n.push(r.getAttribute(a)??"");t.set(o.id,n.join(" ").replace(/\s+/g," ").toLowerCase())}return t}const Ja=["os-select","os-multiselect","os-segmented","os-swatch-grid","os-swatch","os-checkbox-label","os-checkbox","os-switch","os-text-field","os-number-field","os-range-field","os-color-field","os-textarea","os-button","input","select","textarea","button"].join(","),Mg=["label","aria-label","placeholder","description"],je=["data-settings-search-control","data-settings-search-section","data-settings-search-page"];function zg(s){const e=[s,...s.querySelectorAll("[label],[aria-label],[placeholder],[description]")];return[s.textContent??"",...e.flatMap(t=>Mg.map(o=>t.getAttribute(o)??""))].join(" ").replace(/\s+/g," ").trim().toLowerCase()}function Ke(s,e){return s=s.replace(/\s+/g," ").trim().toLowerCase(),s===e?3:s.startsWith(e)?2:Number(s.includes(e))}function Qa(s,e){if(e=e.replace(/\s+/g," ").trim().toLowerCase(),!e)return null;let t=null,o=0;for(const i of s.querySelectorAll(".os-settings > os-tabpanel"))for(const n of i.querySelectorAll(Ja)){if(n.parentElement?.closest(Ja)||n.closest("[os-preserve]"))continue;let r=!1;for(let h=n;h&&h!==i;h=h.parentElement)if(h.hidden||h.getAttribute("aria-hidden")==="true"){r=!0;break}if(r)continue;const a=n.closest("os-section"),l=Math.max(Ke(n.getAttribute("label")??"",e),Ke(n.getAttribute("aria-label")??"",e)),u=Math.max(l*100,Ke(zg(n),e)*10,Ke(a?.getAttribute("heading")??"",e)*3,Ke(a?.getAttribute("description")??"",e));u<=o||(o=u,t={page:i.getAttribute("for")??"",control:n,section:a})}return t}function el(s,e){const t=s.root.querySelector(".os-settings__search-input");t&&t.value!==e&&(t.value=e);const o=S(s).search;o.index=Ng(s.root,Ve(s)),o.query=e.replace(/\s+/g," ").trim().toLowerCase();const i=Qa(s.root,o.query);i&&s.state.tab!==i.page?s.local("tab",{value:i.page}):s.repaint()}function Og(s){const e=s.root.querySelector("[data-settings-search-control]");for(const o of je)for(const i of s.root.querySelectorAll(`[${o}]`))i.removeAttribute(o);const t=Qa(s.root,S(s).search.query);if(t&&t.page===s.state.tab){t.control.setAttribute(je[0],""),t.section?.setAttribute(je[1],"");for(const o of s.root.querySelectorAll("#os-settings-nav > os-tab"))o.getAttribute("value")===t.page&&o.setAttribute(je[2],"");e!==t.control&&requestAnimationFrame(()=>{t.control.isConnected&&t.control.hasAttribute(je[0])&&!t.control.closest("[hidden]")&&t.control.scrollIntoView?.({block:"nearest",inline:"nearest",behavior:"instant"})})}}const Wg=["window_prewarm","admin_asset_cache","media_library_enhanced","games","agents","network"];function Hg(s,e){const t=L({enabled:{type:"boolean"}}),o=n=>T(n,["enabled"])&&typeof n.enabled=="boolean",i=async(n,r)=>{if(!await s.dispatch(n,r))throw new Error("Preferences did not save this action.");return Br(s),{saved:!0,extendedOptions:s.data.extendedOptions}};return[...Wg.map(n=>({name:`set_extended_${n}`,description:`Set site-wide ${n}. Administrator only. Affects all users; window prewarm and asset cache need shell reload.`,parameters:t,validate:o,allowed:()=>s.data.isAdmin&&!!s.data.extendedOptions,run:r=>i("extended",{options:{...s.data.extendedOptions,[n]:r.enabled}})})),{name:"set_ai_assistant",description:"Enable or disable the assistant for this account. Disabling ends future MIO requests.",parameters:t,validate:o,allowed:()=>!!s.data.aiAssistant?.assistantProviderConfigured,run:(n,r)=>e({ai:{enabled:n.enabled}},r)},{name:"show_introductions_again",description:"Show welcome introductions again on their next open. Does not delete settings or content.",parameters:L({}),validate:n=>T(n,[]),run:()=>i("reset-intros",{})},{name:"open_section",effect:"none",description:"Open a Preferences section. Use appearance, themes, windows, navigation, mobile, features, about, or help (Components; admin only).",parameters:L({id:{type:"string",enum:Ve(s).map(n=>n.id)}}),validate:n=>T(n,["id"])&&Ve(s).some(r=>r.id===n.id),run:n=>(s.local("tab",{value:n.id}),{opened:n.id})},{name:"search_settings",effect:"none",description:"Search Preferences and highlight the single best matching control.",parameters:L({query:{type:"string"}}),validate:n=>T(n,["query"])&&typeof n.query=="string"&&n.query.length<=200,run:n=>(el(s,n.query),{filtered:n.query})},{name:"open_image_picker",effect:"none",description:"Show the wallpaper image picker. Upload requires the user to select a local file; library offers existing images.",parameters:L({source:{type:"string",enum:["library","upload"]}}),validate:n=>T(n,["source"])&&(n.source==="library"||n.source==="upload"&&s.data.canUpload),run:n=>{const r=S(s);return r.imagePickerOpen=!0,r.imageSource=n.source,s.local("tab",{value:"appearance"}),s.repaint(),{opened:n.source,needsUserFile:n.source==="upload"}}},{name:"search_wallpaper_images",effect:"read",description:"Search image attachments in the media library. Returns verified ids and dimensions for select_wallpaper_image.",parameters:L({query:{type:"string"},page:{type:"integer",minimum:1,maximum:100}}),validate:n=>T(n,["query","page"])&&typeof n.query=="string"&&n.query.length<=200&&Number.isInteger(n.page)&&n.page>=1&&n.page<=100,run:async(n,r)=>{const a=new URL(de(s).mediaUrl);a.searchParams.set("media_type","image"),a.searchParams.set("search",n.query),a.searchParams.set("page",String(n.page)),a.searchParams.set("per_page","12"),a.searchParams.set("_fields","id,title,media_details,source_url,mime_type");const l=await s.fetch(a.href,{signal:r});if(!l.ok)throw new Error("Could not search the media library.");return l.json()}},{name:"select_wallpaper_image",description:"Use an existing image attachment as wallpaper. Verifies the attachment on the server; never accepts a model-supplied URL.",parameters:L({id:{type:"integer",minimum:1}}),validate:n=>T(n,["id"])&&Number.isSafeInteger(n.id)&&n.id>0,run:async(n,r)=>{const a=await s.fetch(`${de(s).mediaUrl}/${n.id}`,{signal:r});if(!a.ok)throw new Error("This image is unavailable.");const l=await a.json();if(typeof l.mime_type!="string"||!l.mime_type.startsWith("image/")||typeof l.source_url!="string"||!/^https?:\/\//.test(l.source_url))throw new Error("The attachment is not a usable image.");return e({customImage:{id:l.id,url:l.source_url},wallpaper:"custom-image"},r)}},{name:"clear_wallpaper_image",description:"Clear the selected wallpaper image without deleting its media attachment. Active image wallpaper returns to the default wallpaper.",parameters:L({}),validate:n=>T(n,[]),run:(n,r)=>e({customImage:null,...P().wallpaper==="custom-image"?{wallpaper:dn()}:{}},r)},{name:"open_theme_upload",effect:"none",description:"Show the desktop theme upload tile. The user must choose the ZIP from their device.",parameters:L({}),validate:n=>T(n,[]),allowed:()=>s.data.canManageDesktopThemes,run:()=>(s.local("tab",{value:"themes"}),{opened:"themes",needsUserFile:!0})},{name:"open_wallpaper_settings",effect:"none",description:"Open the active wallpaper’s custom settings dialog, when available.",parameters:L({}),validate:n=>T(n,[]),run:()=>{const n=Ae().find(r=>r.id===P().wallpaper);if(!n?.renderConfig)throw new Error("This wallpaper has no settings dialog.");return jr(n),{opened:n.id}}},{name:"set_snow_settings",description:"Configure Snow wallpaper: wind 0–80, particleCount 100–2000, flakeSize 6–40, background #rrggbb. Does not switch wallpaper.",parameters:L({wind:{type:"number",minimum:0,maximum:80},particleCount:{type:"integer",minimum:100,maximum:2e3},flakeSize:{type:"number",minimum:6,maximum:40},background:{type:"string"}}),allowed:()=>Ae().some(n=>n.id==="wp-snow"),validate:n=>T(n,["wind","particleCount","flakeSize","background"])&&Object.entries(Pc).every(([r,a])=>typeof n[r]=="number"&&Number.isFinite(n[r])&&n[r]>=a.min&&n[r]<=a.max)&&Number.isInteger(n.particleCount)&&typeof n.background=="string"&&/^#[0-9a-f]{6}$/i.test(n.background),run:async(n,r)=>{const a=n,l=await e({wallpaperSettings:{...P().wallpaperSettings,"wp-snow":a}},r);return kr("wp-snow",a),l}},{name:"open_component_reference",effect:"none",description:"Inspect a kit component’s documentation and interactive example. Administrator only.",parameters:L({tag:{type:"string"}}),allowed:()=>s.data.isAdmin,validate:n=>T(n,["tag"])&&en().some(r=>r.tag===n.tag),run:n=>(S(s).components.activeTag=n.tag,s.local("tab",{value:"help"}),s.repaint(),{opened:n.tag})},{name:"list_components",effect:"read",description:"List available component references.",parameters:L({}),validate:n=>T(n,[]),allowed:()=>s.data.isAdmin,run:()=>en().map(n=>({tag:n.tag,title:n.title}))},{name:"show_connectors_location",effect:"read",description:"Explain where to connect the AI provider. Credentials must be entered by the user in WordPress Connectors.",parameters:L({}),validate:n=>T(n,[]),run:()=>({url:Bs().aiAssistant?.connectorsUrl,instructions:"Open WordPress Settings → Connectors to manage provider credentials."})}]}const tl=s=>`set_${s.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}`,L=s=>({type:"object",properties:s,required:Object.keys(s),additionalProperties:!1}),T=(s,e)=>Object.keys(s).length===e.length&&e.every(t=>Object.prototype.hasOwnProperty.call(s,t)),on=s=>typeof s=="string"&&/^#[0-9a-f]{6}$/i.test(s);function Ug(s){const e=async(n,r)=>{const a=await wr(()=>E(n),r,n);return"developerModeEnabled"in n&&mn(),a},t=fo(),o=Object.entries(t).map(([n,r])=>({name:tl(n),description:`Set Preferences ${n}. Current: ${JSON.stringify(P()[n])}.${n==="desktopLayout"?" unified combines all docks; classic is Split.":""}${n==="desktopTheme"?" Read list_options first to choose from installed themes; this never changes the WordPress frontend theme.":""}`,parameters:L({value:{type:typeof r[0]=="number"?"number":"string",enum:[...new Set(r)]}}),validate:a=>T(a,["value"])&&(fo()[n]??[]).includes(a.value),run:(a,l)=>e({[n]:a.value},l)}));for(const n of Tc)o.push({name:tl(n),description:`Set Preferences ${n}. Current: ${P()[n]}.`,parameters:L({value:{type:"boolean"}}),validate:r=>T(r,["value"])&&typeof r.value=="boolean",run:(r,a)=>e({[n]:r.value},a)});return[...o,{name:"list_options",effect:"read",description:"List live themes (including surface colours), wallpapers, accents, effects, navigation and phone pin choices. Read before selecting ids.",parameters:L({}),validate:n=>T(n,[]),run:Dc},{name:"read_settings",effect:"read",description:"Read current preferences, active section and capability-gated site options.",parameters:L({}),validate:n=>T(n,[]),run:()=>({settings:P(),section:s.state.tab,extendedOptions:s.data.extendedOptions})},{name:"set_custom_accent",description:"Set a custom six-digit hex accent and activate it.",parameters:L({value:{type:"string",pattern:"^#[0-9a-fA-F]{6}$"}}),validate:n=>T(n,["value"])&&on(n.value),run:(n,r)=>e({accent:"custom",customAccent:n.value},r)},{name:"set_custom_gradient",description:"Set both gradient colours and its angle, and activate the custom gradient wallpaper.",parameters:L({from:{type:"string"},to:{type:"string"},angle:{type:"number",minimum:0,maximum:360}}),validate:n=>T(n,["from","to","angle"])&&on(n.from)&&on(n.to)&&typeof n.angle=="number"&&Number.isFinite(n.angle)&&n.angle>=0&&n.angle<=360,run:(n,r)=>e({wallpaper:"custom-gradient",customGradient:{from:n.from,to:n.to,angle:n.angle}},r)},{name:"set_window_reveal_duration",description:"Set reveal duration: 0 uses each effect’s default; otherwise 80–4000 milliseconds.",parameters:L({value:{type:"number"}}),validate:n=>T(n,["value"])&&typeof n.value=="number"&&(n.value===0||Number.isFinite(n.value)&&n.value>=80&&n.value<=4e3),run:(n,r)=>e({windowRevealDuration:n.value},r)},{name:"set_navigation_placement",description:"Place one available Navigation item on the rail, desktop, both, or hidden. Preserves every other item.",parameters:L({id:{type:"string"},placement:{type:"string",enum:["rail","desktop","both","hidden"]}}),validate:n=>T(n,["id","placement"])&&vr().some(r=>r.id===n.id)&&["rail","desktop","both","hidden"].includes(n.placement),run:(n,r)=>e({navPlacement:{...P().navPlacement,[n.id]:n.placement}},r)},{name:"set_mobile_tabs",description:"Choose up to three available phone pins in order. Empty selects the server defaults; Home and Switcher are reserved.",parameters:L({ids:{type:"array",items:{type:"string"},maxItems:3,uniqueItems:!0}}),validate:n=>T(n,["ids"])&&Array.isArray(n.ids)&&n.ids.length<=3&&new Set(n.ids).size===n.ids.length&&n.ids.every(r=>_r().some(a=>a.id===r)),run:(n,r)=>e({mobileTabs:n.ids},r)},{name:"apply_theme_recommendations",description:"Reapply the active theme’s recommended arrangement. Changes only the settings that theme recommends.",parameters:L({}),validate:n=>T(n,[]),run:async(n,r)=>P().desktopTheme?wr(()=>{if(!bn(P().desktopTheme))throw new Error("This theme has no applicable recommendations.")},r):{effect:"none",status:"completed",data:{changed:!1,reason:"System default has no recommended layout."}}},...Hg(s,e)].map(n=>({effect:"write",...n}))}const qg=Object.entries({index:`# OpenStation Preferences help
2321
2322 Preferences changes the WordPress administration desktop for your account. It does not change the public website's WordPress theme, posts, pages or menus. Changes appear immediately, then save to your account. The browser keeps a local settings cache. MIO waits for the save confirmation before reporting success. If saving fails the existing Preferences store rolls back; MIO must report the failure.
2323
2324 ## Find the right page
2325
2326 - [Appearance](appearance.md): wallpaper, accent colour, dock arrangement, size, placement, behaviour and WordPress admin bar.
2327 - [Desktop themes](themes.md): choose a complete desktop appearance and apply its recommended layout.
2328 - [Windows](windows.md): corners, unfocused effects, opening reveals, links, close-all confirmation.
2329 - [Navigation and mobile](navigation.md): placement of individual launchers and the phone experience.
2330 - [Features](features.md): optional tools, native apps, AI, developer mode and administrator-only site options.
2331 - [Wallpaper images and configuration](wallpaper.md): gradients, existing media, uploads and Snow controls.
2332 - [Components and About](reference.md): component examples, the journal and provider setup.
2333 - [MIO actions and examples](actions.md): private action catalog, chained requests and intentional exclusions.
2334
2335 ## Ask MIO
2336
2337 Use **Ask MIO** in the Preferences window. It appears only when MIO (the shared dock / Features → MIO API switch) and Features → AI assistant are enabled and WordPress has a compatible AI connector. Contextual tips and placement need the MIO API but do not need AI. Show MIO on wallpaper controls only the desktop mascot; turning it off keeps window chat and tips available. MIO belongs to this window while it is focused. A different window can claim MIO only by explicitly registering its own context. An ordinary window cannot take over its prompt or actions. Switching focus cancels unfinished work; already submitted changes may still finish. Closing Preferences discards its conversation. Closing just the chat keeps the in-memory conversation while that window remains open. Reloading discards it.
2338
2339 Your messages, relevant help excerpts and action results are sent to the AI provider configured in WordPress. OpenStation does not save MIO backscroll in WordPress, browser storage or an application log. Provider-side retention is governed by that provider. Do not paste credentials into the conversation.
2340
2341 ## Multiple changes
2342
2343 “Please set rounded corners, unify the docks, and make them dynamic” is three actions: \`set_window_radius\` with \`round\`, \`set_desktop_layout\` with \`unified\`, then \`set_dock_behavior\` with \`dynamic\`. Each action validates its arguments and waits for its own save. A later failure does not undo earlier completed actions. MIO reports partial completion and stops instead of silently retrying writes.
2344
2345 “Make both docks dynamic” in Split mode means set both \`dockBehavior\` and \`sideDockBehavior\` to \`dynamic\`. In Unified there is only one rail and the sidebar setting has no visible effect. See [Appearance](appearance.md).
2346
2347 ## Choosing accurately
2348
2349 Ask MIO to \`list_options\` before choosing a theme, wallpaper, accent or effect. These catalogs are live: plugins can register or remove choices. MIO must use returned ids, not invent them from labels. Theme selection can seed recommended settings once, so apply a theme before making explicit layout overrides in a chain. When a theme visually overrides a setting, explain that fact instead of repeatedly writing the same value.
2350 `,appearance:"# Appearance: colour and desktop layout\n\n[Help index](index.md) · [Themes](themes.md) · [Wallpaper](wallpaper.md) · [Navigation](navigation.md)\n\n## Accent colour\n\nChoose a preset accent from the live swatches (`set_accent`), or supply a six-digit hex colour to `set_custom_accent`. Custom accent both stores the colour and activates the Custom swatch. It colours shell controls and focus treatments. It does not restyle admin documents inside iframe windows. Ask `list_options` for preset ids and their colours; installed extensions can add swatches.\n\n## Unified and Split docks\n\nThe **Unified** layout (`desktopLayout: unified`) combines core administration menus, plugin launchers and system items in one dock. **Split** (`desktopLayout: classic`) uses a left sidebar for core menus and a bottom dock for the other items. The API value `classic` deliberately means the UI label Split.\n\n`set_desktop_layout` changes this arrangement. Individual launcher visibility and location are separate preferences in [Navigation](navigation.md); unifying the dock does not delete those choices.\n\n## Dock placement\n\nIn Unified, `set_dock_placement` accepts `bottom`, `left`, or `right`. Split derives its placement from the layout: left sidebar plus bottom dock. Changing `dockPlacement` while Split is active preserves the choice for Unified but does not move the Split rails.\n\n## Dock size\n\n`set_dock_size` accepts `compact`, `default`, or `large`. These correspond to rail widths of 48, 56 and 72 CSS pixels and icon scales of 18, 20 and 26 pixels. Desktop themes may further shape their appearance.\n\n## Static and dynamic behaviour\n\n`set_dock_behavior` controls the single Unified dock or the bottom Split dock. `static` keeps it visible and reserves its occupied band in the work area. `dynamic` folds the rail into a subtle edge indicator, reveals it when the pointer reaches it or keyboard focus enters it, and reserves no desktop band.\n\n`set_side_dock_behavior` controls only Split's sidebar, independently. Both accept `static` or `dynamic`. “Hide the docks until I need them” means dynamic, not hiding every Navigation item. “Make the docks dynamic” in Split should change both rail behaviours.\n\n## Dock renderer\n\n`set_dock_rail_renderer` selects the rendering style from the live renderer catalog. It changes the presentation of a rail, not which items belong to it. Never guess a renderer id; `list_options` supplies ids and labels.\n\n## WordPress admin bar\n\n`set_admin_bar_mode` accepts `static` (always shown), `dynamic` (auto-hiding peek strip), or `hidden` (not rendered). This affects the bar above the desktop. It is separate from the dock and sidebar behaviours. The shell measures the actual visible bar height when calculating its work area.\n\n## Examples\n\n- “One large dock on the right”: set desktop layout to `unified`, dock size to `large`, dock placement to `right`.\n- “Split layout but let both rails get out of the way”: set layout `classic`, dock behaviour `dynamic`, sidebar behaviour `dynamic`.\n- “Use turquoise”: list available accent colours first, then select the user's intended swatch or ask for a custom colour if the choice is ambiguous.\n",themes:`# Desktop themes
2351
2352 [Help index](index.md) · [Appearance](appearance.md) · [Windows](windows.md)
2353
2354 ## Choose a theme
2355
2356 The Themes page offers **OpenStation**, the system default, and the installed desktop theme library. \`set_desktop_theme\` takes a verified theme slug. The empty string \`""\` selects OpenStation's built-in dark appearance. This is an administration desktop theme, not a WordPress frontend theme.
2357
2358 \`list_options\` loads full theme entries when available and returns names, descriptions, surface colour tokens, and recommended settings. Use actual colour values or a clear description as evidence when the user asks for a darker or lighter theme. A name alone is not evidence of brightness. If the metadata is insufficient, explain the uncertainty or ask which visible theme they mean. Never install or fetch an unrequested theme to satisfy a colour change.
2359
2360 ## Recommendations and order of operations
2361
2362 A desktop theme may recommend an accent, dock layout, dock position, size, renderer, window corner preset or reveal. The first activation seeds its applicable recommendations. That first-use record belongs to the shell; MIO cannot reset it.
2363
2364 Re-selecting a previously used theme respects subsequent choices. **Apply recommended layout and effects** deliberately reapplies the active theme's recommendations; MIO exposes this as \`apply_theme_recommendations\`. It changes only recommended fields. A theme without applicable recommendations reports that fact.
2365
2366 When chaining “use theme X, round the corners and unify the dock”, apply the theme first. Then set the explicitly requested corner and layout values. Otherwise first-use recommendations might override an earlier step.
2367
2368 ## When a saved setting looks unchanged
2369
2370 Themes can override window surface, radius and other CSS tokens. A successfully saved \`windowRadius\` does not necessarily defeat a theme's own radius token. Explain the override. Do not claim to have changed the theme file or silently switch themes unless the user requested that.
2371
2372 The Legacy theme is a frozen snapshot of the earlier WordPress-admin appearance. Changing current defaults never rewrites that snapshot.
2373
2374 ## Theme uploads
2375
2376 Administrators with the theme-management capability can upload a desktop theme ZIP from the Themes page. \`open_theme_upload\` takes the user to the tile. The local file must be selected by the user; MIO cannot access a device's filesystem or invent a ZIP. The existing upload flow validates the package.
2377
2378 Deleting an uploaded theme is destructive and is intentionally absent from MIO's action catalog. Code-registered themes belong to their providing plugin and cannot be deleted from this page. Use \`set_desktop_theme\` to switch away without deleting anything.
2379 `,windows:"# Window appearance and behaviour\n\n[Help index](index.md) · [Themes](themes.md) · [Features](features.md)\n\n## Corners\n\n`set_window_radius` selects `sharp` (0 px), `default` (8 px) or `round` (16 px). “Rounded corners” means `round` unless the user asks for the default rounding. A desktop theme can override the visual radius token; see [Themes](themes.md).\n\n## Unfocused windows\n\n`set_unfocus_effect` chooses how windows look when another window is focused. `none` disables the treatment. The other ids and labels come from `list_options`; the catalog can change when plugins register effects. This controls appearance, not minimization or focus ownership.\n\n## Opening reveals\n\n`set_window_reveal` chooses a content reveal. `none` uses the ordinary opacity fade. `set_window_reveal_duration` accepts `0` for the effect's own timing, or a number from 80 to 4000 milliseconds. Reduced motion is respected by the shell. The duration does not control MIO's ownership transition.\n\n## Window links\n\nRelated windows can carry visual ties. `set_window_link_renderer` chooses a registered renderer, or `none` to disable the visuals. `set_window_link_visibility` accepts `always`, `focus` (visible while a related-group member is focused), or `off`.\n\nThe master **Window links** feature (`set_window_links_enabled`) is on Features. Turning it off disables link visuals and group behaviour but preserves your style choices. Two independent switches are `set_window_link_raise_on_focus` (raise related windows behind the focused member) and `set_window_link_highlight` (outline related windows). None of these actions modifies site content or creates arbitrary relations.\n\n## Confirm closing all windows\n\n`set_confirm_close_all_windows` chooses whether the close-all shortcut asks first. This preference is reversible; MIO can change it. MIO does not expose the close-all operation itself because windows may contain unsaved work.\n\n## MIO inside a window\n\nAn explicitly registered, focused window can host MIO. Inside it, MIO ignores other windows, docks and controls for collision and magnet calculations; only the owning window body's outer boundaries constrain its movement. Closing, minimizing or leaving the owner cancels its active conversation work. A focused eligible window receives MIO through a shrink/move/grow transition, with reduced-motion users receiving an immediate handoff. See [MIO actions](actions.md).\n",navigation:"# Navigation and mobile\n\n[Help index](index.md) · [Appearance](appearance.md) · [Features](features.md)\n\n## Put launchers where you want them\n\nNavigation lists the same live launcher registry the shell uses. Each placeable item can appear on its **rail**, on the **desktop**, on **both**, or be **hidden**. MIO's `set_navigation_placement` takes a returned item `id` and `placement` (`rail`, `desktop`, `both`, `hidden`). It merges just that item into existing preferences, preserving all others.\n\nIn Split, a core menu's rail is the sidebar; other items use the dock. In Unified everything uses the one dock. The API value remains `rail`, so saved placement survives layout changes.\n\nLocked or transient launchers cannot be moved by MIO. Some system tiles are deliberately not placeable; they do not appear in its catalog. Hiding a launcher does not deactivate its plugin or delete its contents. The Mio tile can be hidden independently of whether the companion is enabled.\n\n## Phone layout\n\n`set_mobile_layout` accepts `auto`, `desktop`, or `mobile`. Automatic follows the viewport. Desktop forces the desktop experience, including on a phone. Mobile forces the phone interface, including on a large screen for previewing. Changing modes may alter or hide the current desktop conversation surface; completed settings writes remain in effect.\n\n## Phone tab bar pins\n\nThe phone tab bar reserves slots for Home and the app switcher. Up to three additional launchers can be pinned in order. `list_options` returns `phonePins`; `set_mobile_tabs` accepts a unique list of up to three of those ids. Empty means “use the server defaults,” not “remove every pin.” Unknown or unavailable ids are rejected by the MIO action.\n\nTo change a single pin while retaining others, read current settings and construct the desired complete list. Never replace the user's other pins unless requested. The phone's pin list is distinct from desktop Navigation placement.\n\n## Examples\n\n- “Put Media on the desktop and keep it in the dock”: look up its id and set placement `both`.\n- “Hide the MIO dock icon”: choose the Mio item's placement `hidden`; this does not disable MIO.\n- “Keep Posts, Pages and Media in the phone tabs”: look up their current ids, then set the three-item list in the requested order.\n",features:`# Optional features and site options
2380
2381 [Help index](index.md) · [Windows](windows.md) · [Reference and provider setup](reference.md)
2382
2383 ## Account preferences
2384
2385 The following changes are per user and preserve site content:
2386
2387 | Control | MIO action | Meaning |
2388 |---|---|---|
2389 | MIO API | \`set_mio_api_enabled\` | Master switch shared with the MIO dock button. Defaults off. Disabling hides MIO, suspends window integrations, closes chat and stops the remaining action chain. Tips do not need AI. |
2390 | Show MIO on wallpaper | \`set_mio_show_on_wallpaper\` | Show or hide the desktop mascot, independently of window chat and contextual tips. Defaults on. Also available in Make it yours and the MIO dock context menu. |
2391 | AI assistant | \`set_ai_assistant\` | Enable or disable assistant requests; requires a configured provider that supports function calling. Disabling prevents subsequent MIO requests. |
2392 | WordPress Heartbeat | \`set_heartbeat_rate\` | 15, 30, 45 or 60 seconds. Faster intervals increase server work; 60 is the default. Applies through WordPress Heartbeat settings on page load. |
2393 | Window links | \`set_window_links_enabled\` | Master switch for relation visuals and group behaviour. |
2394 | Raise related windows | \`set_window_link_raise_on_focus\` | Raise a relation group with the focused member. |
2395 | Highlight related windows | \`set_window_link_highlight\` | Outline related windows. |
2396 | Wallpaper click shows desktop | \`set_show_desktop_on_wallpaper_click\` | Clicking empty wallpaper toggles Show Desktop. |
2397 | Post status ribbons | \`set_show_post_status_ribbons\` | Display draft/pending/private/scheduled ribbons in My WordPress. |
2398 | Developer mode | \`set_developer_mode_enabled\` | Expose developer surfaces, including Code Blue and the Starter Widget. A fresh menu payload is requested after the save. |
2399 | Folder sharing | \`set_folders_sharing_enabled\` | Hide or show this user's sharing features. Disabling does not delete sharing records. |
2400
2401 The close-all confirmation and link style settings are described in [Windows](windows.md).
2402
2403 ## Native admin apps
2404
2405 These beta choices change which implementation opens from the corresponding launcher, for this account only. They do not grant permissions the account lacks:
2406
2407 - \`set_station_home_enabled\`: native Station Home instead of the classic Dashboard.
2408 - \`set_native_posts_enabled\`: native Posts table.
2409 - \`set_native_pages_enabled\`: native Pages table.
2410 - \`set_native_users_enabled\`: native Users window, still subject to user-list capabilities.
2411 - \`set_native_plugins_enabled\`: native Plugins window, still subject to plugin-management capabilities.
2412 - \`set_native_comments_enabled\`: native Comments window, still subject to the server's comment capabilities.
2413
2414 Turning a beta off selects the classic admin path on future opens. It does not uninstall anything or rewrite an already open editor.
2415
2416 ## Administrator-only Extended options
2417
2418 These switches affect the whole site and all users. MIO offers them only when Preferences reports \`manage_options\`, and the server action checks that capability again. Use \`enabled: true\` or \`false\`:
2419
2420 | MIO action | Site option |
2421 |---|---|
2422 | \`set_extended_window_prewarm\` | Hover-intent window preloading. |
2423 | \`set_extended_admin_asset_cache\` | Shared administration asset caching. |
2424 | \`set_extended_media_library_enhanced\` | Enhanced Media Library. |
2425 | \`set_extended_games\` | Games module and its registered launchers. |
2426 | \`set_extended_agents\` | Agent features. |
2427 | \`set_extended_network\` | Network features. |
2428
2429 Changes merge over existing options and use the app's \`extended\` action. A separate menu refresh reflects newly enabled registrations. Asset-cache and window-prewarm mirrors apply on shell reload. MIO must not silently reload a page that might hold unsaved work.
2430
2431 ## Welcome introductions
2432
2433 \`show_introductions_again\` makes welcome introductions eligible to display on their next open. It clears only the seen-introduction markers. It does not reset preferences or delete content.
2434
2435 ## Intentionally absent
2436
2437 Reset all preferences, delete folder-sharing data, delete uploaded themes are not available as MIO actions. Destructive actions must remain explicit UI operations. No write action is registered with WordPress's public Abilities registry. See [Actions](actions.md).
2438 `,wallpaper:"# Wallpaper images and custom configuration\n\n[Help index](index.md) · [Appearance](appearance.md) · [Themes](themes.md)\n\n## Select a wallpaper\n\n`list_options` lists currently registered wallpapers. `set_wallpaper` selects one by its exact id. Animated wallpapers may load lazily; the Preferences grid hydrates them for previews and settings controls. A plugin can add or remove wallpaper choices during the session.\n\nA custom image wallpaper requires an existing image selection. Prefer `select_wallpaper_image` for a new media choice; it verifies the attachment and activates the custom-image wallpaper together. A custom gradient can be configured and selected in one `set_custom_gradient` call.\n\n## Custom gradient\n\n`set_custom_gradient` takes `from` and `to` as `#rrggbb` strings and `angle` from 0 through 360 degrees. It preserves unrelated preferences and selects `custom-gradient`. If the user asks to change just one endpoint or the angle, use `read_settings` first to retain the other current values.\n\n## Existing images\n\n`search_wallpaper_images` takes a search `query` (empty lists images) and one-based `page`. It asks the authenticated WordPress Media REST API for up to 12 image attachments, including ids and dimensions. It never scrapes an arbitrary URL. `select_wallpaper_image` takes one attachment id, verifies access and image type against WordPress, then stores the server-returned URL and id.\n\n`set_library_hd_only` toggles the picker’s HD filter. The UI considers at least 1920 × 1080 to be HD. This filter affects library presentation; it is not an upload requirement. Smaller images may look blurry across a large desktop. Search results include dimensions so MIO can explain the tradeoff.\n\n## Upload a local image\n\n`open_image_picker` with `source: upload` opens the upload area if the user has `upload_files`. The user must choose or drop the local file. With `source: library`, it opens existing images. MIO cannot upload an unprovided local file and must not claim that opening the picker uploaded one. The normal WordPress upload permission and validation apply.\n\n## Snow settings\n\nWhen Snow (`wp-snow`) is registered, `set_snow_settings` exposes all four controls:\n\n- `wind`: 0–80; default 22. Controls peak horizontal wind in pixels per second. Zero stops the broad wind sweep, while individual flakes can still sway.\n- `particleCount`: integer 100–2000; default 660. More particles make denser snow and increase graphics work.\n- `flakeSize`: 6–40 CSS pixels; default 16. Maximum flake diameter including the soft halo; smaller flakes preserve depth variation.\n- `background`: a six-digit hex backdrop colour; default `#0c1a36`. The scene derives its night-sky gradient from it.\n\nThe action expects all four values so it cannot silently reset unspecified knobs. Read `wallpaperSettings['wp-snow']` first and merge the defaults above for missing fields when only one knob was requested. Saving Snow settings does not switch the active wallpaper; call `set_wallpaper` separately if requested.\n\n## Other wallpaper settings\n\n`open_wallpaper_settings` opens the active wallpaper's registered custom dialog. Third-party dialogs are arbitrary UI; MIO must not invent their keys or mutate an undocumented configuration bag. An extension should contribute its own validated private actions if it wants direct conversational control of those settings. MIO can open the existing dialog for user interaction in the meantime.\n\nRemoving an image selection and deleting uploaded data are intentionally outside MIO's action set.\n",reference:"# Components, About and AI provider setup\n\n[Help index](index.md) · [Features](features.md) · [Actions](actions.md)\n\n## Open a section or search Preferences\n\n`open_section` accepts a currently available page id. Built-ins are `appearance`, `themes`, `windows`, `navigation`, `mobile`, `features`, `about`, and administrator-only `help` (labelled Components). Plugin-provided tabs can appear in the same page catalog; MIO can open them but their undocumented controls do not become authorized actions automatically.\n\n`search_settings` filters the sidebar by text. Clearing the query restores all rows. It is a local view change, not a saved account preference.\n\n## Components reference\n\nAdministrators can inspect the component kit on Components. `list_components` lists the available tags and titles. `open_component_reference` takes a known tag, opens Components and selects its documentation and interactive example. The examples demonstrate generic controls; operating a sample is not equivalent to modifying real application data. Developer mode can unlock additional demonstration surfaces.\n\n## About\n\nOpen `about` with `open_section` to read the OpenStation version and journal. The page loads the journal when first shown. Journal links and external resources remain ordinary user navigation; MIO does not publish or send messages to those destinations.\n\n## Connect an AI provider\n\nMIO uses the site's existing WordPress AI Client and configured provider. To ask MIO, the personal AI assistant preference must be enabled and a compatible provider must be configured. The client gives a clear error when unavailable; it never pretends to have performed a change.\n\n`show_connectors_location` returns the configured WordPress Connectors destination. Open WordPress **Settings → Connectors** and configure the provider there. Credentials stay in WordPress's connector configuration, not in MIO prompts or help documents. Do not paste keys into chat.\n\n## Private actions\n\nMIO's tools are scoped to a live window registration in the browser. They are neither `wp_register_ability()` registrations nor global slash-commands. WordPress's Abilities discovery and execution routes cannot discover these MIO actions. Server-backed changes still use normal authenticated REST/app actions and their capability checks: private discovery does not bypass authorization.\n",actions:'# Private action catalog and chained examples\n\n[Help index](index.md) · [Appearance](appearance.md) · [Themes](themes.md) · [Windows](windows.md) · [Navigation](navigation.md) · [Features](features.md) · [Wallpaper](wallpaper.md)\n\n## Retrieval and context\n\n`search_help` searches this window\'s Markdown collection. `read_help` reads a known document and returns its valid links. Links never grant filesystem or network access. `read_settings` returns current account preferences, current page and capability-gated site facts. `list_options` returns live choices with labels, theme surface colours and recommendations. Every model round receives a freshly evaluated caller prompt and the current action allowlist.\n\n## Appearance and Windows setters\n\nEach takes `{ "value": ... }`:\n\n`set_accent`, `set_desktop_theme`, `set_wallpaper`, `set_desktop_layout`, `set_dock_placement`, `set_dock_behavior`, `set_side_dock_behavior`, `set_dock_size`, `set_dock_rail_renderer`, `set_admin_bar_mode`, `set_window_radius`, `set_unfocus_effect`, `set_window_reveal`, `set_window_reveal_duration`, `set_window_link_renderer`, `set_window_link_visibility`, `set_mobile_layout`, `set_heartbeat_rate`.\n\nSpecialized value shapes: `set_custom_accent` accepts a hex `value`; `set_custom_gradient` accepts `from`, `to`, `angle`; `set_navigation_placement` accepts `id`, `placement`; `set_mobile_tabs` accepts `ids`; `apply_theme_recommendations` takes no arguments.\n\n## Account switches\n\nEach takes a boolean `value`:\n\n`set_window_links_enabled`, `set_window_link_raise_on_focus`, `set_window_link_highlight`, `set_show_desktop_on_wallpaper_click`, `set_show_post_status_ribbons`, `set_developer_mode_enabled`, `set_folders_sharing_enabled`, `set_station_home_enabled`, `set_native_posts_enabled`, `set_native_pages_enabled`, `set_native_users_enabled`, `set_native_plugins_enabled`, `set_native_comments_enabled`, `set_confirm_close_all_windows`, `set_library_hd_only`.\n\n`set_ai_assistant` takes boolean `enabled`; it is availability/capability-gated. The six `set_extended_*` actions also take boolean `enabled`; see [Features](features.md) for every name and scope.\n\n## Utilities\n\n`open_section`, `search_settings`, `open_image_picker`, `search_wallpaper_images`, `select_wallpaper_image`, `open_theme_upload`, `open_wallpaper_settings`, `set_snow_settings`, `show_introductions_again`, `list_components`, `open_component_reference`, `show_connectors_location`. Some deliberately open a UI for the user\'s file selection rather than claiming direct access to a local file.\n\n## Chain: rounded corners, one dock, dynamic\n\n1. `set_window_radius({ "value": "round" })`.\n2. `set_desktop_layout({ "value": "unified" })`.\n3. `set_dock_behavior({ "value": "dynamic" })`.\n\nThe action loop can receive multiple calls in a round, but executes them sequentially and rechecks context and permission before each. Each save completes before the next write starts. A following model round sees outcomes and can answer accurately.\n\n## Chain: a darker theme and my own layout\n\n1. `list_options({})` and inspect actual theme descriptions and surface colours.\n2. Choose a returned slug that matches the request, or ask the user if unclear.\n3. `set_desktop_theme({ "value": "<returned slug>" })`.\n4. Apply the explicitly requested layout and corner overrides afterwards, so first-use theme recommendations do not supersede them.\n\n## Limits and failures\n\nA turn allows up to eight model rounds and sixteen calls per round. Repeated identical actions stop the loop. Arguments must match the action\'s runtime validator; unknown action names, unknown fields, malformed values and unavailable ids are rejected before a write. An unknown or malformed action does not fall back to a global command.\n\nFocus changes, chat close, window close and Stop cancel pending work. A submitted network write cannot necessarily be recalled; MIO must distinguish cancellation from rollback. Earlier completed actions are preserved if a later action fails. MIO never automatically retries a potentially completed write after a network failure.\n\nThe public WordPress Abilities registry remains unchanged. Destructive resets/deletions, arbitrary URLs, raw settings bags, arbitrary app dispatch and filesystem access are absent. Third-party apps follow the same opt-in pattern with their own help, prompt and validated actions.\n\n`clear_wallpaper_image` takes no arguments. It clears the wallpaper selection and returns an active image wallpaper to the default; the Media Library attachment is preserved. This is reversible by selecting the image again.\n\n## Repair and outcome reporting\n\nMIO may correct invalid arguments twice before a third validation failure ends the user turn. Corrections do not count as saved actions. Read tools can refresh options or settings after a change; a completed or uncertain write must not be replayed. Status summaries distinguish reads, rejected candidates, confirmed writes and unknown write outcomes. Permission failures and cancelled requests are terminal. Read longer help documents using their section IDs or continuation cursor when `truncated` is true.\n'}).map(([s,e])=>({id:`${s}.md`,title:e.split(`
2439 `)[0].replace(/^# /,""),markdown:e}));function Fg(s){const e=window.wp?.os?.mio?.registerWindow(s.windowId,{host:s.root,title:"OpenStation Preferences",prompt:()=>`You are MIO, the warm, concise companion inside OpenStation Preferences. Help the user understand and customize this admin desktop. Your caller is this window; your scope is its non-destructive controls. Do not change the public website theme. Current section: ${s.state.tab}. Current settings: ${JSON.stringify(P())}. Administrator: ${s.data.isAdmin}. Use help for factual explanations, list_options for live choices, and only offered actions for changes. For "unify docks" choose desktopLayout unified. "Rounded corners" is windowRadius round. For "make both docks dynamic" in Split set both dockBehavior and sideDockBehavior. Apply a desktop theme before requested explicit overrides. Ask when an essential choice is unclear. Read results and report partial completion honestly. Current settings are refreshed AFTER each action; they are not the original state. Use the action result changed and changes (before/after) to describe what happened. Only say already selected when the action result explicitly reports changed:false. Never claim that opening an upload picker uploaded a file. Do not reset preferences, delete themes or purge sharing data.`,documents:qg,abilities:()=>Ug(s)});return e?.showCallout({id:"about-blog",target:()=>s.state.tab==="about"?s.root.querySelector(".os-settings__about-journal-head"):null,message:d("Visit our blog!")}),()=>e?.dispose()}const Re=J("desktop-mode/wallpaper-lazy",()=>({pending:new Map,inflight:new Map}));function Vg(s){Re.state.pending.delete(s)}function jg(s){return(window.openStationWallpapers||{})[s]??null}function Kg(s){const e=Re.state.inflight.get(s);if(e)return e;const t=Re.state.pending.get(s);if(!t)return Promise.resolve(null);const o=(async()=>{try{await ro(t.scriptUrl,{translations:t.scriptTranslations,deps:t.scriptDeps,l10n:t.scriptL10n,before:t.scriptBefore,after:t.scriptAfter})}catch(n){return be(V.SHELL_ERROR,{scope:"wallpaper-script-load",id:t.id,error:n}),null}let i=jg(t.id);if(i&&!i.description&&t.description&&(i={...i,description:t.description}),!i)return be(V.SHELL_ERROR,{scope:"wallpaper-missing-def",id:t.id,error:new Error(`[openstation] No wallpaper def on window.openStationWallpapers["${t.id}"]. Script loaded but didn't publish a def — check the plugin's enqueue + global assignment.`)}),null;try{br(i)}catch(n){return be(V.SHELL_ERROR,{scope:"wallpaper-register",id:t.id,error:n}),null}return Vg(t.id),i})().finally(()=>{Re.state.inflight.delete(s)});return Re.state.inflight.set(s,o),o}async function Bg(){const s=Array.from(Re.state.pending.keys());s.length!==0&&await Promise.all(s.map(e=>Kg(e)))}let we=null;function Gg(){if(we)return we;if(window.openStationWindowLinkVisuals)return we=Promise.resolve(!0),we;const e=window.openStationConfig?.windowLinkVisualsBundleUrl;return e?(we=ro(e).then(()=>!0).catch(t=>{throw we=null,t}),we):Promise.resolve(!1)}const Xg=4,sl=24,ol=4,Zg=250,Yg="os-settings__wallpaper-live-preview";function Jg(s){const e=s.type==="canvas"?s.needs:void 0;if(!e||e.length===0)return Promise.resolve();const t=window.wp?.os;return t?.loadModules?t.loadModules(e):Promise.reject(new Error(`[openstation] Wallpaper "${s.id}" declares needs but wp.os.loadModules is unavailable.`))}function Qg(){return window.openStationConfig?.pluginUrl??""}function ef(){return typeof window.matchMedia=="function"&&window.matchMedia("( prefers-reduced-motion: reduce )").matches}function tf(s){const e={...s.previewParams??{}},t=fe(V.WALLPAPER_PREVIEW_PARAMS,e,s.id);return!t||typeof t!="object"?e:t}function sf(s){const e=new Map;let t=!1;const o=()=>{let f=0;return e.forEach(A=>{(A.teardown||A.mounting)&&f++}),f},i=f=>{f.remountTimer!==null&&(clearTimeout(f.remountTimer),f.remountTimer=null)},n=f=>{if(f.generation++,f.mounting=!1,i(f),f.teardown){const A=f.teardown;f.teardown=null;try{A()}catch($){typeof console<"u"&&console.error(`[openstation] Wallpaper "${f.defId}" preview teardown threw:`,$)}}f.overlay.innerHTML=""},r=f=>{t||!f.visible||f.teardown||f.mounting||b&&(f.tile.clientWidth<sl||f.tile.clientHeight<sl)||a(f)},a=f=>{const A=ze(f.defId);if(!A?.renderPreview||o()>=Xg)return;const $=++f.generation;f.mounting=!0,f.mountWidth=f.tile.clientWidth,f.mountHeight=f.tile.clientHeight;const R={id:A.id,pluginUrl:Qg(),prefersReducedMotion:ef(),visible:!document.hidden,settings:xr(A.id),params:tf(A),width:f.mountWidth,height:f.mountHeight},I=H=>{if($!==f.generation||t){try{H()}catch{}return}f.mounting=!1,f.teardown=H,l(f)&&u(f)},O=H=>{$===f.generation&&(f.mounting=!1,f.overlay.innerHTML="",typeof console<"u"&&console.error(`[openstation] Wallpaper "${A.id}" renderPreview failed:`,H))};Jg(A).then(()=>{if($!==f.generation||t)return;let H;try{H=A.renderPreview(f.overlay,R)}catch(X){O(X);return}if(xo(H)){H.then(I,O);return}I(H)},O)},l=f=>Math.abs(f.tile.clientWidth-f.mountWidth)>ol||Math.abs(f.tile.clientHeight-f.mountHeight)>ol,u=f=>{i(f),f.remountTimer=setTimeout(()=>{f.remountTimer=null,!(t||!f.teardown||!l(f))&&(n(f),r(f))},Zg)},h=f=>{for(const A of f){const $=e.get(A.target);$&&($.visible=A.isIntersecting,A.isIntersecting?r($):n($))}},p=typeof IntersectionObserver=="function"?new IntersectionObserver(h,{threshold:.1}):null,g=f=>{for(const A of f){const $=e.get(A.target);!$||t||(!$.teardown&&!$.mounting?r($):$.teardown&&l($)&&u($))}},b=typeof ResizeObserver=="function"?new ResizeObserver(g):null,m=f=>{n(f),p?.unobserve(f.tile),b?.unobserve(f.tile),f.overlay.remove(),e.delete(f.tile)},x=()=>{if(t)return;const f=s.querySelectorAll("os-swatch[data-wallpaper-id]"),A=new Set;f.forEach($=>{A.add($);const R=$.dataset.wallpaperId??"",O=!!ze(R)?.renderPreview&&!!p,H=e.get($);if(H&&(H.defId!==R||!O)&&m(H),!O||e.has($))return;const X=document.createElement("div");X.className=Yg,X.setAttribute("aria-hidden","true"),$.appendChild(X),e.set($,{tile:$,overlay:X,defId:R,generation:0,teardown:null,mounting:!1,visible:!1,mountWidth:0,mountHeight:0,remountTimer:null}),p.observe($),b?.observe($)}),e.forEach(($,R)=>{A.has(R)||m($)})},y=()=>{t||(t=!0,e.forEach(f=>n(f)),e.clear(),p?.disconnect(),b?.disconnect(),document.removeEventListener("os-window-closed",k))},k=()=>{s.isConnected||y()};return document.addEventListener("os-window-closed",k),{sync:x,dispose:y}}const of="appearance";function il(s,e){if(!e.icon)return c`<span class="os-settings__nav-glyph-blank" aria-hidden="true"></span>`;let t=s.glyphs.get(e.id);return t||(t=e.icon(),s.glyphs.set(e.id,t)),t}function nf(s){const e=P(),t=S(s),o=Ve(s),i=o.some(h=>h.id===s.state.tab)?s.state.tab:of,{query:n,index:r}=t.search,a=h=>n===""||(r?.get(h.id)??"").includes(n);let l=0;const u=h=>{el(s,h.target.value)};return c`
2440 <div class="os-settings">
2441 <div class="os-settings__search">
2442 <label class="os-settings__search-field">
2443 ${il(t,{id:"__search",order:0,label:"",icon:()=>N("search",{size:null}),panel:()=>c``})}
2444 <input
2445 type="search"
2446 class="os-settings__search-input"
2447 placeholder=${d("Search settings")}
2448 aria-label=${d("Search settings")}
2449 aria-controls="os-settings-nav"
2450 @input=${u}
2451 />
2452 </label>
2453 </div>
2454 <os-tabs
2455 id="os-settings-nav"
2456 orientation="vertical"
2457 value=${i}
2458 label=${d("Settings sections")}
2459 os-bind="tab"
2460 >
2461 ${o.map((h,p)=>{const g=p>0&&Ya(h.order)!==Ya(o[p-1].order),b=a(h);return b&&l++,c`<os-tab
2462 value=${h.id}
2463 data-group-start=${g?"true":null}
2464 data-search-hidden=${b?null:"true"}
2465 >${il(t,h)}${h.label}</os-tab>`})}
2466 </os-tabs>
2467 <p class="os-settings__search-empty" ?hidden=${n===""||l>0}>
2468 ${d("No settings match that.")}
2469 </p>
2470 ${""}
2471 <os-select
2472 class="os-settings__page-select"
2473 label=${d("Settings section")}
2474 value=${i}
2475 os-bind="tab"
2476 >
2477 ${o.map(h=>c`<os-option value=${h.id}>${h.label}</os-option>`)}
2478 </os-select>
2479 <os-panel class="os-settings__footer">
2480 <os-button variant="ghost" @click=${pl}>${d("Reset to defaults")}</os-button>
2481 </os-panel>
2482 ${o.map(h=>c`<os-tabpanel for=${h.id}>
2483 <os-panel padding=${h.padding??null}>${h.panel(e,s)}</os-panel>
2484 </os-tabpanel>`)}
2485 </div>
2486 `}const rf=Kc(Ks,{local:{tab:(s,e)=>{const t=String(e.value??"");t!==""&&(s.tab=t)}},view:nf,mounted:s=>{const e=S(s);yd(P,Wd),e.previews=sf(s.root),Bg(),Gg().catch(()=>{});const t=()=>s.repaint();document.addEventListener("os-mode-changed",t);const o=[()=>document.removeEventListener("os-mode-changed",t),Fg(s),fn(t),Cc(t),kl(t),$c(t),Gl(t),Sc(t),oc(t),Xc(t)];return()=>{for(const i of o)i();Vr(s),e.previews?.dispose(),e.previews=null}},updated:s=>{Od(s),S(s).previews?.sync(),Nd(s),Dg(s,Ve(s)),yg(s),Rg(s),Br(s),Og(s)}});return qs.default=rf,Object.defineProperties(qs,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),qs}({});
2487