diff --git a/activitypub.php b/activitypub.php index 0055a3885..15765f639 100644 --- a/activitypub.php +++ b/activitypub.php @@ -44,6 +44,7 @@ function rest_init() { Rest\Server::init(); ( new Rest\Actors_Controller() )->register_routes(); ( new Rest\Actors_Inbox_Controller() )->register_routes(); + ( new Rest\Admin\Actions_Controller() )->register_routes(); ( new Rest\Application_Controller() )->register_routes(); ( new Rest\Collections_Controller() )->register_routes(); ( new Rest\Comments_Controller() )->register_routes(); diff --git a/build/social-web/block.json b/build/social-web/block.json new file mode 100644 index 000000000..20525e874 --- /dev/null +++ b/build/social-web/block.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "activitypub/social-web", + "title": "Social Web", + "category": "widgets", + "description": "Social Web admin interface", + "textdomain": "activitypub", + "editorScript": "file:./index.js" +} \ No newline at end of file diff --git a/build/social-web/followers.js b/build/social-web/followers.js new file mode 100644 index 000000000..e705e99af --- /dev/null +++ b/build/social-web/followers.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[519],{380:(e,t,a)=>{a.r(t),a.d(t,{default:()=>A});var i=a(87),o=a(577),l=a(510),r=a(723),n=a(143),s=a(582),c=a(486),d=a(375),u=a(790);function f({item:e}){const{defaultAvatar:t}=(0,d.t)(),a=e.actor_info?.icon||t;return(0,u.jsx)("img",{alt:e.actor_info?.username||"",src:a,className:"activitypub-avatar-field__image",onError:e=>{e.target.src=t}})}const b={id:"avatar",label:(0,r.__)("Avatar","activitypub"),type:"media",enableHiding:!1,enableSorting:!1,getValue:({item:e})=>e.actor_info?.icon||"",render:({item:e})=>(0,u.jsx)(f,{item:e})},p={id:"name",label:(0,r.__)("Name","activitypub"),enableHiding:!1,enableSorting:!0,getValue:({item:e})=>e.actor_info?.name||"",render:({item:e})=>{const t=e.actor_info?.name||"",a=e.actor_info?.url||"#";return(0,u.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"activitypub-name-field__link",children:(0,u.jsx)("strong",{children:t})})}},m={id:"webfinger",label:(0,r.__)("Profile","activitypub"),enableHiding:!0,getValue:({item:e})=>e.actor_info?.webfinger||"",render:({item:e})=>{const t=e.actor_info?.webfinger||"",a=e.actor_info?.url||"#";return t?(0,u.jsxs)("a",{href:a,target:"_blank",rel:"noopener noreferrer",title:t,children:["@",t]}):(0,u.jsx)("span",{children:"—"})}};var _=a(443);const g={id:"modified",label:(0,r.__)("Last Updated","activitypub"),enableHiding:!0,enableSorting:!0,getValue:({item:e})=>e.modified_gmt||e.modified,render:({item:e})=>{const t=e.modified_gmt||e.modified;return t?(0,u.jsx)("time",{dateTime:t,children:(0,_.dateI18n)("M j, Y",t)}):(0,u.jsx)("span",{children:"—"})},filterBy:{operators:["after","before"]}},w={id:"follow_status",label:(0,r.__)("Following","activitypub"),enableHiding:!0,getValue:({item:e})=>e.follow_status?.follows_back,render:({item:e})=>e.follow_status?.follows_back?(0,u.jsx)("span",{className:"activitypub-mutual",children:(0,r._x)("Mutual","Follow status","activitypub")}):(0,u.jsx)("span",{children:"—"})};var y=a(455),v=a.n(y),h=a(692);const{createSuccessNotice:k,createErrorNotice:F}=(0,n.dispatch)(h.store),P=(0,n.dispatch)("core"),j="activitypub/1.0";async function x(e){try{const t=e.map(e=>v()({path:`/${j}/admin/actors/${e.id}/unfollow`,method:"DELETE"}));await Promise.all(t),P.invalidateResolutionForStoreSelector("getEntityRecords"),await k((0,r._n)("Follower removed.","Followers removed.",e.length,"activitypub"),{type:"snackbar"})}catch(e){await F((0,r.__)("Failed to remove followers.","activitypub"),{type:"snackbar"})}}async function S(e){try{const t=e.map(e=>v()({path:`/${j}/admin/actors/${e.id}/block`,method:"POST",data:{site_wide:!1}}));await Promise.all(t),P.invalidateResolutionForStoreSelector("getEntityRecords"),await k((0,r._n)("Account blocked.","Accounts blocked.",e.length,"activitypub"),{type:"snackbar"})}catch(e){await F((0,r.__)("Failed to block accounts.","activitypub"),{type:"snackbar"})}}async function R(e){try{const t=e.map(e=>v()({path:`/${j}/admin/actors/${e.id}/follow`,method:"POST"}));await Promise.all(t),P.invalidateResolutionForStoreSelector("getEntityRecords"),await k((0,r._n)("Account followed.","Accounts followed.",e.length,"activitypub"),{type:"snackbar"})}catch(e){await F((0,r.__)("Failed to follow accounts.","activitypub"),{type:"snackbar"})}}const E={type:"table",perPage:20,page:1,sort:{field:"modified",direction:"desc"},search:"",filters:[],fields:["webfinger","modified","follow_status"],layout:{},titleField:"name",mediaField:"avatar"},I={table:{fields:["webfinger","modified","follow_status"]},grid:{fields:["webfinger"],mediaField:"avatar",primaryField:"name"}};function A(){const{view:e,updateView:t}=(0,l.l)({kind:"postType",name:"ap_actor",slug:"followers",defaultView:E}),a=(0,n.useSelect)(e=>{const{getCurrentUser:t}=e(s.store),a=t();return a?.id},[]),{followers:d,isResolving:f,totalItems:_,totalPages:y}=function({perPage:e=20,page:t=1,orderBy:a="modified",order:o="desc",search:l="",userId:r,fields:n=["id","date","modified","slug","title","meta","actor_info","follow_status"]}={}){const c=(0,i.useMemo)(()=>{const i={per_page:e,page:t,orderby:a,order:o,search:l,_fields:n};return r&&(i.follower_of=r),i},[e,t,a,o,l,r,n]),{records:d,hasResolved:u,isResolving:f,totalItems:b,totalPages:p}=(0,s.useEntityRecords)("postType","ap_actor",c);return{followers:d||[],hasResolved:u,isResolving:f,totalItems:b,totalPages:p}}({perPage:e.perPage||20,page:e.page||1,orderBy:e.sort?.field||"modified",order:e.sort?.direction||"desc",search:e.search||"",userId:a}),v=(0,i.useMemo)(()=>[b,p,m,g,w],[]),h=(0,i.useMemo)(()=>function(){var e;const t=null!==(e=window.activityPubAdmin?.followingEnabled)&&void 0!==e&&e,a=[{id:"block",label:(0,r.__)("Block","activitypub"),callback:S},{id:"delete",label:(0,r.__)("Remove","activitypub"),callback:x}];return t&&a.unshift({id:"follow",label:(0,r.__)("Follow Back","activitypub"),isEligible:e=>!e.follow_status?.follows_back,callback:R}),a}(),[]);return(0,u.jsx)(c.Y,{title:(0,r.__)("Followers","activitypub"),hasPadding:!1,children:(0,u.jsx)(o.A,{data:d,fields:v,view:e,onChangeView:t,actions:h,isLoading:f,getItemId:e=>e.id.toString(),empty:(0,u.jsx)("p",{children:e.search?(0,r.__)("No followers found.","activitypub"):(0,r.__)("No followers.","activitypub")}),paginationInfo:{totalItems:_,totalPages:y},defaultLayouts:I})})}}}]); \ No newline at end of file diff --git a/build/social-web/following.js b/build/social-web/following.js new file mode 100644 index 000000000..cf2facae6 --- /dev/null +++ b/build/social-web/following.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[883],{277:(i,l,n)=>{n.r(l),n.d(l,{default:()=>e});var o=n(427),t=n(486),s=n(790);function e({id:i,onClose:l}){return(0,s.jsx)(t.Y,{title:"Following Details",hasPadding:!0,actions:(0,s.jsx)(o.Button,{size:"small",onClick:l,children:"Close"}),children:(0,s.jsxs)("p",{children:["Following details for ID: ",i]})})}},607:(i,l,n)=>{n.r(l),n.d(l,{default:()=>s});var o=n(486),t=n(790);function s({onSelectItem:i}){return(0,t.jsx)(o.Y,{title:"Following",subTitle:"Accounts you follow",hasPadding:!0,contentWidth:"constrained",children:(0,t.jsx)("p",{children:"Following list coming soon..."})})}}}]); \ No newline at end of file diff --git a/build/social-web/index.asset.php b/build/social-web/index.asset.php new file mode 100644 index 000000000..4aae71397 --- /dev/null +++ b/build/social-web/index.asset.php @@ -0,0 +1 @@ + array('react', 'react-dom', 'react-jsx-runtime', 'wp-api-fetch', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-data-controls', 'wp-date', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-warning'), 'version' => 'e739b07d995d064993c2'); diff --git a/build/social-web/index.js b/build/social-web/index.js new file mode 100644 index 000000000..4e1c16539 --- /dev/null +++ b/build/social-web/index.js @@ -0,0 +1,2 @@ +(()=>{"use strict";var e,t,n,i,s,o={53:e=>{e.exports=window.wp.privateApis},87:e=>{e.exports=window.wp.element},143:e=>{e.exports=window.wp.data},233:e=>{e.exports=window.wp.preferences},375:(e,t,n)=>{n.d(t,{Z:()=>r,t:()=>a});var i=n(87),s=n(790);const o=(0,i.createContext)(void 0);function r({children:e,settings:t}){return(0,s.jsx)(o.Provider,{value:t,children:e})}function a(){const e=(0,i.useContext)(o);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e}},427:e=>{e.exports=window.wp.components},443:e=>{e.exports=window.wp.date},455:e=>{e.exports=window.wp.apiFetch},486:(e,t,n)=>{n.d(t,{Y:()=>o});var i=n(164),s=n(790);function o({title:e,subTitle:t,badges:n,actions:o,breadcrumbs:r,hasPadding:a=!0,hasBorder:l=!1,contentWidth:c="default",children:d}){return(0,s.jsxs)("div",{className:"page",children:[(0,s.jsxs)("header",{className:(0,i.A)("header",{"has-border":l}),children:[r&&(0,s.jsx)("div",{className:"breadcrumbs",children:r}),(0,s.jsxs)("div",{className:"title-row",children:[(0,s.jsxs)("div",{className:"title-group",children:[(0,s.jsx)("h1",{className:"title",children:e}),n&&(0,s.jsx)("div",{className:"badges",children:n})]}),o&&(0,s.jsx)("div",{className:"actions",children:o})]}),t&&(0,s.jsx)("p",{className:"sub-title",children:t})]}),(0,s.jsx)("div",{className:(0,i.A)("content",{padded:a,constrained:"constrained"===c,full:"full"===c}),children:d})]})}},491:e=>{e.exports=window.wp.compose},558:e=>{e.exports=window.wp.keycodes},573:e=>{e.exports=window.wp.primitives},582:e=>{e.exports=window.wp.coreData},609:e=>{e.exports=window.React},692:e=>{e.exports=window.wp.notices},723:e=>{e.exports=window.wp.i18n},790:e=>{e.exports=window.ReactJSXRuntime},795:e=>{e.exports=window.ReactDOM},872:(e,t,n)=>{n(609);var i=n(87),s=n(427);const o=window.wp.keyboardShortcuts,r=window.wp.commands;var a=n(143),l=n(692),c=n(572),d=n(864),u=n(711),h=n(38),p=n(655),f=n(988),w=n(723),g=n(582);const m=window.wp.htmlEntities;var b=n(307),x=n(558);const v=window.wp.url;var j=n(644),y=n(164),_=n(790);const S=function({className:e,siteIconUrl:t}){const n=t?(0,_.jsx)("img",{className:"site-icon__image",alt:"Site Icon",src:t}):(0,_.jsx)(s.Icon,{className:"site-icon__icon",icon:j.A,size:48});return(0,_.jsx)("div",{className:(0,y.A)(e,"site-icon"),children:n})},N=function(){const{homeUrl:e,siteTitle:t}=(0,a.useSelect)(e=>{const{getEntityRecord:t}=e(g.store),n=t("root","__unstableBase");return{homeUrl:n?.home,siteTitle:!n?.name&&n?.url?(0,v.filterURLForDisplay)(n?.url):n?.name}},[]),{open:n}=(0,a.useDispatch)(r.store);return(0,_.jsx)("div",{className:"site-hub",children:(0,_.jsxs)(s.__experimentalHStack,{justify:"flex-start",spacing:"0",children:[(0,_.jsx)("div",{className:"site-hub__icon-container",children:(0,_.jsx)(s.Button,{__next40pxDefaultSize:!0,href:"/wp-admin/",label:(0,w.__)("Go to the Dashboard","activitypub"),className:"site-hub__icon-button",style:{transform:"scale(0.5333) translateX(-4px)",borderRadius:4},children:(0,_.jsx)(S,{className:"site-hub__icon"})})}),(0,_.jsxs)(s.__experimentalHStack,{children:[(0,_.jsx)("div",{className:"site-hub__title",children:(0,_.jsxs)(s.Button,{variant:"link",href:e,target:"_blank",children:[(0,m.decodeEntities)(t),(0,_.jsx)(s.VisuallyHidden,{as:"span",children:/* translators: accessibility text */ /* translators: accessibility text */ +(0,w.__)("(opens in a new tab)","activitypub")})]})}),(0,_.jsx)(s.__experimentalHStack,{spacing:0,expanded:!1,className:"site-hub__actions",children:(0,_.jsx)(s.Button,{size:"compact",className:"site-hub__command-button",icon:b.A,onClick:()=>n(),label:(0,w.__)("Open command palette","activitypub"),shortcut:x.displayShortcut.primary("k")})})]})]})})},L=[{id:"dashboard",label:(0,w.__)("Dashboard"),icon:c.A},{id:"followers",label:(0,w.__)("Followers"),icon:d.A},{id:"following",label:(0,w.__)("Following"),icon:u.A},{id:"interactions",label:(0,w.__)("Interactions"),icon:h.A}];function I({activeSection:e,onNavigate:t}){return(0,_.jsxs)("div",{className:"sidebar",children:[(0,_.jsx)(N,{}),(0,_.jsxs)("nav",{className:"nav",children:[(0,_.jsxs)(s.__experimentalHStack,{spacing:3,alignment:"flex-start",className:"sidebar-navigation__icon-title",children:[(0,_.jsx)(s.Button,{className:"sidebar-navigation__button",size:"compact",icon:(0,w.isRTL)()?p.A:f.A,href:"/wp-admin/",label:(0,w.__)("Go to the Dashboard","activitypub")}),(0,_.jsx)(s.__experimentalHeading,{className:"sidebar-navigation__title",level:1,size:20,children:(0,w.__)("Social Web","activitypub")})]}),(0,_.jsx)(s.NavigableMenu,{children:(0,_.jsx)(s.MenuGroup,{children:L.map(n=>(0,_.jsxs)(s.MenuItem,{isSelected:e===n.id,onClick:()=>t(n.id),className:"menu-item",children:[n.icon&&(0,_.jsx)(s.Icon,{icon:n.icon,size:20}),(0,_.jsx)("span",{children:n.label})]},n.id))})})]}),(0,_.jsx)("div",{className:"footer",children:(0,_.jsxs)(s.MenuGroup,{children:[(0,_.jsx)(s.MenuItem,{onClick:()=>window.open("/docs","_blank"),children:"Documentation"}),(0,_.jsx)(s.MenuItem,{onClick:()=>t("settings"),children:"Settings"})]})})]})}function k({className:e,children:t}){return(0,_.jsx)("div",{className:(0,y.A)("themed-surface",e),children:t})}function C({className:e,children:t}){return(0,_.jsx)("div",{className:(0,y.A)("panel",e),children:(0,_.jsx)(k,{children:t})})}var E=n(486);const O=window.wp.dataControls;var A=n(455),T=n.n(A);const F={setFollowing:e=>({type:"SET_FOLLOWING",following:e}),setInteractions:e=>({type:"SET_INTERACTIONS",interactions:e}),setLoading:(e,t)=>({type:"SET_LOADING",resource:e,isLoading:t}),*fetchFollowing(){yield F.setLoading("following",!0);try{const e=yield T()({path:"/activitypub/v1/following"});yield F.setFollowing(e)}catch(e){console.error("Failed to fetch following:",e)}finally{yield F.setLoading("following",!1)}},*fetchInteractions(){yield F.setLoading("interactions",!0);try{const e=yield T()({path:"/activitypub/v1/interactions"});yield F.setInteractions(e)}catch(e){console.error("Failed to fetch interactions:",e)}finally{yield F.setLoading("interactions",!1)}}},P={following:[],interactions:[],isLoading:{following:!1,interactions:!1}},B="activitypub/social-web",D=(0,a.createReduxStore)(B,{reducer:function(e=P,t){switch(t.type){case"SET_FOLLOWING":return{...e,following:t.following};case"SET_INTERACTIONS":return{...e,interactions:t.interactions};case"SET_LOADING":return{...e,isLoading:{...e.isLoading,[t.resource]:t.isLoading}};default:return e}},actions:F,selectors:{getFollowing:e=>e.following,getFollowingById:(e,t)=>e.following.find(e=>e.id===t),getInteractions:e=>e.interactions,getInteractionById:(e,t)=>e.interactions.find(e=>e.id===t),isLoading:(e,t)=>e.isLoading[t],getStats:e=>({following:e.following.length,interactions:e.interactions.length,posts:0})},controls:O.controls});function z(e,t){const n=function(){const e=(0,a.useSelect)(e=>e(B).getFollowing(),[]),t=(0,a.useSelect)(e=>e(B).getInteractions(),[]),n=(0,a.useSelect)(e=>e(B).getStats(),[]),s=(0,a.useSelect)(e=>e(B).isLoading("following"),[]),o=(0,a.useSelect)(e=>e(B).isLoading("interactions"),[]),{fetchFollowing:r,fetchInteractions:l}=(0,a.useDispatch)(B);return(0,i.useEffect)(()=>{},[]),{following:e,interactions:t,stats:n,isLoading:(0,i.useMemo)(()=>({following:s,interactions:o}),[s,o]),fetchFollowing:r,fetchInteractions:l}}();if(!e)return{items:n,isLoading:!1};if(t){const i=(0,a.useSelect)(n=>{const i=n(B);return"following"===e?i.getFollowingById(t):"interactions"===e?i.getInteractionById(t):null},[e,t]);return{items:i,isLoading:n.isLoading[e]}}return{items:n[e],isLoading:n.isLoading[e]}}function R(){const{items:e}=z("followers"),{items:t}=z("following"),{items:n}=z("interactions");return(0,_.jsx)(E.Y,{title:"Dashboard",subTitle:"Overview of your ActivityPub network",hasPadding:!0,contentWidth:"constrained",children:(0,_.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"var(--wpds-spacing-60, 24px)"},children:[(0,_.jsx)(s.Card,{children:(0,_.jsxs)(s.CardBody,{children:[(0,_.jsx)("h3",{children:"Followers"}),(0,_.jsx)("p",{style:{fontSize:"32px",margin:"8px 0"},children:e?.length||0})]})}),(0,_.jsx)(s.Card,{children:(0,_.jsxs)(s.CardBody,{children:[(0,_.jsx)("h3",{children:"Following"}),(0,_.jsx)("p",{style:{fontSize:"32px",margin:"8px 0"},children:t?.length||0})]})}),(0,_.jsx)(s.Card,{children:(0,_.jsxs)(s.CardBody,{children:[(0,_.jsx)("h3",{children:"Interactions"}),(0,_.jsx)("p",{style:{fontSize:"32px",margin:"8px 0"},children:n?.length||0})]})})]})})}(0,a.register)(D);const M=(0,i.lazy)(()=>Promise.all([n.e(803),n.e(3),n.e(519)]).then(n.bind(n,380))),G=(0,i.lazy)(()=>n.e(883).then(n.bind(n,607))),H=(0,i.lazy)(()=>n.e(761).then(n.bind(n,36))),$=(0,i.lazy)(()=>n.e(883).then(n.bind(n,277))),U=(0,i.lazy)(()=>n.e(761).then(n.bind(n,461)));function W(){const e=window.location.hash.slice(1);if(!e||"/"===e)return{section:"dashboard",itemId:null};const t=e.split("/").filter(Boolean);return{section:t[0]||"dashboard",itemId:t[1]||null}}function q(e,t){const n=t?`#/${e}/${t}`:`#/${e}`;window.history.pushState(null,"",n)}function X(){const[e,t]=(0,i.useState)("dashboard"),[n,o]=(0,i.useState)(null),c=(0,a.useSelect)(e=>e(l.store).getNotices().filter(e=>"snackbar"===e.type),[]),{removeNotice:d}=(0,a.useDispatch)(l.store);(0,i.useEffect)(()=>{const{section:e,itemId:n}=W();t(e),o(n)},[]),(0,i.useEffect)(()=>{const e=()=>{const{section:e,itemId:n}=W();t(e),o(n)};return window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>(document.body.classList.add("is-fullscreen-mode"),()=>{document.body.classList.remove("is-fullscreen-mode")}),[]);const u=t=>{o(t),q(e,t)},h=()=>{o(null),q(e)},p=!!n;return(0,_.jsxs)("div",{className:"app-layout",children:[(0,_.jsx)(r.CommandMenu,{}),(0,_.jsxs)("div",{className:"app-content",children:[(0,_.jsx)("div",{className:"sidebar-region",children:(0,_.jsx)(I,{activeSection:e,onNavigate:e=>{t(e),o(null),q(e)}})}),(0,_.jsx)("div",{className:"stage-region",children:(0,_.jsx)(C,{children:(()=>{const t={onSelectItem:u};if("dashboard"===e)return(0,_.jsx)(R,{});const n=()=>{switch(e){case"followers":return(0,_.jsx)(M,{});case"following":return(0,_.jsx)(G,{...t});case"interactions":return(0,_.jsx)(H,{...t});default:return(0,_.jsx)(R,{})}};return(0,_.jsx)(i.Suspense,{fallback:(0,_.jsx)(s.Spinner,{}),children:(0,_.jsx)(n,{})})})()})}),p&&(0,_.jsx)("div",{className:"inspector-region",children:(0,_.jsx)(C,{children:(()=>{if(!n)return null;const t={id:n,onClose:h},o=()=>{switch(e){case"following":return(0,_.jsx)($,{...t});case"interactions":return(0,_.jsx)(U,{...t});default:return null}};return(0,_.jsx)(i.Suspense,{fallback:(0,_.jsx)(s.Spinner,{}),children:(0,_.jsx)(o,{})})})()})})]}),(0,_.jsx)(s.SnackbarList,{notices:c,onRemove:d})]})}var Y=n(375);window.wp=window.wp||{},window.wp.activitypubSocialWeb={initialize:function(e,t){const n=document.getElementById(e);n&&(0,i.createRoot)(n).render((0,_.jsx)(Y.Z,{settings:t,children:(0,_.jsx)(o.ShortcutProvider,{children:(0,_.jsx)(s.SlotFillProvider,{children:(0,_.jsx)(X,{})})})}))}}},979:e=>{e.exports=window.wp.warning}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var n=r[e]={exports:{}};return o[e](n,n.exports,a),n.exports}a.m=o,e=[],a.O=(t,n,i,s)=>{if(!n){var o=1/0;for(d=0;d=s)&&Object.keys(a.O).every(e=>a.O[e](n[l]))?n.splice(l--,1):(r=!1,s0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,i,s]},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var s=Object.create(null);a.r(s);var o={};t=t||[null,n({}),n([]),n(n)];for(var r=2&i&&e;("object"==typeof r||"function"==typeof r)&&!~t.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach(t=>o[t]=()=>e[t]);return o.default=()=>e,a.d(s,o),s},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.f={},a.e=e=>Promise.all(Object.keys(a.f).reduce((t,n)=>(a.f[n](e,t),t),[])),a.u=e=>({519:"social-web/followers",761:"social-web/interactions",883:"social-web/following"}[e]+".js?ver="+{519:"b2f49b4cec163bdf0761",761:"fedc2f7b7b1d5c57554c",883:"bdc2fd120c1ddd933b57"}[e]),a.miniCssF=e=>"social-web/style-followers.css",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},s="wordpress-activitypub:",a.l=(e,t,n,o)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==n)for(var c=document.getElementsByTagName("script"),d=0;d{r.onerror=r.onload=null,clearTimeout(p);var s=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),s&&s.forEach(e=>e(n)),t)return t(n)},p=setTimeout(h.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=h.bind(null,r.onerror),r.onload=h.bind(null,r.onload),l&&document.head.appendChild(r)}},a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;a.g.importScripts&&(e=a.g.location+"");var t=a.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=n[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e+"../"})(),(()=>{if("undefined"!=typeof document){var e={994:0};a.f.miniCss=(t,n)=>{e[t]?n.push(e[t]):0!==e[t]&&{3:1}[t]&&n.push(e[t]=(e=>new Promise((t,n)=>{var i=a.miniCssF(e),s=a.p+i;if(((e,t)=>{for(var n=document.getElementsByTagName("link"),i=0;i{var o=document.createElement("link");o.rel="stylesheet",o.type="text/css",a.nc&&(o.nonce=a.nc),o.onerror=o.onload=n=>{if(o.onerror=o.onload=null,"load"===n.type)i();else{var r=n&&n.type,a=n&&n.target&&n.target.href||t,l=new Error("Loading CSS chunk "+e+" failed.\n("+r+": "+a+")");l.name="ChunkLoadError",l.code="CSS_CHUNK_LOAD_FAILED",l.type=r,l.request=a,o.parentNode&&o.parentNode.removeChild(o),s(l)}},o.href=t,document.head.appendChild(o)})(e,s,0,t,n)}))(t).then(()=>{e[t]=0},n=>{throw delete e[t],n}))}}})(),(()=>{var e={994:0,982:0};a.f.j=(t,n)=>{var i=a.o(e,t)?e[t]:void 0;if(0!==i)if(i)n.push(i[2]);else if(/^(3|982)$/.test(t))e[t]=0;else{var s=new Promise((n,s)=>i=e[t]=[n,s]);n.push(i[2]=s);var o=a.p+a.u(t),r=new Error;a.l(o,n=>{if(a.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var s=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+s+": "+o+")",r.name="ChunkLoadError",r.type=s,r.request=o,i[1](r)}},"chunk-"+t,t)}},a.O.j=t=>0===e[t];var t=(t,n)=>{var i,s,[o,r,l]=n,c=0;if(o.some(t=>0!==e[t])){for(i in r)a.o(r,i)&&(a.m[i]=r[i]);if(l)var d=l(a)}for(t&&t(n);ca(872));l=a.O(l)})(); \ No newline at end of file diff --git a/build/social-web/interactions.js b/build/social-web/interactions.js new file mode 100644 index 000000000..307cb29dd --- /dev/null +++ b/build/social-web/interactions.js @@ -0,0 +1 @@ +"use strict";(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[761],{36:(t,i,n)=>{n.r(i),n.d(i,{default:()=>r});var e=n(486),s=n(790);function r({onSelectItem:t}){return(0,s.jsx)(e.Y,{title:"Interactions",subTitle:"Your ActivityPub interactions",hasPadding:!0,contentWidth:"constrained",children:(0,s.jsx)("p",{children:"Interactions list coming soon..."})})}},461:(t,i,n)=>{n.r(i),n.d(i,{default:()=>o});var e=n(427),s=n(486),r=n(790);function o({id:t,onClose:i}){return(0,r.jsx)(s.Y,{title:"Interaction Details",hasPadding:!0,actions:(0,r.jsx)(e.Button,{size:"small",onClick:i,children:"Close"}),children:(0,r.jsxs)("p",{children:["Interaction details for ID: ",t]})})}}}]); \ No newline at end of file diff --git a/build/social-web/style-followers-rtl.css b/build/social-web/style-followers-rtl.css new file mode 100644 index 000000000..861f1cc1f --- /dev/null +++ b/build/social-web/style-followers-rtl.css @@ -0,0 +1,3 @@ +.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px} +.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase} +.dataviews-picker-wrapper,.dataviews-wrapper{box-sizing:border-box;container:dataviews-wrapper/inline-size;display:flex;flex-direction:column;font-size:13px;height:100%;line-height:1.4;overflow:auto;scroll-padding-bottom:64px}.dataviews-filters__container,.dataviews__view-actions{box-sizing:border-box;flex-shrink:0;right:0;padding:16px 48px;position:sticky}@media not (prefers-reduced-motion){.dataviews-filters__container,.dataviews__view-actions{transition:padding .1s ease-out}}.dataviews-loading,.dataviews-no-results{align-items:center;display:flex;flex-grow:1;justify-content:center;padding:0 48px}@media not (prefers-reduced-motion){.dataviews-loading,.dataviews-no-results{transition:padding .1s ease-out}}.dataviews-loading-more{text-align:center}@container (max-width: 430px){.dataviews-filters__container,.dataviews__view-actions{padding:12px 24px}.dataviews-loading,.dataviews-no-results{padding-right:24px;padding-left:24px}}.dataviews-title-field{font-size:13px;font-weight:499;width:100%}.dataviews-title-field,.dataviews-title-field a{color:#2f2f2f;text-overflow:ellipsis;white-space:nowrap}.dataviews-title-field a{display:block;flex-grow:0;overflow:hidden;text-decoration:none}.dataviews-title-field a:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field a:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.dataviews-title-field button.components-button.is-link{color:#1e1e1e;display:block;font-weight:inherit;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:100%}.dataviews-title-field button.components-button.is-link:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable{color:#2f2f2f;cursor:pointer}.dataviews-title-field--clickable:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.components-card__body:has(>.dataviews-picker-wrapper),.components-card__body:has(>.dataviews-wrapper){overflow:hidden;padding:8px 0 0}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-filters__container,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-footer,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-loading,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-no-results,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-grid,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews__view-actions,.components-card__body:has(>.dataviews-wrapper) .dataviews-filters__container,.components-card__body:has(>.dataviews-wrapper) .dataviews-footer,.components-card__body:has(>.dataviews-wrapper) .dataviews-loading,.components-card__body:has(>.dataviews-wrapper) .dataviews-no-results,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-grid,.components-card__body:has(>.dataviews-wrapper) .dataviews__view-actions{padding-inline:24px}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr td:first-child,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr th:first-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr td:first-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr th:first-child{padding-inline-start:24px}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr td:last-child,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr th:last-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr td:last-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr th:last-child{padding-inline-end:24px}.dataviews-bulk-actions-footer__item-count{color:#1e1e1e;font-size:11px;font-weight:499;text-transform:uppercase}.dataviews-bulk-actions-footer__container{margin-left:auto;min-height:32px}.dataviews-filters__button{position:relative}.dataviews-filters__container{padding-top:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true],.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:hover{opacity:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:focus{opacity:1}.dataviews-filters__summary-popover{font-size:13px;line-height:1.4}.dataviews-filters__summary-popover .components-popover__content{border-radius:4px;max-width:250px;min-width:230px;width:100%}.dataviews-filters__summary-popover.components-dropdown__content .components-popover__content{padding:0}.dataviews-filters__summary-operators-container{padding:8px 16px}.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-listbox),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-no-elements),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__user-input-widget){border-bottom:1px solid #e0e0e0}.dataviews-filters__summary-operators-container:empty{display:none}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name{color:#757575;flex-shrink:0;max-width:calc(100% - 55px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select{overflow:hidden;white-space:nowrap;width:100%}.dataviews-filters__summary-chip-container{position:relative;white-space:pre-wrap}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip{align-items:center;background:#f0f0f0;border:1px solid transparent;border-radius:16px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;min-height:32px;padding:4px 12px;position:relative}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable{cursor:default}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-reset{padding-inline-end:28px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:hover:not(.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable),.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip[aria-expanded=true]{background:#e0e0e0;color:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values{background:rgba(var(--wp-admin-theme-color--rgb),.04);color:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values:hover,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values[aria-expanded=true]{background:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip .dataviews-filters-__summary-filter-text-name{font-weight:499}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove{align-items:center;background:transparent;border:0;border-radius:50%;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:absolute;left:4px;top:50%;transform:translateY(-50%);width:24px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove svg{fill:#757575}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover{background:#e0e0e0}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus svg,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover svg{fill:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values svg{fill:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values:hover{background:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__search-widget-filter-combobox-list{border-top:1px solid #e0e0e0;max-height:184px;overflow:auto;padding:4px}.dataviews-filters__search-widget-filter-combobox-list .dataviews-filters__search-widget-filter-combobox-item-value [data-user-value]{font-weight:600}.dataviews-filters__search-widget-listbox{overflow:auto;padding:4px}.dataviews-filters__search-widget-listitem{align-items:center;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;gap:8px;line-height:20px;min-height:32px;padding:4px 12px}.dataviews-filters__search-widget-listitem:last-child{margin-block-end:0}.dataviews-filters__search-widget-listitem:focus,.dataviews-filters__search-widget-listitem:hover,.dataviews-filters__search-widget-listitem[data-active-item]{background-color:var(--wp-admin-theme-color);color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description{color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection{background:#fff;border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection{border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description{color:#757575;display:block;font-size:12px;line-height:16px;overflow:hidden;text-overflow:ellipsis}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{border:1px solid #1e1e1e;border-radius:50%;height:24px;margin-left:12px;max-width:24px;min-width:24px;position:relative;transition:none;width:24px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{height:16px;max-width:16px;min-width:16px;width:16px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:12px;right:50%;margin:0;position:absolute;top:50%;transform:translate(50%,-50%);width:12px}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked{background:var(--wp-admin-theme-color);border:none}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{margin:0;padding:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{background-color:#fff;border:4px solid #fff;border-radius:50%;box-sizing:inherit;content:"";height:12px;right:50%;margin:0;position:absolute;top:50%;transform:translate(50%,-50%);width:12px}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:24px;border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-left:12px;padding:6px 8px;transition:none}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-moz-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:-ms-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::-ms-check{opacity:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media(min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{margin:-4px -5px 0 0}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{content:"";display:inline-block;float:right;font:normal 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{float:none;font-size:21px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true]{background:#f0f0f0;border-color:#ddd;cursor:default;opacity:1}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{background:#fff;color:#1e1e1e;height:var(--checkbox-size);margin:0;padding:0;position:relative;width:var(--checkbox-size)}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:16px}}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:border-color .1s ease-in-out}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:var(--checkbox-size);fill:#fff;height:var(--checkmark-size);right:50%;position:absolute;top:50%;transform:translate(50%,-50%);width:var(--checkmark-size)}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:calc(var(--checkbox-size) + 4px)}}.dataviews-filters__search-widget-filter-combobox__wrapper{padding:8px;position:relative}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:normal;padding:6px 8px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-moz-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:-ms-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{display:block;font-size:16px;height:32px;margin-right:0;margin-left:0;padding:0 32px 0 8px;width:100%}@media(min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{background:#fff;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-moz-placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-cancel-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-decoration,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-decoration{-webkit-appearance:none}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon{align-items:center;bottom:0;display:flex;inset-inline-start:12px;justify-content:center;position:absolute;top:0;width:24px}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon:dir(ltr){transform:scaleX(-1)}.dataviews-filters__container-visibility-toggle{flex-shrink:0;position:relative}.dataviews-filters-toggle__count{background:var(--wp-admin-theme-color,#3858e9);border-radius:8px;box-sizing:border-box;color:#fff;font-size:11px;height:16px;line-height:16px;min-width:16px;outline:var(--wp-admin-border-width-focus) solid #fff;padding:0 4px;position:absolute;left:0;text-align:center;top:0;transform:translate(-50%,-50%)}.dataviews-search{width:-moz-fit-content;width:fit-content}.dataviews-filters__user-input-widget{padding:16px}.dataviews-filters__user-input-widget .components-input-control__prefix{padding-right:8px}.dataviews-filters__search-widget-no-elements{align-items:center;display:flex;justify-content:center;padding:16px}.dataviews-footer{background-color:#fff;border-top:1px solid #f0f0f0;bottom:0;flex-shrink:0;right:0;padding:12px 48px;position:sticky}@media not (prefers-reduced-motion){.dataviews-footer{transition:padding .1s ease-out}}.dataviews-footer{z-index:2}@container (max-width: 430px){.dataviews-footer{padding:12px 24px}}@container (max-width: 560px){.dataviews-footer{flex-direction:column!important}.dataviews-footer .dataviews-bulk-actions-footer__container{width:100%}.dataviews-footer .dataviews-bulk-actions-footer__item-count{flex-grow:1}.dataviews-footer .dataviews-pagination{justify-content:space-between;width:100%}}.dataviews-pagination__page-select{font-size:11px;font-weight:499;text-transform:uppercase}@media(min-width:600px){.dataviews-pagination__page-select .components-select-control__input{font-size:11px!important;font-weight:499}}.dataviews-action-modal{z-index:1000001}.dataviews-picker-footer__bulk-selection{align-self:flex-start;height:32px}.dataviews-picker-footer__actions{align-self:flex-end}.dataviews-selection-checkbox{--checkbox-input-size:24px}@media(min-width:600px){.dataviews-selection-checkbox{--checkbox-input-size:16px}}.dataviews-selection-checkbox{flex-shrink:0;line-height:0}.dataviews-selection-checkbox .components-checkbox-control__input-container{margin:0}.dataviews-view-config{container-type:inline-size;font-size:13px;line-height:1.4;width:320px}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper{height:100%;overflow-y:scroll}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper .dataviews-view-config{width:auto}.dataviews-view-config__sort-direction .components-toggle-group-control-option-base{text-transform:uppercase}.dataviews-settings-section__title.dataviews-settings-section__title{font-size:15px;line-height:24px}.dataviews-settings-section__sidebar{grid-column:span 4}.dataviews-settings-section__content,.dataviews-settings-section__content>*{grid-column:span 8}.dataviews-settings-section__content .is-divided-in-two{display:contents}.dataviews-settings-section__content .is-divided-in-two>*{grid-column:span 4}.dataviews-settings-section:has(.dataviews-settings-section__content:empty){display:none}@container (max-width: 500px){.dataviews-settings-section.dataviews-settings-section{grid-template-columns:repeat(2,1fr)}.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__content,.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__sidebar{grid-column:span 2}}.dataviews-field-control__field{height:32px}.dataviews-field-control__actions{position:absolute;top:-9999em}.dataviews-field-control__actions.dataviews-field-control__actions{gap:4px}.dataviews-field-control__field.is-interacting .dataviews-field-control__actions,.dataviews-field-control__field:focus-within .dataviews-field-control__actions,.dataviews-field-control__field:hover .dataviews-field-control__actions{position:unset;top:unset}.dataviews-field-control__icon{display:flex;width:24px}.dataviews-field-control__label-sub-label-container{flex-grow:1}.dataviews-field-control__label{display:block}.dataviews-field-control__sub-label{color:#757575;font-size:11px;font-style:normal;margin-bottom:0;margin-top:8px}.dataviews-view-grid-items{container-type:inline-size;display:grid;gap:32px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));grid-template-rows:max-content;margin-bottom:auto;padding:0 48px 24px}@container (max-width: 430px){.dataviews-view-grid-items{padding-right:24px;padding-left:24px}}@media not (prefers-reduced-motion){.dataviews-view-grid-items{transition:padding .1s ease-out}}.dataviews-view-grid .dataviews-view-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-actions{padding:8px 0 4px}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable{width:-moz-fit-content;width:fit-content}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{color:#1e1e1e}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;overflow:hidden;position:relative;width:100%}.dataviews-view-grid .dataviews-view-grid__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-grid .dataviews-view-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;right:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-grid .dataviews-view-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field{align-items:center;min-height:24px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))){display:none}.dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-grid__field-value:empty,.dataviews-view-grid__field:empty{display:none}.dataviews-view-grid__card .dataviews-selection-checkbox{right:8px;opacity:0;position:absolute;top:-9999em;z-index:1}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-selection-checkbox{transition:opacity .1s linear}}@media(hover:none){.dataviews-view-grid__card .dataviews-selection-checkbox{opacity:1;top:8px}}.dataviews-view-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-grid__card:hover .dataviews-selection-checkbox{opacity:1;top:8px}.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:0;position:absolute;left:4px;top:4px}.dataviews-view-grid__card .dataviews-view-grid__media-actions .dataviews-all-actions-button{background-color:#fff}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-view-grid__media-actions{transition:opacity .1s linear}}@media(hover:none){.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:1;top:4px}}.dataviews-view-grid__card .dataviews-view-grid__media-actions:has(.dataviews-all-actions-button[aria-expanded=true]),.dataviews-view-grid__card:focus-within .dataviews-view-grid__media-actions,.dataviews-view-grid__card:hover .dataviews-view-grid__media-actions{opacity:1}.dataviews-view-grid__media--clickable{cursor:pointer}.dataviews-view-grid__group-header{color:#1e1e1e;container-type:inline-size;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}@container (max-width: 430px){.dataviews-view-grid__group-header{padding-right:24px;padding-left:24px}}div.dataviews-view-list{list-style-type:none}.dataviews-view-list{margin:0 0 auto}.dataviews-view-list div[role=article],.dataviews-view-list div[role=row]{border-top:1px solid #f0f0f0;margin:0}.dataviews-view-list div[role=article] .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row] .dataviews-view-list__item-wrapper{box-sizing:border-box;padding:16px 24px;position:relative}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions{display:flex;flex:0 0 auto;gap:4px;width:-moz-max-content;width:max-content}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions .components-button,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button{position:relative;z-index:1}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>div,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>div{height:24px}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex:0;overflow:hidden;width:0}.dataviews-view-list div[role=article]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}@media(hover:none){.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}}.dataviews-view-list div[role=article].is-selected.is-selected,.dataviews-view-list div[role=article].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=article].is-selected.is-selected+div[role=row],.dataviews-view-list div[role=row].is-selected.is-selected,.dataviews-view-list div[role=row].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=row].is-selected.is-selected+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected) .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected) .dataviews-view-list__title-field{color:#1e1e1e}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered,.dataviews-view-list div[role=article]:not(.is-selected):focus-within,.dataviews-view-list div[role=article]:not(.is-selected):hover,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered,.dataviews-view-list div[role=row]:not(.is-selected):focus-within,.dataviews-view-list div[role=row]:not(.is-selected):hover{background-color:#f8f8f8;color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__title-field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__title-field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__title-field{color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);color:#1e1e1e}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__title-field{color:var(--wp-admin-theme-color)}.dataviews-view-list .dataviews-view-list__item{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;inset:0;padding:0;position:absolute;scroll-margin:8px 0;z-index:1}.dataviews-view-list .dataviews-view-list__item:focus-visible{outline:none}.dataviews-view-list .dataviews-view-list__item:focus-visible:before{border-radius:2px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";inset:var(--wp-admin-border-width-focus);outline:2px solid transparent;position:absolute}.dataviews-view-list .dataviews-view-list__title-field{flex:1;line-height:24px;min-height:24px;overflow:hidden}.dataviews-view-list .dataviews-view-list__title-field:has(a,button){z-index:1}.dataviews-view-list .dataviews-view-list__media-wrapper{background-color:#fff;border-radius:4px;flex-shrink:0;height:52px;overflow:hidden;position:relative;width:52px}.dataviews-view-list .dataviews-view-list__media-wrapper img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-list .dataviews-view-list__media-wrapper:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;right:0;position:absolute;top:0;width:100%}.dataviews-view-list .dataviews-view-list__field-wrapper{flex-grow:1;min-height:52px}.dataviews-view-list .dataviews-view-list__fields{color:#757575;display:flex;flex-wrap:wrap;font-size:12px;gap:12px;row-gap:4px}.dataviews-view-list .dataviews-view-list__fields:empty{display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field:has(.dataviews-view-list__field-value:empty){display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field-value{align-items:center;display:flex;line-height:20px;min-height:24px}.dataviews-view-list+.dataviews-pagination{justify-content:space-between}.dataviews-view-list__group-header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}.dataviews-view-table{border-collapse:collapse;border-color:inherit;color:#757575;margin-bottom:auto;position:relative;text-indent:0;width:100%}.dataviews-view-table th{color:#1e1e1e;font-size:13px;font-weight:400;text-align:right}.dataviews-view-table td,.dataviews-view-table th{padding:12px}.dataviews-view-table td.dataviews-view-table__actions-column,.dataviews-view-table th.dataviews-view-table__actions-column{text-align:left}.dataviews-view-table td.dataviews-view-table__actions-column--sticky,.dataviews-view-table th.dataviews-view-table__actions-column--sticky{background-color:#fff;position:sticky;left:0}.dataviews-view-table td.dataviews-view-table__actions-column--stuck:after,.dataviews-view-table th.dataviews-view-table__actions-column--stuck:after{background-color:#f0f0f0;bottom:0;content:"";display:block;right:0;position:absolute;top:0;width:1px}.dataviews-view-table td.dataviews-view-table__checkbox-column,.dataviews-view-table th.dataviews-view-table__checkbox-column{padding-left:0;width:1%}.dataviews-view-table td.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper,.dataviews-view-table th.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper{max-width:auto;min-width:auto}.dataviews-view-table tr{border-top:1px solid #f0f0f0}.dataviews-view-table tr .dataviews-view-table-header-button{gap:4px}.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-right:48px}.dataviews-view-table tr td:first-child .dataviews-view-table-header-button,.dataviews-view-table tr th:first-child .dataviews-view-table-header-button{margin-right:-8px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-left:48px}.dataviews-view-table tr:last-child{border-bottom:0}.dataviews-view-table tr.is-hovered,.dataviews-view-table tr.is-hovered .dataviews-view-table__actions-column--sticky{background-color:#f8f8f8}.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input{opacity:0}.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:checked,.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:focus,.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:indeterminate{opacity:1}.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:0}.dataviews-view-table tr.is-hovered .components-checkbox-control__input,.dataviews-view-table tr.is-hovered .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:focus-within .components-checkbox-control__input,.dataviews-view-table tr:focus-within .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:hover .components-checkbox-control__input,.dataviews-view-table tr:hover .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}@media(hover:none){.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input,.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}}.dataviews-view-table tr.is-selected{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);color:#757575}.dataviews-view-table tr.is-selected,.dataviews-view-table tr.is-selected+tr{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-table tr.is-selected:hover{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table tr.is-selected:hover .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 8%,#fff)}.dataviews-view-table thead{inset-block-start:0;position:sticky;z-index:1}.dataviews-view-table thead tr{border:0}.dataviews-view-table thead tr .components-checkbox-control__input.components-checkbox-control__input{opacity:1}.dataviews-view-table thead th{background-color:#fff;font-size:11px;font-weight:499;padding-bottom:8px;padding-right:12px;padding-top:8px;text-transform:uppercase}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-right:4px}.dataviews-view-table tbody td{vertical-align:top}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper{align-items:center;display:flex;min-height:32px}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end{justify-content:flex-end}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center{justify-content:center}.dataviews-view-table tbody .components-v-stack>.dataviews-view-table__cell-content-wrapper:not(:first-child){min-height:0}.dataviews-view-table .dataviews-view-table-header-button{font-size:11px;font-weight:499;padding:4px 8px;text-transform:uppercase}.dataviews-view-table .dataviews-view-table-header-button:not(:hover){color:#1e1e1e}.dataviews-view-table .dataviews-view-table-header-button span{speak:none}.dataviews-view-table .dataviews-view-table-header-button span:empty{display:none}.dataviews-view-table .dataviews-view-table-header{padding-right:4px}.dataviews-view-table .dataviews-view-table__actions-column{white-space:nowrap;width:auto}.dataviews-view-table:has(tr.is-selected) .components-checkbox-control__input{opacity:1}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-right:0}.dataviews-view-table.has-compact-density td,.dataviews-view-table.has-compact-density th{padding:4px 8px}.dataviews-view-table.has-comfortable-density td,.dataviews-view-table.has-comfortable-density th{padding:16px 12px}.dataviews-view-table.has-comfortable-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-comfortable-density th.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density th.dataviews-view-table__checkbox-column{padding-left:0}@container (max-width: 430px){.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-right:24px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-left:24px}}.dataviews-view-table-selection-checkbox{--checkbox-input-size:24px}@media(min-width:600px){.dataviews-view-table-selection-checkbox{--checkbox-input-size:16px}}.dataviews-column-primary__media{background-color:#fff;border-radius:4px;flex-shrink:0;max-width:60px;overflow:hidden;position:relative}.dataviews-column-primary__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-column-primary__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;right:0;position:absolute;top:0;width:100%}.dataviews-view-table__cell-content-wrapper:not(.dataviews-column-primary__media),.dataviews-view-table__primary-column-content:not(.dataviews-column-primary__media){max-width:80ch;min-width:15ch}.dataviews-view-table__group-header-row .dataviews-view-table__group-header-cell{color:#1e1e1e;font-weight:499;padding:12px 48px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-actions{padding:8px 0 4px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field--clickable{width:-moz-fit-content;width:fit-content}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{color:#1e1e1e}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after,.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-picker-grid:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-grid:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-selection-checkbox{top:8px!important}.dataviews-view-picker-grid .dataviews-selection-checkbox input{pointer-events:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;position:relative;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;right:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field{align-items:center;min-height:24px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field:not(:has(.dataviews-view-picker-grid__field-value:not(:empty))){display:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-picker-grid__field-value:empty,.dataviews-view-picker-grid__field:empty{display:none}.dataviews-view-picker-grid__card .dataviews-selection-checkbox{right:8px;position:absolute;top:-9999em;z-index:1}@media(hover:none){.dataviews-view-picker-grid__card .dataviews-selection-checkbox{top:8px}}.dataviews-view-picker-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:hover .dataviews-selection-checkbox{top:8px}.dataviews-view-picker-grid__media--clickable{cursor:pointer}.dataviews-view-picker-grid-group__header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}.dataviews-controls__datetime{border:none;padding:0}.dataviews-controls__relative-date-number,.dataviews-controls__relative-date-unit{flex:1 1 50%}.dataviews-controls__date input[type=date]::-webkit-calendar-picker-indicator,.dataviews-controls__date input[type=date]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}.dataviews-controls__date-preset{border:1px solid #ddd}.dataviews-controls__date-preset:active{background-color:#000}.dataforms-layouts-panel__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-panel__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-panel__field-label--label-position-side{align-self:center}.dataforms-layouts-panel__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-panel__field-control .components-button{max-width:100%;min-height:32px;text-align:right;text-wrap:balance;text-wrap:pretty;white-space:normal}.dataforms-layouts-panel__field-control.components-button.is-link[aria-disabled=true]{text-decoration:none}.dataforms-layouts-panel__field-control .components-dropdown{max-width:100%}.dataforms-layouts-panel__field-dropdown .components-popover__content{min-width:320px;padding:16px}.dataforms-layouts-panel__dropdown-header{margin-bottom:16px}.dataforms-layouts-panel__modal-footer{margin-top:16px}.components-popover.components-dropdown__content.dataforms-layouts-panel__field-dropdown{z-index:159990}.dataforms-layouts-regular__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-regular__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-regular__field-label--label-position-side{align-self:center}.dataforms-layouts-regular__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-card__field-header-label{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:15px;font-weight:499;line-height:20px}.dataforms-layouts-card__field{width:100%}.dataforms-layouts-card__field-description{color:#757575;display:block;font-size:13px;margin-bottom:16px}.dataforms-layouts-card__field-summary{display:flex;flex-direction:row;gap:16px}.dataforms-layouts-row__field-control{width:100%}.dataforms-layouts__wrapper{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px} diff --git a/build/social-web/style-followers.css b/build/social-web/style-followers.css new file mode 100644 index 000000000..78162037f --- /dev/null +++ b/build/social-web/style-followers.css @@ -0,0 +1,3 @@ +.dataviews-view-table .activitypub-avatar-field__image{height:32px;width:32px} +.activitypub-mutual{background:#dcdcde;border-radius:3px;color:#50575e;display:inline-block;font-size:11px;font-weight:600;padding:2px 8px;text-transform:uppercase} +.dataviews-picker-wrapper,.dataviews-wrapper{box-sizing:border-box;container:dataviews-wrapper/inline-size;display:flex;flex-direction:column;font-size:13px;height:100%;line-height:1.4;overflow:auto;scroll-padding-bottom:64px}.dataviews-filters__container,.dataviews__view-actions{box-sizing:border-box;flex-shrink:0;left:0;padding:16px 48px;position:sticky}@media not (prefers-reduced-motion){.dataviews-filters__container,.dataviews__view-actions{transition:padding .1s ease-out}}.dataviews-loading,.dataviews-no-results{align-items:center;display:flex;flex-grow:1;justify-content:center;padding:0 48px}@media not (prefers-reduced-motion){.dataviews-loading,.dataviews-no-results{transition:padding .1s ease-out}}.dataviews-loading-more{text-align:center}@container (max-width: 430px){.dataviews-filters__container,.dataviews__view-actions{padding:12px 24px}.dataviews-loading,.dataviews-no-results{padding-left:24px;padding-right:24px}}.dataviews-title-field{font-size:13px;font-weight:499;width:100%}.dataviews-title-field,.dataviews-title-field a{color:#2f2f2f;text-overflow:ellipsis;white-space:nowrap}.dataviews-title-field a{display:block;flex-grow:0;overflow:hidden;text-decoration:none}.dataviews-title-field a:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field a:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.dataviews-title-field button.components-button.is-link{color:#1e1e1e;display:block;font-weight:inherit;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:100%}.dataviews-title-field button.components-button.is-link:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable{color:#2f2f2f;cursor:pointer}.dataviews-title-field--clickable:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.components-card__body:has(>.dataviews-picker-wrapper),.components-card__body:has(>.dataviews-wrapper){overflow:hidden;padding:8px 0 0}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-filters__container,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-footer,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-loading,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-no-results,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-grid,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews__view-actions,.components-card__body:has(>.dataviews-wrapper) .dataviews-filters__container,.components-card__body:has(>.dataviews-wrapper) .dataviews-footer,.components-card__body:has(>.dataviews-wrapper) .dataviews-loading,.components-card__body:has(>.dataviews-wrapper) .dataviews-no-results,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-grid,.components-card__body:has(>.dataviews-wrapper) .dataviews__view-actions{padding-inline:24px}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr td:first-child,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr th:first-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr td:first-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr th:first-child{padding-inline-start:24px}.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr td:last-child,.components-card__body:has(>.dataviews-picker-wrapper) .dataviews-view-table tr th:last-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr td:last-child,.components-card__body:has(>.dataviews-wrapper) .dataviews-view-table tr th:last-child{padding-inline-end:24px}.dataviews-bulk-actions-footer__item-count{color:#1e1e1e;font-size:11px;font-weight:499;text-transform:uppercase}.dataviews-bulk-actions-footer__container{margin-right:auto;min-height:32px}.dataviews-filters__button{position:relative}.dataviews-filters__container{padding-top:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true],.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:hover{opacity:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:focus{opacity:1}.dataviews-filters__summary-popover{font-size:13px;line-height:1.4}.dataviews-filters__summary-popover .components-popover__content{border-radius:4px;max-width:250px;min-width:230px;width:100%}.dataviews-filters__summary-popover.components-dropdown__content .components-popover__content{padding:0}.dataviews-filters__summary-operators-container{padding:8px 16px}.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-listbox),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-no-elements),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__user-input-widget){border-bottom:1px solid #e0e0e0}.dataviews-filters__summary-operators-container:empty{display:none}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name{color:#757575;flex-shrink:0;max-width:calc(100% - 55px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select{overflow:hidden;white-space:nowrap;width:100%}.dataviews-filters__summary-chip-container{position:relative;white-space:pre-wrap}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip{align-items:center;background:#f0f0f0;border:1px solid transparent;border-radius:16px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;min-height:32px;padding:4px 12px;position:relative}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable{cursor:default}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-reset{padding-inline-end:28px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:hover:not(.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable),.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip[aria-expanded=true]{background:#e0e0e0;color:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values{background:rgba(var(--wp-admin-theme-color--rgb),.04);color:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values:hover,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values[aria-expanded=true]{background:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip .dataviews-filters-__summary-filter-text-name{font-weight:499}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove{align-items:center;background:transparent;border:0;border-radius:50%;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:absolute;right:4px;top:50%;transform:translateY(-50%);width:24px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove svg{fill:#757575}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover{background:#e0e0e0}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus svg,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover svg{fill:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values svg{fill:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values:hover{background:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__search-widget-filter-combobox-list{border-top:1px solid #e0e0e0;max-height:184px;overflow:auto;padding:4px}.dataviews-filters__search-widget-filter-combobox-list .dataviews-filters__search-widget-filter-combobox-item-value [data-user-value]{font-weight:600}.dataviews-filters__search-widget-listbox{overflow:auto;padding:4px}.dataviews-filters__search-widget-listitem{align-items:center;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;gap:8px;line-height:20px;min-height:32px;padding:4px 12px}.dataviews-filters__search-widget-listitem:last-child{margin-block-end:0}.dataviews-filters__search-widget-listitem:focus,.dataviews-filters__search-widget-listitem:hover,.dataviews-filters__search-widget-listitem[data-active-item]{background-color:var(--wp-admin-theme-color);color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description{color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection{background:#fff;border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection{border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description{color:#757575;display:block;font-size:12px;line-height:16px;overflow:hidden;text-overflow:ellipsis}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{border:1px solid #1e1e1e;border-radius:50%;height:24px;margin-right:12px;max-width:24px;min-width:24px;position:relative;transition:none;width:24px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{height:16px;max-width:16px;min-width:16px;width:16px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked{background:var(--wp-admin-theme-color);border:none}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{margin:0;padding:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{background-color:#fff;border:4px solid #fff;border-radius:50%;box-sizing:inherit;content:"";height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:24px;border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-right:12px;padding:6px 8px;transition:none}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-moz-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:-ms-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::-ms-check{opacity:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media(min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{margin:-4px 0 0 -5px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{content:"";display:inline-block;float:left;font:normal 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media(min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{float:none;font-size:21px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true]{background:#f0f0f0;border-color:#ddd;cursor:default;opacity:1}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{background:#fff;color:#1e1e1e;height:var(--checkbox-size);margin:0;padding:0;position:relative;width:var(--checkbox-size)}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:16px}}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:border-color .1s ease-in-out}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:var(--checkbox-size);fill:#fff;height:var(--checkmark-size);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--checkmark-size)}@media(min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:calc(var(--checkbox-size) + 4px)}}.dataviews-filters__search-widget-filter-combobox__wrapper{padding:8px;position:relative}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 transparent;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:normal;padding:6px 8px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{transition:box-shadow .1s linear}}@media(min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid transparent}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-moz-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:-ms-input-placeholder{color:rgba(30,30,30,.62)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{display:block;font-size:16px;height:32px;margin-left:0;margin-right:0;padding:0 8px 0 32px;width:100%}@media(min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{background:#fff;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-moz-placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-cancel-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-decoration,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-decoration{-webkit-appearance:none}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon{align-items:center;bottom:0;display:flex;inset-inline-start:12px;justify-content:center;position:absolute;top:0;width:24px}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon:dir(ltr){transform:scaleX(-1)}.dataviews-filters__container-visibility-toggle{flex-shrink:0;position:relative}.dataviews-filters-toggle__count{background:var(--wp-admin-theme-color,#3858e9);border-radius:8px;box-sizing:border-box;color:#fff;font-size:11px;height:16px;line-height:16px;min-width:16px;outline:var(--wp-admin-border-width-focus) solid #fff;padding:0 4px;position:absolute;right:0;text-align:center;top:0;transform:translate(50%,-50%)}.dataviews-search{width:-moz-fit-content;width:fit-content}.dataviews-filters__user-input-widget{padding:16px}.dataviews-filters__user-input-widget .components-input-control__prefix{padding-left:8px}.dataviews-filters__search-widget-no-elements{align-items:center;display:flex;justify-content:center;padding:16px}.dataviews-footer{background-color:#fff;border-top:1px solid #f0f0f0;bottom:0;flex-shrink:0;left:0;padding:12px 48px;position:sticky}@media not (prefers-reduced-motion){.dataviews-footer{transition:padding .1s ease-out}}.dataviews-footer{z-index:2}@container (max-width: 430px){.dataviews-footer{padding:12px 24px}}@container (max-width: 560px){.dataviews-footer{flex-direction:column!important}.dataviews-footer .dataviews-bulk-actions-footer__container{width:100%}.dataviews-footer .dataviews-bulk-actions-footer__item-count{flex-grow:1}.dataviews-footer .dataviews-pagination{justify-content:space-between;width:100%}}.dataviews-pagination__page-select{font-size:11px;font-weight:499;text-transform:uppercase}@media(min-width:600px){.dataviews-pagination__page-select .components-select-control__input{font-size:11px!important;font-weight:499}}.dataviews-action-modal{z-index:1000001}.dataviews-picker-footer__bulk-selection{align-self:flex-start;height:32px}.dataviews-picker-footer__actions{align-self:flex-end}.dataviews-selection-checkbox{--checkbox-input-size:24px}@media(min-width:600px){.dataviews-selection-checkbox{--checkbox-input-size:16px}}.dataviews-selection-checkbox{flex-shrink:0;line-height:0}.dataviews-selection-checkbox .components-checkbox-control__input-container{margin:0}.dataviews-view-config{container-type:inline-size;font-size:13px;line-height:1.4;width:320px}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper{height:100%;overflow-y:scroll}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper .dataviews-view-config{width:auto}.dataviews-view-config__sort-direction .components-toggle-group-control-option-base{text-transform:uppercase}.dataviews-settings-section__title.dataviews-settings-section__title{font-size:15px;line-height:24px}.dataviews-settings-section__sidebar{grid-column:span 4}.dataviews-settings-section__content,.dataviews-settings-section__content>*{grid-column:span 8}.dataviews-settings-section__content .is-divided-in-two{display:contents}.dataviews-settings-section__content .is-divided-in-two>*{grid-column:span 4}.dataviews-settings-section:has(.dataviews-settings-section__content:empty){display:none}@container (max-width: 500px){.dataviews-settings-section.dataviews-settings-section{grid-template-columns:repeat(2,1fr)}.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__content,.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__sidebar{grid-column:span 2}}.dataviews-field-control__field{height:32px}.dataviews-field-control__actions{position:absolute;top:-9999em}.dataviews-field-control__actions.dataviews-field-control__actions{gap:4px}.dataviews-field-control__field.is-interacting .dataviews-field-control__actions,.dataviews-field-control__field:focus-within .dataviews-field-control__actions,.dataviews-field-control__field:hover .dataviews-field-control__actions{position:unset;top:unset}.dataviews-field-control__icon{display:flex;width:24px}.dataviews-field-control__label-sub-label-container{flex-grow:1}.dataviews-field-control__label{display:block}.dataviews-field-control__sub-label{color:#757575;font-size:11px;font-style:normal;margin-bottom:0;margin-top:8px}.dataviews-view-grid-items{container-type:inline-size;display:grid;gap:32px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));grid-template-rows:max-content;margin-bottom:auto;padding:0 48px 24px}@container (max-width: 430px){.dataviews-view-grid-items{padding-left:24px;padding-right:24px}}@media not (prefers-reduced-motion){.dataviews-view-grid-items{transition:padding .1s ease-out}}.dataviews-view-grid .dataviews-view-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-actions{padding:8px 0 4px}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable{width:-moz-fit-content;width:fit-content}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{color:#1e1e1e}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;overflow:hidden;position:relative;width:100%}.dataviews-view-grid .dataviews-view-grid__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-grid .dataviews-view-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-grid .dataviews-view-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field{align-items:center;min-height:24px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))){display:none}.dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-grid__field-value:empty,.dataviews-view-grid__field:empty{display:none}.dataviews-view-grid__card .dataviews-selection-checkbox{left:8px;opacity:0;position:absolute;top:-9999em;z-index:1}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-selection-checkbox{transition:opacity .1s linear}}@media(hover:none){.dataviews-view-grid__card .dataviews-selection-checkbox{opacity:1;top:8px}}.dataviews-view-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-grid__card:hover .dataviews-selection-checkbox{opacity:1;top:8px}.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:0;position:absolute;right:4px;top:4px}.dataviews-view-grid__card .dataviews-view-grid__media-actions .dataviews-all-actions-button{background-color:#fff}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-view-grid__media-actions{transition:opacity .1s linear}}@media(hover:none){.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:1;top:4px}}.dataviews-view-grid__card .dataviews-view-grid__media-actions:has(.dataviews-all-actions-button[aria-expanded=true]),.dataviews-view-grid__card:focus-within .dataviews-view-grid__media-actions,.dataviews-view-grid__card:hover .dataviews-view-grid__media-actions{opacity:1}.dataviews-view-grid__media--clickable{cursor:pointer}.dataviews-view-grid__group-header{color:#1e1e1e;container-type:inline-size;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}@container (max-width: 430px){.dataviews-view-grid__group-header{padding-left:24px;padding-right:24px}}div.dataviews-view-list{list-style-type:none}.dataviews-view-list{margin:0 0 auto}.dataviews-view-list div[role=article],.dataviews-view-list div[role=row]{border-top:1px solid #f0f0f0;margin:0}.dataviews-view-list div[role=article] .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row] .dataviews-view-list__item-wrapper{box-sizing:border-box;padding:16px 24px;position:relative}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions{display:flex;flex:0 0 auto;gap:4px;width:-moz-max-content;width:max-content}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions .components-button,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button{position:relative;z-index:1}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>div,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>div{height:24px}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex:0;overflow:hidden;width:0}.dataviews-view-list div[role=article]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}@media(hover:none){.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}}.dataviews-view-list div[role=article].is-selected.is-selected,.dataviews-view-list div[role=article].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=article].is-selected.is-selected+div[role=row],.dataviews-view-list div[role=row].is-selected.is-selected,.dataviews-view-list div[role=row].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=row].is-selected.is-selected+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected) .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected) .dataviews-view-list__title-field{color:#1e1e1e}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered,.dataviews-view-list div[role=article]:not(.is-selected):focus-within,.dataviews-view-list div[role=article]:not(.is-selected):hover,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered,.dataviews-view-list div[role=row]:not(.is-selected):focus-within,.dataviews-view-list div[role=row]:not(.is-selected):hover{background-color:#f8f8f8;color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__title-field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__title-field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__fields,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__title-field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__fields,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__title-field{color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);color:#1e1e1e}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__title-field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__fields,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__title-field{color:var(--wp-admin-theme-color)}.dataviews-view-list .dataviews-view-list__item{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;inset:0;padding:0;position:absolute;scroll-margin:8px 0;z-index:1}.dataviews-view-list .dataviews-view-list__item:focus-visible{outline:none}.dataviews-view-list .dataviews-view-list__item:focus-visible:before{border-radius:2px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";inset:var(--wp-admin-border-width-focus);outline:2px solid transparent;position:absolute}.dataviews-view-list .dataviews-view-list__title-field{flex:1;line-height:24px;min-height:24px;overflow:hidden}.dataviews-view-list .dataviews-view-list__title-field:has(a,button){z-index:1}.dataviews-view-list .dataviews-view-list__media-wrapper{background-color:#fff;border-radius:4px;flex-shrink:0;height:52px;overflow:hidden;position:relative;width:52px}.dataviews-view-list .dataviews-view-list__media-wrapper img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-list .dataviews-view-list__media-wrapper:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-list .dataviews-view-list__field-wrapper{flex-grow:1;min-height:52px}.dataviews-view-list .dataviews-view-list__fields{color:#757575;display:flex;flex-wrap:wrap;font-size:12px;gap:12px;row-gap:4px}.dataviews-view-list .dataviews-view-list__fields:empty{display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field:has(.dataviews-view-list__field-value:empty){display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field-value{align-items:center;display:flex;line-height:20px;min-height:24px}.dataviews-view-list+.dataviews-pagination{justify-content:space-between}.dataviews-view-list__group-header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}.dataviews-view-table{border-collapse:collapse;border-color:inherit;color:#757575;margin-bottom:auto;position:relative;text-indent:0;width:100%}.dataviews-view-table th{color:#1e1e1e;font-size:13px;font-weight:400;text-align:left}.dataviews-view-table td,.dataviews-view-table th{padding:12px}.dataviews-view-table td.dataviews-view-table__actions-column,.dataviews-view-table th.dataviews-view-table__actions-column{text-align:right}.dataviews-view-table td.dataviews-view-table__actions-column--sticky,.dataviews-view-table th.dataviews-view-table__actions-column--sticky{background-color:#fff;position:sticky;right:0}.dataviews-view-table td.dataviews-view-table__actions-column--stuck:after,.dataviews-view-table th.dataviews-view-table__actions-column--stuck:after{background-color:#f0f0f0;bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:1px}.dataviews-view-table td.dataviews-view-table__checkbox-column,.dataviews-view-table th.dataviews-view-table__checkbox-column{padding-right:0;width:1%}.dataviews-view-table td.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper,.dataviews-view-table th.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper{max-width:auto;min-width:auto}.dataviews-view-table tr{border-top:1px solid #f0f0f0}.dataviews-view-table tr .dataviews-view-table-header-button{gap:4px}.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-left:48px}.dataviews-view-table tr td:first-child .dataviews-view-table-header-button,.dataviews-view-table tr th:first-child .dataviews-view-table-header-button{margin-left:-8px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-right:48px}.dataviews-view-table tr:last-child{border-bottom:0}.dataviews-view-table tr.is-hovered,.dataviews-view-table tr.is-hovered .dataviews-view-table__actions-column--sticky{background-color:#f8f8f8}.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input{opacity:0}.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:checked,.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:focus,.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input:indeterminate{opacity:1}.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:0}.dataviews-view-table tr.is-hovered .components-checkbox-control__input,.dataviews-view-table tr.is-hovered .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:focus-within .components-checkbox-control__input,.dataviews-view-table tr:focus-within .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:hover .components-checkbox-control__input,.dataviews-view-table tr:hover .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}@media(hover:none){.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input,.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}}.dataviews-view-table tr.is-selected{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);color:#757575}.dataviews-view-table tr.is-selected,.dataviews-view-table tr.is-selected+tr{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-table tr.is-selected:hover{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table tr.is-selected:hover .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 8%,#fff)}.dataviews-view-table thead{inset-block-start:0;position:sticky;z-index:1}.dataviews-view-table thead tr{border:0}.dataviews-view-table thead tr .components-checkbox-control__input.components-checkbox-control__input{opacity:1}.dataviews-view-table thead th{background-color:#fff;font-size:11px;font-weight:499;padding-bottom:8px;padding-left:12px;padding-top:8px;text-transform:uppercase}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-left:4px}.dataviews-view-table tbody td{vertical-align:top}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper{align-items:center;display:flex;min-height:32px}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end{justify-content:flex-end}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center{justify-content:center}.dataviews-view-table tbody .components-v-stack>.dataviews-view-table__cell-content-wrapper:not(:first-child){min-height:0}.dataviews-view-table .dataviews-view-table-header-button{font-size:11px;font-weight:499;padding:4px 8px;text-transform:uppercase}.dataviews-view-table .dataviews-view-table-header-button:not(:hover){color:#1e1e1e}.dataviews-view-table .dataviews-view-table-header-button span{speak:none}.dataviews-view-table .dataviews-view-table-header-button span:empty{display:none}.dataviews-view-table .dataviews-view-table-header{padding-left:4px}.dataviews-view-table .dataviews-view-table__actions-column{white-space:nowrap;width:auto}.dataviews-view-table:has(tr.is-selected) .components-checkbox-control__input{opacity:1}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-left:0}.dataviews-view-table.has-compact-density td,.dataviews-view-table.has-compact-density th{padding:4px 8px}.dataviews-view-table.has-comfortable-density td,.dataviews-view-table.has-comfortable-density th{padding:16px 12px}.dataviews-view-table.has-comfortable-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-comfortable-density th.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density th.dataviews-view-table__checkbox-column{padding-right:0}@container (max-width: 430px){.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-left:24px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-right:24px}}.dataviews-view-table-selection-checkbox{--checkbox-input-size:24px}@media(min-width:600px){.dataviews-view-table-selection-checkbox{--checkbox-input-size:16px}}.dataviews-column-primary__media{background-color:#fff;border-radius:4px;flex-shrink:0;max-width:60px;overflow:hidden;position:relative}.dataviews-column-primary__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-column-primary__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-table__cell-content-wrapper:not(.dataviews-column-primary__media),.dataviews-view-table__primary-column-content:not(.dataviews-column-primary__media){max-width:80ch;min-width:15ch}.dataviews-view-table__group-header-row .dataviews-view-table__group-header-cell{color:#1e1e1e;font-weight:499;padding:12px 48px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-actions{padding:8px 0 4px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field--clickable{width:-moz-fit-content;width:fit-content}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{color:#1e1e1e}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after,.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-picker-grid:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-grid:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-selection-checkbox{top:8px!important}.dataviews-view-picker-grid .dataviews-selection-checkbox input{pointer-events:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;position:relative;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field{align-items:center;min-height:24px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field:not(:has(.dataviews-view-picker-grid__field-value:not(:empty))){display:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-picker-grid__field-value:empty,.dataviews-view-picker-grid__field:empty{display:none}.dataviews-view-picker-grid__card .dataviews-selection-checkbox{left:8px;position:absolute;top:-9999em;z-index:1}@media(hover:none){.dataviews-view-picker-grid__card .dataviews-selection-checkbox{top:8px}}.dataviews-view-picker-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:hover .dataviews-selection-checkbox{top:8px}.dataviews-view-picker-grid__media--clickable{cursor:pointer}.dataviews-view-picker-grid-group__header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}.dataviews-controls__datetime{border:none;padding:0}.dataviews-controls__relative-date-number,.dataviews-controls__relative-date-unit{flex:1 1 50%}.dataviews-controls__date input[type=date]::-webkit-calendar-picker-indicator,.dataviews-controls__date input[type=date]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}.dataviews-controls__date-preset{border:1px solid #ddd}.dataviews-controls__date-preset:active{background-color:#000}.dataforms-layouts-panel__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-panel__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-panel__field-label--label-position-side{align-self:center}.dataforms-layouts-panel__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-panel__field-control .components-button{max-width:100%;min-height:32px;text-align:left;text-wrap:balance;text-wrap:pretty;white-space:normal}.dataforms-layouts-panel__field-control.components-button.is-link[aria-disabled=true]{text-decoration:none}.dataforms-layouts-panel__field-control .components-dropdown{max-width:100%}.dataforms-layouts-panel__field-dropdown .components-popover__content{min-width:320px;padding:16px}.dataforms-layouts-panel__dropdown-header{margin-bottom:16px}.dataforms-layouts-panel__modal-footer{margin-top:16px}.components-popover.components-dropdown__content.dataforms-layouts-panel__field-dropdown{z-index:159990}.dataforms-layouts-regular__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-regular__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-regular__field-label--label-position-side{align-self:center}.dataforms-layouts-regular__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-card__field-header-label{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:15px;font-weight:499;line-height:20px}.dataforms-layouts-card__field{width:100%}.dataforms-layouts-card__field-description{color:#757575;display:block;font-size:13px;margin-bottom:16px}.dataforms-layouts-card__field-summary{display:flex;flex-direction:row;gap:16px}.dataforms-layouts-row__field-control{width:100%}.dataforms-layouts__wrapper{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px} diff --git a/build/social-web/style-index-rtl.css b/build/social-web/style-index-rtl.css new file mode 100644 index 000000000..19f574481 --- /dev/null +++ b/build/social-web/style-index-rtl.css @@ -0,0 +1,7 @@ +.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-left:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;right:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;left:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{align-items:center;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{fill:currentColor;height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-right:-4px;overflow:hidden;padding-left:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;left:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)} +.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)} +.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden} +.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) 0 var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px);min-height:0} +#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:400px}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;right:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;right:10px;left:10px}} +.page{display:flex;flex-direction:column;height:100%}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0} +:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;right:0;position:fixed;left:0;top:0}#wpfooter{display:none} diff --git a/build/social-web/style-index.css b/build/social-web/style-index.css new file mode 100644 index 000000000..091cde0ce --- /dev/null +++ b/build/social-web/style-index.css @@ -0,0 +1,7 @@ +.site-hub{align-items:center;display:flex;gap:var(--wpds-spacing-20,8px);height:var(--wpds-spacing-160,64px);justify-content:space-between;margin-right:var(--wpds-spacing-30,12px)}.site-hub__actions{flex-shrink:0}.site-hub__icon-container{flex-shrink:0;height:var(--wpds-spacing-160,64px);width:var(--wpds-spacing-160,64px)}.site-hub__icon-container.has-transparent-background .site-hub__icon-container{background:transparent}.site-hub__icon-button.components-button{align-items:center;background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);border-radius:0;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;overflow:hidden;padding:0;position:relative;view-transition-name:toggle;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button,.site-hub__icon-button.components-button:active,.site-hub__icon-button.components-button:hover{color:var(--wpds-color-fg-inverted-primary,#fff)}.site-hub__icon-button.components-button:focus,.site-hub__icon-button.components-button:focus-visible{box-shadow:0 0 0 3px #1e1e1e,0 0 0 6px var(--wp-admin-theme-color);outline:4px solid transparent;outline-offset:4px}.site-hub__icon-button.components-button:before{border-radius:var(--wpds-border-radius-large,8px);bottom:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));box-shadow:none;content:"";display:block;left:calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px));position:absolute;right:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px));top:calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px))}@media not (prefers-reduced-motion){.site-hub__icon-button.components-button:before{transition:box-shadow .1s ease}}.site-hub__icon-button.components-button .site-icon{align-items:center;display:flex;height:var(--wpds-spacing-160,64px);justify-content:center;width:var(--wpds-spacing-160,64px)}.site-hub__icon-button.components-button .site-icon__icon{fill:currentColor;height:100%;width:100%}.site-hub__title .components-button{display:block;flex-grow:1;font-size:var(--wpds-font-size-medium,15px);font-weight:var(--wpds-font-weight-medium,500);margin-left:-4px;overflow:hidden;padding-right:var(--wpds-spacing-40,16px);position:relative;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}.site-hub__title .components-button,.site-hub__title .components-button:active,.site-hub__title .components-button:focus,.site-hub__title .components-button:hover{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__title .components-button:focus{box-shadow:none;outline:none}.site-hub__title .components-button:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) #1e1e1e,0 0 0 calc(var(--wp-admin-border-width-focus)*2) var(--wpds-color-stroke-focus-brand,#0675c4);outline:2px solid transparent;outline-offset:2px}.site-hub__title .components-button:after{content:"↗";font-weight:400;opacity:0;position:absolute;right:0}@media not (prefers-reduced-motion){.site-hub__title .components-button:after{transition:opacity .1s linear}}.site-hub__title .components-button:active:after,.site-hub__title .components-button:focus:after,.site-hub__title .components-button:hover:after{opacity:1}.site-hub__command-button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0)}.site-hub__command-button:active svg,.site-hub__command-button:hover svg{fill:var(--wpds-color-private-bg-fg-fill,#f0f0f0)} +.sidebar{color:var(--wpds-color-fg-inverted-secondary,#ccc);display:flex;flex:1;flex-direction:column}.sidebar .nav{flex:1;overflow-y:auto;padding:0 var(--wpds-spacing-30,12px)}.sidebar .sidebar-navigation__icon-title{background:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);margin-bottom:var(--wpds-spacing-20,8px);padding-bottom:var(--wpds-spacing-20,8px);padding-top:var(--wpds-spacing-120,48px);position:sticky;top:0}.sidebar .sidebar-navigation__button{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-shrink:0}.sidebar .sidebar-navigation__button:focus:not(:disabled){box-shadow:none;outline:none}.sidebar .sidebar-navigation__button:focus-visible:not(:disabled){box-shadow:0 0 0 var(--wpds-border-width-focus,1.5px) var(--wp-admin-theme-color);outline:3px solid transparent}.sidebar .sidebar-navigation__button:focus,.sidebar .sidebar-navigation__button:focus-visible,.sidebar .sidebar-navigation__button:hover:not(:disabled,[aria-disabled=true]),.sidebar .sidebar-navigation__button:not(:disabled,[aria-disabled=true]):active,.sidebar .sidebar-navigation__button[aria-expanded=true]{color:var(--wpds-color-private-bg-fg-fill,#f0f0f0)}.sidebar .sidebar-navigation__title{color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);flex-grow:1;line-height:var(--wpds-spacing-80,32px);overflow-wrap:break-word}.sidebar .menu-item{align-items:center;color:var(--wpds-color-fg-inverted-secondary,#e0e0e0);display:flex;gap:var(--wpds-spacing-20,8px)}.sidebar .menu-item:hover{background-color:var(--wpds-color-bg-interactive-neutral-hover,hsla(0,0%,100%,.1));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item.is-selected{background-color:var(--wpds-color-bg-interactive-neutral-active,hsla(0,0%,100%,.15));color:var(--wpds-color-fg-inverted-primary,#fff)}.sidebar .menu-item svg{flex-shrink:0}.sidebar .footer{border-top:1px solid var(--wpds-color-stroke-inverted,hsla(0,0%,100%,.1));padding:var(--wpds-spacing-40,16px)} +.themed-surface{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-large,8px);display:flex;flex:1;flex-direction:column;min-height:0;overflow:hidden} +.panel{display:flex;flex:1;flex-direction:column;margin:var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) var(--wpds-spacing-40,16px) 0;min-height:0} +#activitypub-social-web-root>div{height:100%}.app-layout{flex-direction:column}.app-content,.app-layout{background-color:var(--wpds-color-bg-surface-neutral-weak,#1e1e1e);display:flex;height:100%;overflow:hidden;width:100%}.app-content{flex-grow:1}.sidebar-region{flex-shrink:0;width:300px}.sidebar-region,.stage-region{display:flex;flex-direction:column}.stage-region{flex-grow:1;min-width:400px}.inspector-region{display:flex;flex-direction:column;flex-shrink:0;width:var(--sw-inspector-width)}.components-snackbar-list{bottom:20px;left:20px;position:fixed;z-index:100000}@media(max-width:782px){.app-content{flex-direction:column}.inspector-region,.sidebar-region{width:100%}.components-snackbar-list{bottom:10px;left:10px;right:10px}} +.page{display:flex;flex-direction:column;height:100%}.header{flex-shrink:0;padding:var(--wpds-spacing-60,24px)}.header.has-border{border-bottom:var(--wpds-border-width-focus,1px) solid var(--wpds-color-stroke-surface-neutral,#ddd)}.title-row{gap:var(--wpds-spacing-40,16px);justify-content:space-between}.title-group,.title-row{align-items:center;display:flex}.title-group{gap:var(--wpds-spacing-30,12px)}.title{color:var(--wpds-color-fg-primary,#1e1e1e);font-size:var(--wpds-font-size-large,20px);font-weight:500;margin:0}.sub-title{color:var(--wpds-color-fg-secondary,#757575);font-size:var(--wpds-font-size-small,13px);margin:var(--wpds-spacing-20,8px) 0 0}.content{display:flex;flex:1;flex-direction:column;gap:var(--wpds-spacing-60,24px);overflow:auto}.content.padded{padding:var(--wpds-spacing-60,24px)}.content.constrained{margin:0 auto;max-width:960px;width:100%}.content.full{padding:0} +:root{--sw-sidebar-width:300px;--sw-inspector-width:380px}.activitypub-social-web-layout{bottom:0;left:0;position:fixed;right:0;top:0}#wpfooter{display:none} diff --git a/build/social-web/vendors.asset.php b/build/social-web/vendors.asset.php new file mode 100644 index 000000000..d9e7f8367 --- /dev/null +++ b/build/social-web/vendors.asset.php @@ -0,0 +1 @@ + array(), 'version' => '3dfe745cc34580c55b09'); diff --git a/build/social-web/vendors.js b/build/social-web/vendors.js new file mode 100644 index 000000000..770feb199 --- /dev/null +++ b/build/social-web/vendors.js @@ -0,0 +1,115 @@ +(globalThis.webpackChunkwordpress_activitypub=globalThis.webpackChunkwordpress_activitypub||[]).push([[803],{38:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(r.Path,{d:"M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z"})})},164:(e,t,n)=>{"use strict";function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;tr});const r=function(){for(var e,t,n=0,r="",a=arguments.length;n{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var i,r,a;if(Array.isArray(t)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(!e(t[r],n[r]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;for(r of t.entries())if(!e(r[1],n.get(r[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(r of t.entries())if(!n.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((i=t.length)!=n.length)return!1;for(r=i;0!==r--;)if(t[r]!==n[r])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((i=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(r=i;0!==r--;)if(!Object.prototype.hasOwnProperty.call(n,a[r]))return!1;for(r=i;0!==r--;){var s=a[r];if(!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},307:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.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"})})},493:(e,t,n)=>{"use strict";var i=n(609),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=i.useState,s=i.useEffect,l=i.useLayoutEffect,o=i.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),i=a({inst:{value:n,getSnapshot:t}}),r=i[0].inst,c=i[1];return l(function(){r.value=n,r.getSnapshot=t,u(r)&&c({inst:r})},[e,n,t]),s(function(){return u(r)&&c({inst:r}),e(function(){u(r)&&c({inst:r})})},[e]),o(n),n};t.useSyncExternalStore=void 0!==i.useSyncExternalStore?i.useSyncExternalStore:c},510:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});var i=Object.prototype.hasOwnProperty;function r(e,t,n){for(n of e.keys())if(a(n,t))return n}function a(e,t){var n,s,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((s=e.length)===t.length)for(;s--&&a(e[s],t[s]););return-1===s}if(n===Set){if(e.size!==t.size)return!1;for(s of e){if((l=s)&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!t.has(l))return!1}return!0}if(n===Map){if(e.size!==t.size)return!1;for(s of e){if((l=s[0])&&"object"==typeof l&&!(l=r(t,l)))return!1;if(!a(s[1],t.get(l)))return!1}return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((s=e.byteLength)===t.byteLength)for(;s--&&e.getInt8(s)===t.getInt8(s););return-1===s}if(ArrayBuffer.isView(e)){if((s=e.byteLength)===t.byteLength)for(;s--&&e[s]===t[s];);return-1===s}if(!n||"object"==typeof e){for(n in s=0,e){if(i.call(e,n)&&++s&&!i.call(t,n))return!1;if(!(n in t)||!a(e[n],t[n]))return!1}return Object.keys(t).length===s}}return e!=e&&t!=t}var s=n(87),l=n(143),o=n(233);function u(e){const{kind:t,name:n,slug:i,defaultView:r,queryParams:u,onChangeQueryParams:c}=e,d=function(e,t,n){return`dataviews-${e}-${t}-${n}`}(t,n,i),f=(0,l.useSelect)(e=>e(o.store).get("core/views",d),[d]),{set:m}=(0,l.useDispatch)(o.store),v=f??r,p=u?.page??v.page??1,h=u?.search??v.search??"";return{view:(0,s.useMemo)(()=>({...v,page:p,search:h}),[v,p,h]),isModified:!!f,updateView:(0,s.useCallback)(e=>{const t={page:e?.page,search:e?.search},n=function(e){const t={...e};for(const e of["page","search"])delete t[e];return t}(e);c&&!a(t,{page:p,search:h})&&c(t),a(v,n)||(a(n,r)?m("core/views",d,void 0):m("core/views",d,n))},[c,p,h,v,r,m,d]),resetToDefault:(0,s.useCallback)(()=>{m("core/views",d,void 0)},[d,m])}}},572:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{d:"M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z"})})},577:(e,t,n)=>{"use strict";n.d(t,{A:()=>co});var i=n(790),r=n(427),a=n(87),s=n(491),l=n(723),o=n(573),u=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z"})}),c=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z"})});const d="is",f="isNot",m="isAny",v="isNone",p="isAll",h="isNotAll",g="lessThan",b="greaterThan",x="lessThanOrEqual",w="greaterThanOrEqual",y="before",_="after",C="beforeInc",j="afterInc",S="contains",V="notContains",k="startsWith",I="between",E="on",N="notOn",M="inThePast",F="over",O=[d,f,m,v,p,h,g,b,x,w,y,_,C,j,S,V,k,I,E,N,M,F],A=[d,f,g,b,x,w,y,_,C,j,S,V,k,E,N],P={[d]:{key:"is-filter",label:(0,l.__)("Is")},[f]:{key:"is-not-filter",label:(0,l.__)("Is not")},[m]:{key:"is-any-filter",label:(0,l.__)("Is any")},[v]:{key:"is-none-filter",label:(0,l.__)("Is none")},[p]:{key:"is-all-filter",label:(0,l.__)("Is all")},[h]:{key:"is-not-all-filter",label:(0,l.__)("Is not all")},[g]:{key:"less-than-filter",label:(0,l.__)("Less than")},[b]:{key:"greater-than-filter",label:(0,l.__)("Greater than")},[x]:{key:"less-than-or-equal-filter",label:(0,l.__)("Less than or equal")},[w]:{key:"greater-than-or-equal-filter",label:(0,l.__)("Greater than or equal")},[y]:{key:"before-filter",label:(0,l.__)("Before")},[_]:{key:"after-filter",label:(0,l.__)("After")},[C]:{key:"before-inc-filter",label:(0,l.__)("Before (inc)")},[j]:{key:"after-inc-filter",label:(0,l.__)("After (inc)")},[S]:{key:"contains-filter",label:(0,l.__)("Contains")},[V]:{key:"not-contains-filter",label:(0,l.__)("Doesn't contain")},[k]:{key:"starts-with-filter",label:(0,l.__)("Starts with")},[I]:{key:"between-filter",label:(0,l.__)("Between (inc)")},[E]:{key:"on-filter",label:(0,l.__)("On")},[N]:{key:"not-on-filter",label:(0,l.__)("Not on")},[M]:{key:"in-the-past-filter",label:(0,l.__)("In the past")},[F]:{key:"over-filter",label:(0,l.__)("Over")}},L=["asc","desc"],D={asc:"↑",desc:"↓"},T={asc:"ascending",desc:"descending"},B={asc:(0,l.__)("Sort ascending"),desc:(0,l.__)("Sort descending")},z={asc:u,desc:c},H="table",R="grid",$=(0,a.createContext)({view:{type:H},onChangeView:()=>{},fields:[],data:[],paginationInfo:{totalItems:0,totalPages:0},selection:[],onChangeSelection:()=>{},setOpenedFilter:()=>{},openedFilter:null,getItemId:e=>e.id,isItemClickable:()=>!0,renderItemLink:void 0,containerWidth:0,containerRef:(0,a.createRef)(),resizeObserverRef:()=>{},defaultLayouts:{list:{},grid:{},table:{}},filters:[],isShowingFilter:!1,setIsShowingFilter:()=>{},hasInfiniteScrollHandler:!1,config:{perPageSizes:[]}});$.displayName="DataViewsContext";var W=$,q=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.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.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z"})}),G=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z",fillRule:"evenodd",clipRule:"evenodd"})}),K=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"})}),Y=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})}),U=n(164),Z=n(558);function X({selection:e,onChangeSelection:t,item:n,getItemId:a,titleField:s,disabled:o,...u}){const c=a(n),d=!o&&e.includes(c),f=s?.getValue?.({item:n})||(0,l.__)("(no title)");return(0,i.jsx)(r.CheckboxControl,{className:"dataviews-selection-checkbox",__nextHasNoMarginBottom:!0,"aria-label":f,"aria-disabled":o,checked:d,onChange:()=>{o||t(e.includes(c)?e.filter(e=>c!==e):[...e,c])},...u})}var Q=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})}),J=n(143),ee=n(53);const{lock:te,unlock:ne}=(0,ee.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/dataviews"),{Menu:ie,kebabCase:re}=ne(r.privateApis);function ae({action:e,onClick:t,items:n}){const a="string"==typeof e.label?e.label:e.label(n);return(0,i.jsx)(r.Button,{disabled:!!e.disabled,accessibleWhenDisabled:!0,size:"compact",onClick:t,children:a})}function se({action:e,onClick:t,items:n}){const r="string"==typeof e.label?e.label:e.label(n);return(0,i.jsx)(ie.Item,{disabled:e.disabled,onClick:t,children:(0,i.jsx)(ie.ItemLabel,{children:r})})}function le({action:e,items:t,closeModal:n}){const a="string"==typeof e.label?e.label:e.label(t),s="function"==typeof e.modalHeader?e.modalHeader(t):e.modalHeader;return(0,i.jsx)(r.Modal,{title:s||a,__experimentalHideHeader:!!e.hideModalHeader,onRequestClose:n,focusOnMount:e.modalFocusOnMount??!0,size:e.modalSize||"medium",overlayClassName:`dataviews-action-modal dataviews-action-modal__${re(e.id)}`,children:(0,i.jsx)(e.RenderModal,{items:t,closeModal:n})})}function oe({actions:e,item:t,registry:n,setActiveModalAction:r}){return(0,i.jsx)(ie.Group,{children:e.map(e=>(0,i.jsx)(se,{action:e,onClick:()=>{"RenderModal"in e?r(e):e.callback([t],{registry:n})},items:[t]},e.id))})}function ue({item:e,actions:t,isCompact:n}){const s=(0,J.useRegistry)(),{primaryActions:l,eligibleActions:o}=(0,a.useMemo)(()=>{const n=t.filter(t=>!t.isEligible||t.isEligible(e));return{primaryActions:n.filter(e=>e.isPrimary),eligibleActions:n}},[t,e]);return n?(0,i.jsx)(ce,{item:e,actions:o,isSmall:!0,registry:s}):(0,i.jsxs)(r.__experimentalHStack,{spacing:0,justify:"flex-end",className:"dataviews-item-actions",style:{flexShrink:0,width:"auto"},children:[(0,i.jsx)(de,{item:e,actions:l,registry:s}),l.lengthu(null)})]})}function de({item:e,actions:t,registry:n}){const[r,l]=(0,a.useState)(null);return(0,s.useViewportMatch)("medium","<")?null:Array.isArray(t)&&0!==t.length?(0,i.jsxs)(i.Fragment,{children:[t.map(t=>(0,i.jsx)(ae,{action:t,onClick:()=>{"RenderModal"in t?l(t):t.callback([e],{registry:n})},items:[e]},t.id)),!!r&&(0,i.jsx)(le,{action:r,items:[e],closeModal:()=>l(null)})]}):null}var fe=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})});function me({action:e,items:t,ActionTriggerComponent:n}){const[r,s]=(0,a.useState)(!1),l={action:e,onClick:()=>{s(!0)},items:t};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n,{...l}),r&&(0,i.jsx)(le,{action:e,items:t,closeModal:()=>s(!1)})]})}function ve(e,t){return(0,a.useMemo)(()=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t))),[e,t])}function pe(e,t){return(0,a.useMemo)(()=>t.some(t=>e.some(e=>e.supportsBulk&&(!e.isEligible||e.isEligible(t)))),[e,t])}function he({selection:e,onChangeSelection:t,data:n,actions:s,getItemId:o}){const u=(0,a.useMemo)(()=>n.filter(e=>s.some(t=>t.supportsBulk&&(!t.isEligible||t.isEligible(e)))),[n,s]),c=n.filter(t=>e.includes(o(t))&&u.includes(t)),d=c.length===u.length;return(0,i.jsx)(r.CheckboxControl,{className:"dataviews-view-table-selection-checkbox",__nextHasNoMarginBottom:!0,checked:d,indeterminate:!d&&!!c.length,onChange:()=>{t(d?[]:u.map(e=>o(e)))},"aria-label":d?(0,l.__)("Deselect all"):(0,l.__)("Select all")})}function ge({action:e,onClick:t,isBusy:n,items:a}){const l="string"==typeof e.label?e.label:e.label(a);return(0,s.useViewportMatch)("medium","<")?(0,i.jsx)(r.Button,{disabled:n,accessibleWhenDisabled:!0,label:l,icon:e.icon,size:"compact",onClick:t,isBusy:n}):(0,i.jsx)(r.Button,{disabled:n,accessibleWhenDisabled:!0,size:"compact",onClick:t,isBusy:n,children:l})}const be=[];function xe({action:e,selectedItems:t,actionInProgress:n,setActionInProgress:r}){const s=(0,J.useRegistry)(),l=(0,a.useMemo)(()=>t.filter(t=>!e.isEligible||e.isEligible(t)),[e,t]);return"RenderModal"in e?(0,i.jsx)(me,{action:e,items:l,ActionTriggerComponent:ge},e.id):(0,i.jsx)(ge,{action:e,onClick:async()=>{r(e.id),await e.callback(t,{registry:s}),r(null)},items:l,isBusy:n===e.id},e.id)}function we(e,t,n,a,s,o,u,c,d){const f=o.length>0?(0,l.sprintf)( +/* translators: %d: number of items. */ +/* translators: %d: number of items. */ +(0,l._n)("%d Item selected","%d Items selected",o.length),o.length):(0,l.sprintf)( +/* translators: %d: number of items. */ +/* translators: %d: number of items. */ +(0,l._n)("%d Item","%d Items",e.length),e.length);return(0,i.jsxs)(r.__experimentalHStack,{expanded:!1,className:"dataviews-bulk-actions-footer__container",spacing:3,children:[(0,i.jsx)(he,{selection:a,onChangeSelection:d,data:e,actions:t,getItemId:n}),(0,i.jsx)("span",{className:"dataviews-bulk-actions-footer__item-count",children:f}),(0,i.jsxs)(r.__experimentalHStack,{className:"dataviews-bulk-actions-footer__action-buttons",expanded:!1,spacing:1,children:[s.map(e=>(0,i.jsx)(xe,{action:e,selectedItems:o,actionInProgress:u,setActionInProgress:c},e.id)),o.length>0&&(0,i.jsx)(r.Button,{icon:fe,showTooltip:!0,tooltipPosition:"top",size:"compact",label:(0,l.__)("Cancel"),disabled:!!u,accessibleWhenDisabled:!1,onClick:()=>{d(be)}})]})]})}function ye({selection:e,actions:t,onChangeSelection:n,data:i,getItemId:r}){const[l,o]=(0,a.useState)(null),u=(0,a.useRef)(null),c=(0,s.useViewportMatch)("medium","<"),d=(0,a.useMemo)(()=>t.filter(e=>e.supportsBulk),[t]),f=(0,a.useMemo)(()=>i.filter(e=>d.some(t=>!t.isEligible||t.isEligible(e))),[i,d]),m=(0,a.useMemo)(()=>i.filter(t=>e.includes(r(t))&&f.includes(t)),[e,i,r,f]),v=(0,a.useMemo)(()=>t.filter(e=>e.supportsBulk&&(!c||e.icon)&&m.some(t=>!e.isEligible||e.isEligible(t))),[t,m,c]);return l?(u.current||(u.current=we(i,t,r,e,v,m,l,o,n)),u.current):(u.current&&(u.current=null),we(i,t,r,e,v,m,l,o,n))}function _e(){const{data:e,selection:t,actions:n=be,onChangeSelection:r,getItemId:s}=(0,a.useContext)(W);return(0,i.jsx)(ye,{selection:t,onChangeSelection:r,data:e,actions:n,getItemId:s})}var Ce=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})}),je=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})}),Se=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z"})}),Ve=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z"})});const{Menu:ke}=ne(r.privateApis);function Ie({children:e}){return a.Children.toArray(e).filter(Boolean).map((e,t)=>(0,i.jsxs)(a.Fragment,{children:[t>0&&(0,i.jsx)(ke.Separator,{}),e]},t))}const Ee=(0,a.forwardRef)(function({fieldId:e,view:t,fields:n,onChangeView:a,onHide:s,setOpenedFilter:o,canMove:u=!0},c){const d=t.fields??[],f=d?.indexOf(e),m=t.sort?.field===e;let v=!1,p=!1,h=!1,g=[];const b=n.find(t=>t.id===e);if(!b)return null;v=!1!==b.enableHiding,p=!1!==b.enableSorting;const x=b.header;return g=!!b.filterBy&&b.filterBy?.operators||[],h=!(t.filters?.some(t=>e===t.field)||!b.hasElements&&!b.Edit||!1===b.filterBy||b.filterBy?.isPrimary),p||u||v||h?(0,i.jsxs)(ke,{children:[(0,i.jsxs)(ke.TriggerButton,{render:(0,i.jsx)(r.Button,{size:"compact",className:"dataviews-view-table-header-button",ref:c,variant:"tertiary"}),children:[x,t.sort&&m&&(0,i.jsx)("span",{"aria-hidden":"true",children:D[t.sort.direction]})]}),(0,i.jsx)(ke.Popover,{style:{minWidth:"240px"},children:(0,i.jsxs)(Ie,{children:[p&&(0,i.jsx)(ke.Group,{children:L.map(n=>{const r=t.sort&&m&&t.sort.direction===n,s=`${e}-${n}`;return(0,i.jsx)(ke.RadioItem,{name:"view-table-sorting",value:s,checked:r,onChange:()=>{a({...t,sort:{field:e,direction:n},showLevels:!1})},children:(0,i.jsx)(ke.ItemLabel,{children:B[n]})},s)})}),h&&(0,i.jsx)(ke.Group,{children:(0,i.jsx)(ke.Item,{prefix:(0,i.jsx)(r.Icon,{icon:Ce}),onClick:()=>{o(e),a({...t,page:1,filters:[...t.filters||[],{field:e,value:void 0,operator:g[0]}]})},children:(0,i.jsx)(ke.ItemLabel,{children:(0,l.__)("Add filter")})})}),(u||v)&&b&&(0,i.jsxs)(ke.Group,{children:[u&&(0,i.jsx)(ke.Item,{prefix:(0,i.jsx)(r.Icon,{icon:je}),disabled:f<1,onClick:()=>{a({...t,fields:[...d.slice(0,f-1)??[],e,d[f-1],...d.slice(f+1)]})},children:(0,i.jsx)(ke.ItemLabel,{children:(0,l.__)("Move left")})}),u&&(0,i.jsx)(ke.Item,{prefix:(0,i.jsx)(r.Icon,{icon:Se}),disabled:f>=d.length-1,onClick:()=>{a({...t,fields:[...d.slice(0,f)??[],d[f+1],e,...d.slice(f+2)]})},children:(0,i.jsx)(ke.ItemLabel,{children:(0,l.__)("Move right")})}),v&&b&&(0,i.jsx)(ke.Item,{prefix:(0,i.jsx)(r.Icon,{icon:Ve}),onClick:()=>{s(b),a({...t,fields:d.filter(t=>t!==e)})},children:(0,i.jsx)(ke.ItemLabel,{children:(0,l.__)("Hide column")})})]})]})})]}):x});var Ne=Ee;function Me({item:e,isItemClickable:t,onClickItem:n,renderItemLink:r,className:s,children:l,...o}){if(!t(e))return(0,i.jsx)("div",{className:s,...o,children:l});if(r){const t=r({item:e,className:`${s} ${s}--clickable`,...o,children:l});return(0,a.cloneElement)(t,{onClick:e=>{e.stopPropagation(),t.props.onClick&&t.props.onClick(e)},onKeyDown:e=>{"Enter"!==e.key&&""!==e.key&&" "!==e.key||(e.stopPropagation(),t.props.onKeyDown&&t.props.onKeyDown(e))}})}const u=function({item:e,isItemClickable:t,onClickItem:n,className:i}){return t(e)&&n?{className:i?`${i} ${i}--clickable`:void 0,role:"button",tabIndex:0,onClick:t=>{t.stopPropagation(),n(e)},onKeyDown:t=>{"Enter"!==t.key&&""!==t.key&&" "!==t.key||(t.stopPropagation(),n(e))}}:{className:i}}({item:e,isItemClickable:t,onClickItem:n,className:s});return(0,i.jsx)("div",{...u,...o,children:l})}var Fe=function({item:e,level:t,titleField:n,mediaField:a,descriptionField:s,onClickItem:o,renderItemLink:u,isItemClickable:c}){return(0,i.jsxs)(r.__experimentalHStack,{spacing:3,justify:"flex-start",children:[a&&(0,i.jsx)(Me,{item:e,isItemClickable:c,onClickItem:o,renderItemLink:u,className:"dataviews-view-table__cell-content-wrapper dataviews-column-primary__media","aria-label":n?(0,l.sprintf)( +// translators: %s is the item title. +// translators: %s is the item title. +(0,l.__)("Click item: %s"),n.getValue?.({item:e})):void 0,children:(0,i.jsx)(a.render,{item:e,field:a,config:{sizes:"32px"}})}),(0,i.jsxs)(r.__experimentalVStack,{spacing:0,alignment:"flex-start",className:"dataviews-view-table__primary-column-content",children:[n&&(0,i.jsxs)(Me,{item:e,isItemClickable:c,onClickItem:o,renderItemLink:u,className:"dataviews-view-table__cell-content-wrapper dataviews-title-field",children:[void 0!==t&&t>0&&(0,i.jsxs)("span",{className:"dataviews-view-table__level",children:["—".repeat(t)," "]}),(0,i.jsx)(n.render,{item:e,field:n})]}),s&&(0,i.jsx)(s.render,{item:e,field:s})]})]})};function Oe(e,t){return e.reduce((e,n)=>{const i=t.getValue({item:n});return e.has(i)||e.set(i,[]),e.get(i)?.push(n),e},new Map)}function Ae({item:e,fields:t,column:n,align:r}){const a=t.find(e=>e.id===n);if(!a)return null;const s=(0,U.A)("dataviews-view-table__cell-content-wrapper",{"dataviews-view-table__cell-align-end":"end"===r,"dataviews-view-table__cell-align-center":"center"===r});return(0,i.jsx)("div",{className:s,children:(0,i.jsx)(a.render,{item:e,field:a})})}function Pe({hasBulkActions:e,item:t,level:n,actions:r,fields:s,id:l,view:o,titleField:u,mediaField:c,descriptionField:d,selection:f,getItemId:m,isItemClickable:v,onClickItem:p,renderItemLink:h,onChangeSelection:g,isActionsColumnSticky:b,posinset:x}){const{paginationInfo:w}=(0,a.useContext)(W),y=ve(r,t),_=y&&f.includes(l),[C,j]=(0,a.useState)(!1),{showTitle:S=!0,showMedia:V=!0,showDescription:k=!0,infiniteScrollEnabled:I}=o,E=(0,a.useRef)(!1),N=o.fields??[],M=u&&S||c&&V||d&&k;return(0,i.jsxs)("tr",{className:(0,U.A)("dataviews-view-table__row",{"is-selected":y&&_,"is-hovered":C,"has-bulk-actions":y}),onMouseEnter:()=>{j(!0)},onMouseLeave:()=>{j(!1)},onTouchStart:()=>{E.current=!0},"aria-setsize":I?w.totalItems:void 0,"aria-posinset":x,role:I?"article":void 0,onClick:e=>{y&&(E.current||"Range"===document.getSelection()?.type||(((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey)?g(f.includes(l)?f.filter(e=>l!==e):[...f,l]):g(f.includes(l)?f.filter(e=>l!==e):[l])))},children:[e&&(0,i.jsx)("td",{className:"dataviews-view-table__checkbox-column",children:(0,i.jsx)("div",{className:"dataviews-view-table__cell-content-wrapper",children:(0,i.jsx)(X,{item:t,selection:f,onChangeSelection:g,getItemId:m,titleField:u,disabled:!y})})}),M&&(0,i.jsx)("td",{children:(0,i.jsx)(Fe,{item:t,level:n,titleField:S?u:void 0,mediaField:V?c:void 0,descriptionField:k?d:void 0,isItemClickable:v,onClickItem:p,renderItemLink:h})}),N.map(e=>{const{width:n,maxWidth:r,minWidth:a,align:l}=o.layout?.styles?.[e]??{};return(0,i.jsx)("td",{style:{width:n,maxWidth:r,minWidth:a},children:(0,i.jsx)(Ae,{fields:s,item:t,column:e,align:l})},e)}),!!r?.length&&(0,i.jsx)("td",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":b}),onClick:e=>e.stopPropagation(),children:(0,i.jsx)(ue,{item:t,actions:r})})]})}const Le=(0,a.forwardRef)(({className:e,previewSize:t,...n},r)=>(0,i.jsx)("div",{ref:r,className:(0,U.A)("dataviews-view-grid-items",e),style:{gridTemplateColumns:t&&`repeat(auto-fill, minmax(${t}px, 1fr))`},...n})),{Badge:De}=ne(r.privateApis);function Te({view:e,selection:t,onChangeSelection:n,onClickItem:o,isItemClickable:u,renderItemLink:c,getItemId:d,item:f,actions:m,mediaField:v,titleField:p,descriptionField:h,regularFields:g,badgeFields:b,hasBulkActions:x,config:w,posinset:y}){const{showTitle:_=!0,showMedia:C=!0,showDescription:j=!0,infiniteScrollEnabled:S}=e,V=ve(m,f),k=d(f),I=(0,s.useInstanceId)(Te),E=t.includes(k),N=v?.render?(0,i.jsx)(v.render,{item:f,field:v,config:w}):null,M=_&&p?.render?(0,i.jsx)(p.render,{item:f,field:p}):null,F=C&&N;let O,A;u(f)&&o&&(M?(O={"aria-labelledby":`dataviews-view-grid__title-field-${I}`},A={id:`dataviews-view-grid__title-field-${I}`}):O={"aria-label":(0,l.__)("Navigate to item")});const{paginationInfo:P}=(0,a.useContext)(W);return(0,i.jsxs)(r.__experimentalVStack,{spacing:0,className:(0,U.A)("dataviews-view-grid__card",{"is-selected":V&&E}),onClickCapture:e=>{if((0,Z.isAppleOS)()?e.metaKey:e.ctrlKey){if(e.stopPropagation(),e.preventDefault(),!V)return;n(t.includes(k)?t.filter(e=>k!==e):[...t,k])}},role:S?"article":void 0,"aria-setsize":S?P.totalItems:void 0,"aria-posinset":y,children:[F&&(0,i.jsx)(Me,{item:f,isItemClickable:u,onClickItem:o,renderItemLink:c,className:"dataviews-view-grid__media",...O,children:N}),x&&F&&(0,i.jsx)(X,{item:f,selection:t,onChangeSelection:n,getItemId:d,titleField:p,disabled:!V}),!_&&F&&!!m?.length&&(0,i.jsx)("div",{className:"dataviews-view-grid__media-actions",children:(0,i.jsx)(ue,{item:f,actions:m,isCompact:!0})}),_&&(0,i.jsxs)(r.__experimentalHStack,{justify:"space-between",className:"dataviews-view-grid__title-actions",children:[(0,i.jsx)(Me,{item:f,isItemClickable:u,onClickItem:o,renderItemLink:c,className:"dataviews-view-grid__title-field dataviews-title-field",...A,children:M}),!!m?.length&&(0,i.jsx)(ue,{item:f,actions:m,isCompact:!0})]}),(0,i.jsxs)(r.__experimentalVStack,{spacing:1,children:[j&&h?.render&&(0,i.jsx)(h.render,{item:f,field:h}),!!b?.length&&(0,i.jsx)(r.__experimentalHStack,{className:"dataviews-view-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:b.map(e=>(0,i.jsx)(De,{className:"dataviews-view-grid__field-value",children:(0,i.jsx)(e.render,{item:f,field:e})},e.id))}),!!g?.length&&(0,i.jsx)(r.__experimentalVStack,{className:"dataviews-view-grid__fields",spacing:1,children:g.map(e=>(0,i.jsx)(r.Flex,{className:"dataviews-view-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Tooltip,{text:e.label,children:(0,i.jsx)(r.FlexItem,{className:"dataviews-view-grid__field-name",children:e.header})}),(0,i.jsx)(r.FlexItem,{className:"dataviews-view-grid__field-value",style:{maxHeight:"none"},children:(0,i.jsx)(e.render,{item:f,field:e})})]})},e.id))})]})]},k)}const{Menu:Be}=ne(r.privateApis);function ze(e){return`${e}-item-wrapper`}function He(e){return`${e}-dropdown`}function Re({idPrefix:e,primaryAction:t,item:n}){const s=(0,J.useRegistry)(),[l,o]=(0,a.useState)(!1),u=function(e,t){return`${e}-primary-action-${t}`}(e,t.id),c="string"==typeof t.label?t.label:t.label([n]);return"RenderModal"in t?(0,i.jsx)("div",{role:"gridcell",children:(0,i.jsx)(r.Composite.Item,{id:u,render:(0,i.jsx)(r.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,size:"small",onClick:()=>o(!0),variant:"link",children:c}),children:l&&(0,i.jsx)(le,{action:t,items:[n],closeModal:()=>o(!1)})})},t.id):(0,i.jsx)("div",{role:"gridcell",children:(0,i.jsx)(r.Composite.Item,{id:u,render:(0,i.jsx)(r.Button,{disabled:!!t.disabled,accessibleWhenDisabled:!0,size:"small",onClick:()=>{t.callback([n],{registry:s})},variant:"link",children:c})})},t.id)}function $e({view:e,actions:t,idPrefix:n,isSelected:s,item:o,titleField:u,mediaField:c,descriptionField:d,onSelect:f,otherFields:m,onDropdownTriggerKeyDown:v,posinset:p}){const{showTitle:h=!0,showMedia:g=!0,showDescription:b=!0,infiniteScrollEnabled:x}=e,w=(0,a.useRef)(null),y=`${n}-label`,_=`${n}-description`,C=(0,J.useRegistry)(),[j,S]=(0,a.useState)(!1),[V,k]=(0,a.useState)(null),I=({type:e})=>{S("mouseenter"===e)},{paginationInfo:E}=(0,a.useContext)(W);(0,a.useEffect)(()=>{s&&w.current?.scrollIntoView({behavior:"auto",block:"nearest",inline:"nearest"})},[s]);const{primaryAction:N,eligibleActions:M}=(0,a.useMemo)(()=>{const e=t.filter(e=>!e.isEligible||e.isEligible(o));return{primaryAction:e.filter(e=>e.isPrimary)[0],eligibleActions:e}},[t,o]),F=N&&1===t.length,O=g&&c?.render?(0,i.jsx)("div",{className:"dataviews-view-list__media-wrapper",children:(0,i.jsx)(c.render,{item:o,field:c,config:{sizes:"52px"}})}):null,A=h&&u?.render?(0,i.jsx)(u.render,{item:o,field:u}):null,P=M?.length>0&&(0,i.jsxs)(r.__experimentalHStack,{spacing:3,className:"dataviews-view-list__item-actions",children:[N&&(0,i.jsx)(Re,{idPrefix:n,primaryAction:N,item:o}),!F&&(0,i.jsxs)("div",{role:"gridcell",children:[(0,i.jsxs)(Be,{placement:"bottom-end",children:[(0,i.jsx)(Be.TriggerButton,{render:(0,i.jsx)(r.Composite.Item,{id:He(n),render:(0,i.jsx)(r.Button,{size:"small",icon:Q,label:(0,l.__)("Actions"),accessibleWhenDisabled:!0,disabled:!t.length,onKeyDown:v})})}),(0,i.jsx)(Be.Popover,{children:(0,i.jsx)(oe,{actions:M,item:o,registry:C,setActiveModalAction:k})})]}),!!V&&(0,i.jsx)(le,{action:V,items:[o],closeModal:()=>k(null)})]})]});return(0,i.jsx)(r.Composite.Row,{ref:w,render:(0,i.jsx)("div",{"aria-posinset":p,"aria-setsize":x?E.totalItems:void 0}),role:x?"article":"row",className:(0,U.A)({"is-selected":s,"is-hovered":j}),onMouseEnter:I,onMouseLeave:I,children:(0,i.jsxs)(r.__experimentalHStack,{className:"dataviews-view-list__item-wrapper",spacing:0,children:[(0,i.jsx)("div",{role:"gridcell",children:(0,i.jsx)(r.Composite.Item,{id:ze(n),"aria-pressed":s,"aria-labelledby":y,"aria-describedby":_,className:"dataviews-view-list__item",onClick:()=>f(o)})}),(0,i.jsxs)(r.__experimentalHStack,{spacing:3,justify:"start",alignment:"flex-start",children:[O,(0,i.jsxs)(r.__experimentalVStack,{spacing:1,className:"dataviews-view-list__field-wrapper",children:[(0,i.jsxs)(r.__experimentalHStack,{spacing:0,children:[(0,i.jsx)("div",{className:"dataviews-title-field",id:y,children:A}),P]}),b&&d?.render&&(0,i.jsx)("div",{className:"dataviews-view-list__field",children:(0,i.jsx)(d.render,{item:o,field:d})}),(0,i.jsx)("div",{className:"dataviews-view-list__fields",id:_,children:m.map(e=>(0,i.jsxs)("div",{className:"dataviews-view-list__field",children:[(0,i.jsx)(r.VisuallyHidden,{as:"span",className:"dataviews-view-list__field-label",children:e.label}),(0,i.jsx)("span",{className:"dataviews-view-list__field-value",children:(0,i.jsx)(e.render,{item:o,field:e})})]},e.id))})]})]})]})})}function We(e){return!!e}const{Badge:qe}=ne(r.privateApis);function Ge({view:e,multiselect:t,selection:n,onChangeSelection:a,getItemId:s,item:o,mediaField:u,titleField:c,descriptionField:d,regularFields:f,badgeFields:m,config:v,posinset:p,setsize:h}){const{showTitle:g=!0,showMedia:b=!0,showDescription:x=!0}=e,w=s(o),y=n.includes(w),_=u?.render?(0,i.jsx)(u.render,{item:o,field:u,config:v}):null,C=g&&c?.render?(0,i.jsx)(c.render,{item:o,field:c}):null;return(0,i.jsxs)(r.Composite.Item,{"aria-label":c?c.getValue({item:o})||(0,l.__)("(no title)"):void 0,render:({children:e,...t})=>(0,i.jsx)(r.__experimentalVStack,{spacing:0,children:e,...t}),role:"option","aria-posinset":p,"aria-setsize":h,className:(0,U.A)("dataviews-view-picker-grid__card",{"is-selected":y}),"aria-selected":y,onClick:()=>{if(y)a(n.filter(e=>w!==e));else{const e=t?[...n,w]:[w];a(e)}},children:[b&&_&&(0,i.jsx)("div",{className:"dataviews-view-picker-grid__media",children:_}),b&&_&&(0,i.jsx)(X,{item:o,selection:n,onChangeSelection:a,getItemId:s,titleField:c,disabled:!1,"aria-hidden":!0,tabIndex:-1}),g&&(0,i.jsx)(r.__experimentalHStack,{justify:"space-between",className:"dataviews-view-picker-grid__title-actions",children:(0,i.jsx)("div",{className:"dataviews-view-picker-grid__title-field dataviews-title-field",children:C})}),(0,i.jsxs)(r.__experimentalVStack,{spacing:1,children:[x&&d?.render&&(0,i.jsx)(d.render,{item:o,field:d}),!!m?.length&&(0,i.jsx)(r.__experimentalHStack,{className:"dataviews-view-picker-grid__badge-fields",spacing:2,wrap:!0,alignment:"top",justify:"flex-start",children:m.map(e=>(0,i.jsx)(qe,{className:"dataviews-view-picker-grid__field-value",children:(0,i.jsx)(e.render,{item:o,field:e})},e.id))}),!!f?.length&&(0,i.jsx)(r.__experimentalVStack,{className:"dataviews-view-picker-grid__fields",spacing:1,children:f.map(e=>(0,i.jsx)(r.Flex,{className:"dataviews-view-picker-grid__field",gap:1,justify:"flex-start",expanded:!0,style:{height:"auto"},direction:"row",children:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.FlexItem,{className:"dataviews-view-picker-grid__field-name",children:e.header}),(0,i.jsx)(r.FlexItem,{className:"dataviews-view-picker-grid__field-value",style:{maxHeight:"none"},children:(0,i.jsx)(e.render,{item:o,field:e})})]})},e.id))})]})]},w)}function Ke({groupName:e,groupField:t,children:n}){const a=(0,s.useInstanceId)(Ke,"dataviews-view-picker-grid-group__header");return(0,i.jsxs)(r.__experimentalVStack,{spacing:2,role:"group","aria-labelledby":a,children:[(0,i.jsx)("h3",{className:"dataviews-view-picker-grid-group__header",id:a,children:(0,l.sprintf)( +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +(0,l.__)("%1$s: %2$s"),t.label,e)}),n]},e)}const Ye=[{value:120,breakpoint:1},{value:170,breakpoint:1},{value:230,breakpoint:1},{value:290,breakpoint:1112},{value:350,breakpoint:1636},{value:430,breakpoint:588}];function Ue(){const e=(0,a.useContext)(W),t=e.view,n=Ye.filter(t=>e.containerWidth>=t.breakpoint),s=t.layout?.previewSize??230,o=n.map((e,t)=>({...e,index:t})).filter(e=>e.value<=s).sort((e,t)=>t.value-e.value)[0]?.index??0,u=n.map((e,t)=>({value:t}));return(0,i.jsx)(r.RangeControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,showTooltip:!1,label:(0,l.__)("Preview size"),value:o,min:0,max:n.length-1,withInputField:!1,onChange:(i=0)=>{e.onChangeView({...t,layout:{...t.layout,previewSize:n[i].value}})},step:1,marks:u})}const Ze=[{type:H,label:(0,l.__)("Table"),component:function({actions:e,data:t,fields:n,getItemId:o,getItemLevel:u,isLoading:c=!1,onChangeView:d,onChangeSelection:f,selection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,view:b,className:x,empty:w}){const{containerRef:y}=(0,a.useContext)(W),_=(0,a.useRef)(new Map),C=(0,a.useRef)(),[j,S]=(0,a.useState)(),V=pe(e,t);(0,a.useEffect)(()=>{C.current&&(C.current.focus(),C.current=void 0)});const k=(0,a.useId)(),I=function({scrollContainerRef:e,enabled:t=!1}){const[n,i]=(0,a.useState)(!1),r=(0,s.useDebounce)((0,a.useCallback)(()=>{const t=e.current;var n;t&&i((n=t,(0,l.isRTL)()?Math.abs(n.scrollLeft)<=1:n.scrollLeft+n.clientWidth>=n.scrollWidth-1))},[e,i]),200);return(0,a.useEffect)(()=>"undefined"!=typeof window&&t&&e.current?(r(),e.current.addEventListener("scroll",r),window.addEventListener("resize",r),()=>{e.current?.removeEventListener("scroll",r),window.removeEventListener("resize",r)}):()=>{},[e,t]),n}({scrollContainerRef:y,enabled:!!e?.length});if(j)return C.current=j,void S(void 0);const E=e=>{const t=_.current.get(e.id),n=t?_.current.get(t.fallback):void 0;S(n?.node)},N=!!t?.length,M=n.find(e=>e.id===b.titleField),F=n.find(e=>e.id===b.mediaField),O=n.find(e=>e.id===b.descriptionField),A=b.groupByField?n.find(e=>e.id===b.groupByField):null,P=A?Oe(t,A):null,{showTitle:L=!0,showMedia:D=!0,showDescription:B=!0}=b,z=M&&L||F&&D||O&&B,H=b.fields??[],R=(e,t)=>n=>{n?_.current.set(e,{node:n,fallback:H[t>0?t-1:1]}):_.current.delete(e)},$=b.infiniteScrollEnabled&&!P;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("table",{className:(0,U.A)("dataviews-view-table",x,{[`has-${b.layout?.density}-density`]:b.layout?.density&&["compact","comfortable"].includes(b.layout.density)}),"aria-busy":c,"aria-describedby":k,role:$?"feed":void 0,children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{className:"dataviews-view-table__row",children:[V&&(0,i.jsx)("th",{className:"dataviews-view-table__checkbox-column",scope:"col",children:(0,i.jsx)(he,{selection:m,onChangeSelection:f,data:t,actions:e,getItemId:o})}),z&&(0,i.jsx)("th",{scope:"col",children:M&&(0,i.jsx)(Ne,{ref:R(M.id,0),fieldId:M.id,view:b,fields:n,onChangeView:d,onHide:E,setOpenedFilter:v,canMove:!1})}),H.map((e,t)=>{const{width:r,maxWidth:a,minWidth:s,align:l}=b.layout?.styles?.[e]??{};return(0,i.jsx)("th",{style:{width:r,maxWidth:a,minWidth:s,textAlign:l},"aria-sort":b.sort?.direction&&b.sort?.field===e?T[b.sort.direction]:void 0,scope:"col",children:(0,i.jsx)(Ne,{ref:R(e,t),fieldId:e,view:b,fields:n,onChangeView:d,onHide:E,setOpenedFilter:v,canMove:b.layout?.enableMoving??!0})},e)}),!!e?.length&&(0,i.jsx)("th",{className:(0,U.A)("dataviews-view-table__actions-column",{"dataviews-view-table__actions-column--sticky":!0,"dataviews-view-table__actions-column--stuck":!I}),children:(0,i.jsx)("span",{className:"dataviews-view-table-header",children:(0,l.__)("Actions")})})]})}),N&&A&&P?Array.from(P.entries()).map(([t,r])=>(0,i.jsxs)("tbody",{children:[(0,i.jsx)("tr",{className:"dataviews-view-table__group-header-row",children:(0,i.jsx)("td",{colSpan:H.length+(z?1:0)+(V?1:0)+(e?.length?1:0),className:"dataviews-view-table__group-header-cell",children:(0,l.sprintf)( +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +(0,l.__)("%1$s: %2$s"),A.label,t)})}),r.map((t,r)=>(0,i.jsx)(Pe,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:V,actions:e,fields:n,id:o(t)||r.toString(),view:b,titleField:M,mediaField:F,descriptionField:O,selection:m,getItemId:o,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!I},o(t)))]},`group-${t}`)):(0,i.jsx)("tbody",{children:N&&t.map((t,r)=>(0,i.jsx)(Pe,{item:t,level:b.showLevels&&"function"==typeof u?u(t):void 0,hasBulkActions:V,actions:e,fields:n,id:o(t)||r.toString(),view:b,titleField:M,mediaField:F,descriptionField:O,selection:m,getItemId:o,onChangeSelection:f,onClickItem:p,renderItemLink:g,isItemClickable:h,isActionsColumnSticky:!I,posinset:$?r+1:void 0},o(t)))})]}),(0,i.jsxs)("div",{className:(0,U.A)({"dataviews-loading":c,"dataviews-no-results":!N&&!c}),id:k,children:[!N&&(c?(0,i.jsx)("p",{children:(0,i.jsx)(r.Spinner,{})}):w),N&&c&&(0,i.jsx)("p",{className:"dataviews-loading-more",children:(0,i.jsx)(r.Spinner,{})})]})]})},icon:q,viewConfigOptions:function(){const e=(0,a.useContext)(W),t=e.view;return(0,i.jsxs)(r.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,size:"__unstable-large",label:(0,l.__)("Density"),value:t.layout?.density||"balanced",onChange:n=>{e.onChangeView({...t,layout:{...t.layout,density:n}})},isBlock:!0,children:[(0,i.jsx)(r.__experimentalToggleGroupControlOption,{value:"comfortable",label:(0,l._x)("Comfortable","Density option for DataView layout")},"comfortable"),(0,i.jsx)(r.__experimentalToggleGroupControlOption,{value:"balanced",label:(0,l._x)("Balanced","Density option for DataView layout")},"balanced"),(0,i.jsx)(r.__experimentalToggleGroupControlOption,{value:"compact",label:(0,l._x)("Compact","Density option for DataView layout")},"compact")]})}},{type:R,label:(0,l.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:s,isLoading:o,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,selection:m,view:v,className:p,empty:h}){const{resizeObserverRef:g}=(0,a.useContext)(W),b=n.find(e=>e.id===v?.titleField),x=n.find(e=>e.id===v?.mediaField),w=n.find(e=>e.id===v?.descriptionField),y=v.fields??[],{regularFields:_,badgeFields:C}=y.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[v.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),j=!!t?.length,S=pe(e,t),V=v.layout?.previewSize,k="900px",I=v.groupByField?n.find(e=>e.id===v.groupByField):null,E=I?Oe(t,I):null,N=v.infiniteScrollEnabled&&!E;return(0,i.jsxs)(i.Fragment,{children:[j&&I&&E&&(0,i.jsx)(r.__experimentalVStack,{spacing:4,children:Array.from(E.entries()).map(([t,n])=>(0,i.jsxs)(r.__experimentalVStack,{spacing:2,children:[(0,i.jsx)("h3",{className:"dataviews-view-grid__group-header",children:(0,l.sprintf)( +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +(0,l.__)("%1$s: %2$s"),I.label,t)}),(0,i.jsx)(Le,{className:(0,U.A)("dataviews-view-grid",p),previewSize:V,"aria-busy":o,ref:g,children:n.map(t=>(0,i.jsx)(Te,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:s,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:k}},s(t)))})]},t))}),j&&!E&&(0,i.jsx)(Le,{className:(0,U.A)("dataviews-view-grid",p),previewSize:V,"aria-busy":o,ref:g,role:N?"feed":void 0,children:t.map((t,n)=>(0,i.jsx)(Te,{view:v,selection:m,onChangeSelection:u,onClickItem:c,isItemClickable:d,renderItemLink:f,getItemId:s,item:t,actions:e,mediaField:x,titleField:b,descriptionField:w,regularFields:_,badgeFields:C,hasBulkActions:S,config:{sizes:k},posinset:N?n+1:void 0},s(t)))}),!j&&(0,i.jsx)("div",{className:(0,U.A)({"dataviews-loading":o,"dataviews-no-results":!o}),children:o?(0,i.jsx)("p",{children:(0,i.jsx)(r.Spinner,{})}):h}),j&&o&&(0,i.jsx)("p",{className:"dataviews-loading-more",children:(0,i.jsx)(r.Spinner,{})})]})},icon:G,viewConfigOptions:Ue},{type:"list",label:(0,l.__)("List"),component:function e(t){const{actions:n,data:o,fields:u,getItemId:c,isLoading:d,onChangeSelection:f,selection:m,view:v,className:p,empty:h}=t,g=(0,s.useInstanceId)(e,"view-list"),b=o?.findLast(e=>m.includes(c(e))),x=u.find(e=>e.id===v.titleField),w=u.find(e=>e.id===v.mediaField),y=u.find(e=>e.id===v.descriptionField),_=(v?.fields??[]).map(e=>u.find(t=>e===t.id)).filter(We),C=e=>f([c(e)]),j=(0,a.useCallback)(e=>`${g}-${c(e)}`,[g,c]),S=(0,a.useCallback)((e,t)=>t.startsWith(j(e)),[j]),[V,k]=(0,a.useState)(void 0);(0,a.useEffect)(()=>{b&&k(ze(j(b)))},[b,j]);const I=o.findIndex(e=>S(e,V??"")),E=(0,s.usePrevious)(I),N=-1!==I,M=(0,a.useCallback)((e,t)=>{const n=Math.min(o.length-1,Math.max(0,e));if(!o[n])return;const i=t(j(o[n]));k(i),document.getElementById(i)?.focus()},[o,j]);(0,a.useEffect)(()=>{!N&&void 0!==E&&-1!==E&&M(E,ze)},[N,M,E]);const F=(0,a.useCallback)(e=>{"ArrowDown"===e.key&&(e.preventDefault(),M(I+1,He)),"ArrowUp"===e.key&&(e.preventDefault(),M(I-1,He))},[M,I]),O=o?.length;if(!O)return(0,i.jsx)("div",{className:(0,U.A)({"dataviews-loading":d,"dataviews-no-results":!O&&!d}),children:!O&&(d?(0,i.jsx)("p",{children:(0,i.jsx)(r.Spinner,{})}):h)});const A=v.groupByField?u.find(e=>e.id===v.groupByField):null,P=A?Oe(o,A):null;return O&&A&&P?(0,i.jsx)(r.Composite,{id:`${g}`,render:(0,i.jsx)("div",{}),className:"dataviews-view-list__group",role:"grid",activeId:V,setActiveId:k,children:(0,i.jsx)(r.__experimentalVStack,{spacing:4,className:(0,U.A)("dataviews-view-list",p),children:Array.from(P.entries()).map(([e,t])=>(0,i.jsxs)(r.__experimentalVStack,{spacing:2,children:[(0,i.jsx)("h3",{className:"dataviews-view-list__group-header",children:(0,l.sprintf)( +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +// translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022". +(0,l.__)("%1$s: %2$s"),A.label,e)}),t.map(e=>{const t=j(e);return(0,i.jsx)($e,{view:v,idPrefix:t,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:F},t)})]},e))})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Composite,{id:g,render:(0,i.jsx)("div",{}),className:(0,U.A)("dataviews-view-list",p),role:v.infiniteScrollEnabled?"feed":"grid",activeId:V,setActiveId:k,children:o.map((e,t)=>{const r=j(e);return(0,i.jsx)($e,{view:v,idPrefix:r,actions:n,item:e,isSelected:e===b,onSelect:C,mediaField:w,titleField:x,descriptionField:y,otherFields:_,onDropdownTriggerKeyDown:F,posinset:v.infiniteScrollEnabled?t+1:void 0},r)})}),O&&d&&(0,i.jsx)("p",{className:"dataviews-loading-more",children:(0,i.jsx)(r.Spinner,{})})]})},icon:(0,l.isRTL)()?K:Y},{type:"pickerGrid",label:(0,l.__)("Grid"),component:function({actions:e,data:t,fields:n,getItemId:s,isLoading:l,onChangeSelection:o,selection:u,view:c,className:d,empty:f}){const{resizeObserverRef:m,paginationInfo:v,itemListLabel:p}=(0,a.useContext)(W),h=n.find(e=>e.id===c?.titleField),g=n.find(e=>e.id===c?.mediaField),b=n.find(e=>e.id===c?.descriptionField),x=c.fields??[],{regularFields:w,badgeFields:y}=x.reduce((e,t)=>{const i=n.find(e=>e.id===t);return i?(e[c.layout?.badgeFields?.includes(t)?"badgeFields":"regularFields"].push(i),e):e},{regularFields:[],badgeFields:[]}),_=!!t?.length,C=c.layout?.previewSize,j=function(e){return(0,a.useMemo)(()=>e?.every(e=>e.supportsBulk),[e])}(e),S="900px",V=c.groupByField?n.find(e=>e.id===c.groupByField):null,k=V?Oe(t,V):null,I=c.infiniteScrollEnabled&&!k,E=c?.page??1,N=c?.perPage??0,M=I?v?.totalItems:void 0;return(0,i.jsxs)(i.Fragment,{children:[_&&V&&k&&(0,i.jsx)(r.Composite,{virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,className:(0,U.A)("dataviews-view-picker-grid",d),"aria-label":p,render:({children:e,...t})=>(0,i.jsx)(r.__experimentalVStack,{spacing:4,children:e,...t}),children:Array.from(k.entries()).map(([e,n])=>(0,i.jsx)(Ke,{groupName:e,groupField:V,children:(0,i.jsx)(Le,{previewSize:C,style:{gridTemplateColumns:C&&`repeat(auto-fill, minmax(${C}px, 1fr))`},"aria-busy":l,ref:m,children:n.map(e=>{const n=(E-1)*N+t.indexOf(e)+1;return(0,i.jsx)(Ge,{view:c,multiselect:j,selection:u,onChangeSelection:o,getItemId:s,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:M},s(e))})})},e))}),_&&!k&&(0,i.jsx)(r.Composite,{render:(0,i.jsx)(Le,{className:(0,U.A)("dataviews-view-picker-grid",d),previewSize:C,"aria-busy":l,ref:m}),virtualFocus:!0,orientation:"horizontal",role:"listbox","aria-multiselectable":j,"aria-label":p,children:t.map((e,t)=>{let n=I?t+1:void 0;return I||(n=(E-1)*N+t+1),(0,i.jsx)(Ge,{view:c,multiselect:j,selection:u,onChangeSelection:o,getItemId:s,item:e,mediaField:g,titleField:h,descriptionField:b,regularFields:w,badgeFields:y,config:{sizes:S},posinset:n,setsize:M},s(e))})}),!_&&(0,i.jsx)("div",{className:(0,U.A)({"dataviews-loading":l,"dataviews-no-results":!l}),children:l?(0,i.jsx)("p",{children:(0,i.jsx)(r.Spinner,{})}):f}),_&&l&&(0,i.jsx)("p",{className:"dataviews-loading-more",children:(0,i.jsx)(r.Spinner,{})})]})},icon:G,viewConfigOptions:Ue,isPicker:!0}],{Menu:Xe}=ne(r.privateApis);function Qe({filters:e,view:t,onChangeView:n,setOpenedFilter:r,triggerProps:a}){const s=e.filter(e=>!e.isVisible);return(0,i.jsxs)(Xe,{children:[(0,i.jsx)(Xe.TriggerButton,{...a}),(0,i.jsx)(Xe.Popover,{children:s.map(e=>(0,i.jsx)(Xe.Item,{onClick:()=>{r(e.field),n({...t,page:1,filters:[...t.filters||[],{field:e.field,value:void 0,operator:e.operators[0]}]})},children:(0,i.jsx)(Xe.ItemLabel,{children:e.name})},e.field))})]})}var Je=(0,a.forwardRef)(function({filters:e,view:t,onChangeView:n,setOpenedFilter:a},s){if(!e.length||e.every(({isPrimary:e})=>e))return null;const o=e.filter(e=>!e.isVisible);return(0,i.jsx)(Qe,{triggerProps:{render:(0,i.jsx)(r.Button,{accessibleWhenDisabled:!0,size:"compact",className:"dataviews-filters-button",variant:"tertiary",disabled:!o.length,ref:s}),children:(0,l.__)("Add filter")},filters:e,view:t,onChangeView:n,setOpenedFilter:a})});function et({buttonRef:e,filtersCount:t,children:n}){return(0,a.useEffect)(()=>()=>{e.current?.focus()},[e]),(0,i.jsxs)(i.Fragment,{children:[n,!!t&&(0,i.jsx)("span",{className:"dataviews-filters-toggle__count",children:t})]})}var tt=function(){const{filters:e,view:t,onChangeView:n,setOpenedFilter:s,isShowingFilter:o,setIsShowingFilter:u}=(0,a.useContext)(W),c=(0,a.useRef)(null),d=(0,a.useCallback)(e=>{n(e),u(!0)},[n,u]),f=!!e.filter(e=>e.isVisible).length;if(0===e.length)return null;const m={label:(0,l.__)("Add filter"),"aria-expanded":!1,isPressed:!1},v={label:(0,l._x)("Filter","verb"),"aria-expanded":o,isPressed:o,onClick:()=>{o||s(null),u(!o)}},p=(0,i.jsx)(r.Button,{ref:c,className:"dataviews-filters__visibility-toggle",size:"compact",icon:Ce,...f?v:m});return(0,i.jsx)("div",{className:"dataviews-filters__container-visibility-toggle",children:f?(0,i.jsx)(et,{buttonRef:c,filtersCount:t.filters?.length,children:p}):(0,i.jsx)(Qe,{filters:e,view:t,onChangeView:d,setOpenedFilter:s,triggerProps:{render:p}})})},nt=Object.defineProperty,it=Object.defineProperties,rt=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,ot=(e,t,n)=>t in e?nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ut=(e,t)=>{for(var n in t||(t={}))st.call(t,n)&&ot(e,n,t[n]);if(at)for(var n of at(t))lt.call(t,n)&&ot(e,n,t[n]);return e},ct=(e,t)=>it(e,rt(t)),dt=(e,t)=>{var n={};for(var i in e)st.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&at)for(var i of at(e))t.indexOf(i)<0&<.call(e,i)&&(n[i]=e[i]);return n},ft=Object.defineProperty,mt=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,pt=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,gt=Object.prototype.propertyIsEnumerable,bt=(e,t,n)=>t in e?ft(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xt=(e,t)=>{for(var n in t||(t={}))ht.call(t,n)&&bt(e,n,t[n]);if(pt)for(var n of pt(t))gt.call(t,n)&&bt(e,n,t[n]);return e},wt=(e,t)=>mt(e,vt(t)),yt=(e,t)=>{var n={};for(var i in e)ht.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&pt)for(var i of pt(e))t.indexOf(i)<0&>.call(e,i)&&(n[i]=e[i]);return n};function _t(...e){}function Ct(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function jt(...e){return(...t)=>{for(const n of e)"function"==typeof n&&n(...t)}}function St(e){return e.normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function Vt(e){return e}function kt(e,t){if(!e){if("string"!=typeof t)throw new Error("Invariant failed");throw new Error(t)}}function It(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function Et(e){const t={};for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}function Nt(...e){for(const t of e)if(void 0!==t)return t}var Mt=n(609),Ft=n.t(Mt,2);function Ot(e,t){"function"==typeof e?e(t):e&&(e.current=t)}var At,Pt="undefined"!=typeof window&&!!(null==(At=window.document)?void 0:At.createElement);function Lt(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function Dt(e,t=!1){const{activeElement:n}=Lt(e);if(!(null==n?void 0:n.nodeName))return null;if("IFRAME"===n.tagName&&n.contentDocument)return Dt(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=Lt(n).getElementById(e);if(t)return t}}return n}function Tt(e,t){return e===t||e.contains(t)}function Bt(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==zt.indexOf(e.type)}var zt=["button","color","file","image","reset","submit"];function Ht(e){try{const t=e instanceof HTMLInputElement&&null!==e.selectionStart,n="TEXTAREA"===e.tagName;return t||n||!1}catch(e){return!1}}function Rt(e){return e.isContentEditable||Ht(e)}function $t(e){let t=0,n=0;if(Ht(e))t=e.selectionStart||0,n=e.selectionEnd||0;else if(e.isContentEditable){const i=Lt(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&Tt(e,i.anchorNode)&&i.focusNode&&Tt(e,i.focusNode)){const r=i.getRangeAt(0),a=r.cloneRange();a.selectNodeContents(e),a.setEnd(r.startContainer,r.startOffset),t=a.toString().length,a.setEnd(r.endContainer,r.endOffset),n=a.toString().length}}return{start:t,end:n}}function Wt(e,t){const n=null==e?void 0:e.getAttribute("role");return n&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(n)?n:t}function qt(e){if(!e)return null;const t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){const{overflowY:n}=getComputedStyle(e);if(t(n))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){const{overflowX:n}=getComputedStyle(e);if(t(n))return e}return qt(e.parentElement)||document.scrollingElement||document.body}function Gt(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function Kt(){return!!Pt&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function Yt(){return Pt&&Kt()&&/apple/i.test(navigator.vendor)}function Ut(e){return Boolean(e.currentTarget&&!Tt(e.currentTarget,e.target))}function Zt(e){return e.target===e.currentTarget}function Xt(e,t){const n=new FocusEvent("blur",t),i=e.dispatchEvent(n),r=wt(xt({},t),{bubbles:!0});return e.dispatchEvent(new FocusEvent("focusout",r)),i}function Qt(e,t){const n=new MouseEvent("click",t);return e.dispatchEvent(n)}function Jt(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Tt(n,i)}function en(e,t,n,i){const r=(e=>{if(i){const t=setTimeout(e,i);return()=>clearTimeout(t)}const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,a,!0),n()}),a=()=>{r(),n()};return e.addEventListener(t,a,{once:!0,capture:!0}),r}function tn(e,t,n,i=window){const r=[];try{i.document.addEventListener(e,t,n);for(const a of Array.from(i.frames))r.push(tn(e,t,n,a))}catch(e){}return()=>{try{i.document.removeEventListener(e,t,n)}catch(e){}for(const e of r)e()}}var nn=ut({},Ft),rn=nn.useId,an=(nn.useDeferredValue,nn.useInsertionEffect),sn=Pt?Mt.useLayoutEffect:Mt.useEffect;function ln(e){const t=(0,Mt.useRef)(()=>{throw new Error("Cannot call an event handler while rendering.")});return an?an(()=>{t.current=e}):t.current=e,(0,Mt.useCallback)((...e)=>{var n;return null==(n=t.current)?void 0:n.call(t,...e)},[])}function on(...e){return(0,Mt.useMemo)(()=>{if(e.some(Boolean))return t=>{for(const n of e)Ot(n,t)}},e)}function un(e){if(rn){const t=rn();return e||t}const[t,n]=(0,Mt.useState)(e);return sn(()=>{if(e||t)return;const i=Math.random().toString(36).slice(2,8);n(`id-${i}`)},[e,t]),e||t}function cn(e,t){const n=(0,Mt.useRef)(!1);(0,Mt.useEffect)(()=>{if(n.current)return e();n.current=!0},t),(0,Mt.useEffect)(()=>()=>{n.current=!1},[])}function dn(e){return ln("function"==typeof e?e:()=>e)}function fn(e,t,n=[]){const i=(0,Mt.useCallback)(n=>(e.wrapElement&&(n=e.wrapElement(n)),t(n)),[...n,e.wrapElement]);return ct(ut({},e),{wrapElement:i})}var mn=!1,vn=!1,pn=0,hn=0;function gn(e){(function(e){const t=e.movementX||e.screenX-pn,n=e.movementY||e.screenY-hn;return pn=e.screenX,hn=e.screenY,t||n||!1})(e)&&(vn=!0)}function bn(){vn=!1}function xn(e){const t=Mt.forwardRef((t,n)=>e(ct(ut({},t),{ref:n})));return t.displayName=e.displayName||e.name,t}function wn(e,t){return Mt.memo(e,t)}function yn(e,t){const n=t,{wrapElement:r,render:a}=n,s=dt(n,["wrapElement","render"]),l=on(t.ref,function(e){return function(e){return!!e&&!!(0,Mt.isValidElement)(e)&&("ref"in e.props||"ref"in e)}(e)?ut({},e.props).ref||e.ref:null}(a));let o;if(Mt.isValidElement(a)){const e=ct(ut({},a.props),{ref:l});o=Mt.cloneElement(a,function(e,t){const n=ut({},e);for(const i in t){if(!Ct(t,i))continue;if("className"===i){const i="className";n[i]=e[i]?`${e[i]} ${t[i]}`:t[i];continue}if("style"===i){const i="style";n[i]=e[i]?ut(ut({},e[i]),t[i]):t[i];continue}const r=t[i];if("function"==typeof r&&i.startsWith("on")){const t=e[i];if("function"==typeof t){n[i]=(...e)=>{r(...e),t(...e)};continue}}n[i]=r}return n}(s,e))}else o=a?a(s):(0,i.jsx)(e,ut({},s));return r?r(o):o}function Cn(e){const t=(t={})=>e(t);return t.displayName=e.name,t}function jn(e=[],t=[]){const n=Mt.createContext(void 0),r=Mt.createContext(void 0),a=()=>Mt.useContext(n),s=t=>e.reduceRight((e,n)=>(0,i.jsx)(n,ct(ut({},t),{children:e})),(0,i.jsx)(n.Provider,ut({},t)));return{context:n,scopedContext:r,useContext:a,useScopedContext:(e=!1)=>{const t=Mt.useContext(r),n=a();return e?t:t||n},useProviderContext:()=>{const e=Mt.useContext(r),t=a();if(!e||e!==t)return t},ContextProvider:s,ScopedContextProvider:e=>(0,i.jsx)(s,ct(ut({},e),{children:t.reduceRight((t,n)=>(0,i.jsx)(n,ct(ut({},e),{children:t})),(0,i.jsx)(r.Provider,ut({},e)))}))}}var Sn=jn(),Vn=Sn.useContext,kn=(Sn.useScopedContext,Sn.useProviderContext,jn([Sn.ContextProvider],[Sn.ScopedContextProvider])),In=kn.useContext,En=(kn.useScopedContext,kn.useProviderContext),Nn=kn.ContextProvider,Mn=kn.ScopedContextProvider,Fn=(0,Mt.createContext)(void 0),On=(0,Mt.createContext)(void 0),An=((0,Mt.createContext)(null),(0,Mt.createContext)(null),jn([Nn],[Mn])),Pn=An.useContext;function Ln(e,t){const n=e.__unstableInternals;return kt(n,"Invalid store"),n[t]}function Dn(e,...t){let n=e,i=n,r=Symbol(),a=_t;const s=new Set,l=new Set,o=new Set,u=new Set,c=new Set,d=new WeakMap,f=new WeakMap,m=(e,t,n=u)=>(n.add(t),f.set(t,e),()=>{var e;null==(e=d.get(t))||e(),d.delete(t),f.delete(t),n.delete(t)}),v=(e,a,s=!1)=>{var o;if(!Ct(n,e))return;const m=(v=a,p=n[e],function(e){return"function"==typeof e}(v)?v(function(e){return"function"==typeof e}(p)?p():p):v);var v,p;if(m===n[e])return;if(!s)for(const n of t)null==(o=null==n?void 0:n.setState)||o.call(n,e,m);const h=n;n=wt(xt({},n),{[e]:m});const g=Symbol();r=g,l.add(e);const b=(t,i,r)=>{var a;const s=f.get(t);s&&!s.some(t=>r?r.has(t):t===e)||(null==(a=d.get(t))||a(),d.set(t,t(n,i)))};for(const e of u)b(e,h);queueMicrotask(()=>{if(r!==g)return;const e=n;for(const e of c)b(e,i,l);i=e,l.clear()})},p={getState:()=>n,setState:v,__unstableInternals:{setup:e=>(o.add(e),()=>o.delete(e)),init:()=>{const e=s.size,i=Symbol();s.add(i);const r=()=>{s.delete(i),s.size||a()};if(e)return r;const l=(u=n,Object.keys(u)).map(e=>jt(...t.map(t=>{var n;const i=null==(n=null==t?void 0:t.getState)?void 0:n.call(t);if(i&&Ct(i,e))return Hn(t,[e],t=>{v(e,t[e],!0)})})));var u;const c=[];for(const e of o)c.push(e());const d=t.map(Bn);return a=jt(...l,...c,...d),r},subscribe:(e,t)=>m(e,t),sync:(e,t)=>(d.set(t,t(n,n)),m(e,t)),batch:(e,t)=>(d.set(t,t(n,i)),m(e,t,c)),pick:e=>Dn(function(e,t){const n={};for(const i of t)Ct(e,i)&&(n[i]=e[i]);return n}(n,e),p),omit:e=>Dn(function(e,t){const n=xt({},e);for(const e of t)Ct(n,e)&&delete n[e];return n}(n,e),p)}};return p}function Tn(e,...t){if(e)return Ln(e,"setup")(...t)}function Bn(e,...t){if(e)return Ln(e,"init")(...t)}function zn(e,...t){if(e)return Ln(e,"subscribe")(...t)}function Hn(e,...t){if(e)return Ln(e,"sync")(...t)}function Rn(e,...t){if(e)return Ln(e,"batch")(...t)}function $n(e,...t){if(e)return Ln(e,"omit")(...t)}function Wn(...e){var t;const n={};for(const i of e){const e=null==(t=null==i?void 0:i.getState)?void 0:t.call(i);e&&Object.assign(n,e)}const i=Dn(n,...e);return Object.assign({},...e,i)}An.useScopedContext,An.useProviderContext,An.ContextProvider,An.ScopedContextProvider;var qn=n(888),{useSyncExternalStore:Gn}=qn;function Kn(e,t=Vt){const n=Mt.useCallback(t=>e?zn(e,null,t):()=>{},[e]),i=()=>{const n="string"==typeof t?t:null,i="function"==typeof t?t:null,r=null==e?void 0:e.getState();return i?i(r):r&&n&&Ct(r,n)?r[n]:void 0};return Gn(n,i,i)}function Yn(e,t){const n=Mt.useRef({}),i=Mt.useCallback(t=>e?zn(e,null,t):()=>{},[e]),r=()=>{const i=null==e?void 0:e.getState();let r=!1;const a=n.current;for(const e in t){const n=t[e];if("function"==typeof n){const t=n(i);t!==a[e]&&(a[e]=t,r=!0)}if("string"==typeof n){if(!i)continue;if(!Ct(i,n))continue;const t=i[n];t!==a[e]&&(a[e]=t,r=!0)}}return r&&(n.current=ut({},a)),n.current};return Gn(i,r,r)}function Un(e,t,n,i){const r=Ct(t,n)?t[n]:void 0,a=i?t[i]:void 0,s=function(e){const t=(0,Mt.useRef)(e);return sn(()=>{t.current=e}),t}({value:r,setValue:a});sn(()=>Hn(e,[n],(e,t)=>{const{value:i,setValue:r}=s.current;r&&e[n]!==t[n]&&e[n]!==i&&r(e[n])}),[e,n]),sn(()=>{if(void 0!==r)return e.setState(n,r),Rn(e,[n],()=>{void 0!==r&&e.setState(n,r)})})}function Zn(e,t,n){return function(e,t,n){return cn(t,[n.store,n.disclosure]),Un(e,n,"open","setOpen"),Un(e,n,"mounted","setMounted"),Un(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}(e,t,n)}function Xn(e,t,n){return Un(e=function(e,t,n){return cn(t,[n.store]),Un(e,n,"items","setItems"),e}(e,t,n),n,"activeId","setActiveId"),Un(e,n,"includesBaseElement"),Un(e,n,"virtualFocus"),Un(e,n,"orientation"),Un(e,n,"rtl"),Un(e,n,"focusLoop"),Un(e,n,"focusWrap"),Un(e,n,"focusShift"),e}function Qn(e){const t=[];for(const n of e)t.push(...n);return t}function Jn(e){return e.slice().reverse()}function ei(e={}){var t;e.store;const n=null==(t=e.store)?void 0:t.getState(),i=Nt(e.items,null==n?void 0:n.items,e.defaultItems,[]),r=new Map(i.map(e=>[e.id,e])),a={items:i,renderedItems:Nt(null==n?void 0:n.renderedItems,[])},s=null==(l=e.store)?void 0:l.__unstablePrivateStore;var l;const o=Dn({items:i,renderedItems:a.renderedItems},s),u=Dn(a,e.store),c=e=>{const t=function(e,t){const n=e.map((e,t)=>[t,e]);let i=!1;return n.sort(([e,n],[r,a])=>{const s=t(n),l=t(a);return s===l?0:s&&l?function(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}(s,l)?(e>r&&(i=!0),-1):(et):e}(e,e=>e.element);o.setState("renderedItems",t),u.setState("renderedItems",t)};Tn(u,()=>Bn(o)),Tn(o,()=>Rn(o,["items"],e=>{u.setState("items",e.items)})),Tn(o,()=>Rn(o,["renderedItems"],e=>{let t=!0,n=requestAnimationFrame(()=>{const{renderedItems:t}=u.getState();e.renderedItems!==t&&c(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(n);const i=function(e){var t;const n=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element);let r=null==(t=null==n?void 0:n.element)?void 0:t.parentElement;for(;r&&(null==i?void 0:i.element);){if(i&&r.contains(i.element))return r;r=r.parentElement}return Lt(r).body}(e.renderedItems),r=new IntersectionObserver(()=>{t?t=!1:(cancelAnimationFrame(n),n=requestAnimationFrame(()=>c(e.renderedItems)))},{root:i});for(const t of e.renderedItems)t.element&&r.observe(t.element);return()=>{cancelAnimationFrame(n),r.disconnect()}}));const d=(e,t,n=!1)=>{let i;return t(t=>{const n=t.findIndex(({id:t})=>t===e.id),a=t.slice();if(-1!==n){i=t[n];const s=xt(xt({},i),e);a[n]=s,r.set(e.id,s)}else a.push(e),r.set(e.id,e);return a}),()=>{t(t=>{if(!i)return n&&r.delete(e.id),t.filter(({id:t})=>t!==e.id);const a=t.findIndex(({id:t})=>t===e.id);if(-1===a)return t;const s=t.slice();return s[a]=i,r.set(e.id,i),s})}},f=e=>d(e,e=>o.setState("items",e),!0);return wt(xt({},u),{registerItem:f,renderItem:e=>jt(f(e),d(e,e=>o.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=r.get(e);if(!t){const{items:n}=o.getState();t=n.find(t=>t.id===e),t&&r.set(e,t)}return t||null},__unstablePrivateStore:o})}var ti={id:null};function ni(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function ii(e,t){return e.filter(e=>e.rowId===t)}function ri(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}function ai(e){let t=0;for(const{length:n}of e)n>t&&(t=n);return t}function si(e){return{id:"__EMPTY_ITEM__",disabled:!0,rowId:e}}var li=Yt()&&Pt&&!!navigator.maxTouchPoints;function oi(e={}){var t=e,{tag:n}=t,i=yt(t,["tag"]);const r=Wn(i.store,function(e,...t){if(e)return Ln(e,"pick")(...t)}(n,["value","rtl"])),a=null==n?void 0:n.getState(),s=null==r?void 0:r.getState(),l=Nt(i.activeId,null==s?void 0:s.activeId,i.defaultActiveId,null),o=function(e={}){var t;const n=null==(t=e.store)?void 0:t.getState(),i=ei(e),r=Nt(e.activeId,null==n?void 0:n.activeId,e.defaultActiveId),a=Dn(wt(xt({},i.getState()),{id:Nt(e.id,null==n?void 0:n.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:r,baseElement:Nt(null==n?void 0:n.baseElement,null),includesBaseElement:Nt(e.includesBaseElement,null==n?void 0:n.includesBaseElement,null===r),moves:Nt(null==n?void 0:n.moves,0),orientation:Nt(e.orientation,null==n?void 0:n.orientation,"both"),rtl:Nt(e.rtl,null==n?void 0:n.rtl,!1),virtualFocus:Nt(e.virtualFocus,null==n?void 0:n.virtualFocus,!1),focusLoop:Nt(e.focusLoop,null==n?void 0:n.focusLoop,!1),focusWrap:Nt(e.focusWrap,null==n?void 0:n.focusWrap,!1),focusShift:Nt(e.focusShift,null==n?void 0:n.focusShift,!1)}),i,e.store);Tn(a,()=>Hn(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var n;return void 0!==t?t:null==(n=ni(e.renderedItems))?void 0:n.id})}));const s=(e="next",t={})=>{var n,i;const r=a.getState(),{skip:s=0,activeId:l=r.activeId,focusShift:o=r.focusShift,focusLoop:u=r.focusLoop,focusWrap:c=r.focusWrap,includesBaseElement:d=r.includesBaseElement,renderedItems:f=r.renderedItems,rtl:m=r.rtl}=t,v="up"===e||"down"===e,p="next"===e||"down"===e,h=p?m&&!v:!m||v,g=o&&!s;let b=v?Qn(function(e,t,n){const i=ai(e);for(const r of e)for(let e=0;ee.id===l);if(!x)return null==(i=ni(b))?void 0:i.id;const w=b.some(e=>e.rowId),y=b.indexOf(x),_=b.slice(y+1),C=ii(_,x.rowId);if(s){const e=function(e,t){return e.filter(e=>t?!e.disabled&&e.id!==t:!e.disabled)}(C,l),t=e.slice(s)[0]||e[e.length-1];return null==t?void 0:t.id}const j=u&&(v?"horizontal"!==u:"vertical"!==u),S=w&&c&&(v?"horizontal"!==c:"vertical"!==c),V=p?(!w||v)&&j&&d:!!v&&d;if(j){const e=function(e,t,n=!1){const i=e.findIndex(e=>e.id===t);return[...e.slice(i+1),...n?[ti]:[],...e.slice(0,i)]}(S&&!V?b:ii(b,x.rowId),l,V),t=ni(e,l);return null==t?void 0:t.id}if(S){const e=ni(V?C:_,l);return V?(null==e?void 0:e.id)||null:null==e?void 0:e.id}const k=ni(C,l);return!k&&V?null:null==k?void 0:k.id};return wt(xt(xt({},i),a),{setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=ni(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=ni(Jn(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),s("up",e))})}(wt(xt({},i),{activeId:l,includesBaseElement:Nt(i.includesBaseElement,null==s?void 0:s.includesBaseElement,!0),orientation:Nt(i.orientation,null==s?void 0:s.orientation,"vertical"),focusLoop:Nt(i.focusLoop,null==s?void 0:s.focusLoop,!0),focusWrap:Nt(i.focusWrap,null==s?void 0:s.focusWrap,!0),virtualFocus:Nt(i.virtualFocus,null==s?void 0:s.virtualFocus,!0)})),u=function(e={}){var t=e,{popover:n}=t,i=yt(t,["popover"]);const r=Wn(i.store,$n(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"])),a=null==r?void 0:r.getState(),s=function(e={}){return function(e={}){const t=Wn(e.store,$n(e.disclosure,["contentElement","disclosureElement"])),n=null==t?void 0:t.getState(),i=Nt(e.open,null==n?void 0:n.open,e.defaultOpen,!1),r=Nt(e.animated,null==n?void 0:n.animated,!1),a=Dn({open:i,animated:r,animating:!!r&&i,mounted:i,contentElement:Nt(null==n?void 0:n.contentElement,null),disclosureElement:Nt(null==n?void 0:n.disclosureElement,null)},t);return Tn(a,()=>Hn(a,["animated","animating"],e=>{e.animated||a.setState("animating",!1)})),Tn(a,()=>zn(a,["open"],()=>{a.getState().animated&&a.setState("animating",!0)})),Tn(a,()=>Hn(a,["open","animating"],e=>{a.setState("mounted",e.open||e.animating)})),wt(xt({},a),{disclosure:e.disclosure,setOpen:e=>a.setState("open",e),show:()=>a.setState("open",!0),hide:()=>a.setState("open",!1),toggle:()=>a.setState("open",e=>!e),stopAnimation:()=>a.setState("animating",!1),setContentElement:e=>a.setState("contentElement",e),setDisclosureElement:e=>a.setState("disclosureElement",e)})}(e)}(wt(xt({},i),{store:r})),l=Nt(i.placement,null==a?void 0:a.placement,"bottom"),o=Dn(wt(xt({},s.getState()),{placement:l,currentPlacement:l,anchorElement:Nt(null==a?void 0:a.anchorElement,null),popoverElement:Nt(null==a?void 0:a.popoverElement,null),arrowElement:Nt(null==a?void 0:a.arrowElement,null),rendered:Symbol("rendered")}),s,r);return wt(xt(xt({},s),o),{setAnchorElement:e=>o.setState("anchorElement",e),setPopoverElement:e=>o.setState("popoverElement",e),setArrowElement:e=>o.setState("arrowElement",e),render:()=>o.setState("rendered",Symbol("rendered"))})}(wt(xt({},i),{placement:Nt(i.placement,null==s?void 0:s.placement,"bottom-start")})),c=Nt(i.value,null==s?void 0:s.value,i.defaultValue,""),d=Nt(i.selectedValue,null==s?void 0:s.selectedValue,null==a?void 0:a.values,i.defaultSelectedValue,""),f=Array.isArray(d),m=wt(xt(xt({},o.getState()),u.getState()),{value:c,selectedValue:d,resetValueOnSelect:Nt(i.resetValueOnSelect,null==s?void 0:s.resetValueOnSelect,f),resetValueOnHide:Nt(i.resetValueOnHide,null==s?void 0:s.resetValueOnHide,f&&!n),activeValue:null==s?void 0:s.activeValue}),v=Dn(m,o,u,r);return li&&Tn(v,()=>Hn(v,["virtualFocus"],()=>{v.setState("virtualFocus",!1)})),Tn(v,()=>{if(n)return jt(Hn(v,["selectedValue"],e=>{Array.isArray(e.selectedValue)&&n.setValues(e.selectedValue)}),Hn(n,["values"],e=>{v.setState("selectedValue",e.values)}))}),Tn(v,()=>Hn(v,["resetValueOnHide","mounted"],e=>{e.resetValueOnHide&&(e.mounted||v.setState("value",c))})),Tn(v,()=>Hn(v,["open"],e=>{e.open||(v.setState("activeId",l),v.setState("moves",0))})),Tn(v,()=>Hn(v,["moves","activeId"],(e,t)=>{e.moves===t.moves&&v.setState("activeValue",void 0)})),Tn(v,()=>Rn(v,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;const{activeId:n}=v.getState(),i=o.item(n);v.setState("activeValue",null==i?void 0:i.value)})),wt(xt(xt(xt({},u),o),v),{tag:n,setValue:e=>v.setState("value",e),resetValue:()=>v.setState("value",m.value),setSelectedValue:e=>v.setState("selectedValue",e)})}function ui(e={}){e=function(e){const t=Pn();return function(e){const t=un(e.id);return ut({id:t},e)}(e=ct(ut({},e),{tag:void 0!==e.tag?e.tag:t}))}(e);const[t,n]=function(e,t){const[n,i]=Mt.useState(()=>e(t));sn(()=>Bn(n),[n]);const r=Mt.useCallback(e=>Kn(n,e),[n]);return[Mt.useMemo(()=>ct(ut({},n),{useState:r}),[n,r]),ln(()=>{i(n=>e(ut(ut({},t),n.getState())))})]}(oi,e);return function(e,t,n){return cn(t,[n.tag]),Un(e,n,"value","setValue"),Un(e,n,"selectedValue","setSelectedValue"),Un(e,n,"resetValueOnHide"),Un(e,n,"resetValueOnSelect"),Object.assign(Xn(function(e,t,n){return cn(t,[n.popover]),Un(e,n,"placement"),Zn(e,t,n)}(e,t,n),t,n),{tag:n.tag})}(t,n,e)}var ci=jn(),di=(ci.useContext,ci.useScopedContext,ci.useProviderContext),fi=jn([ci.ContextProvider],[ci.ScopedContextProvider]),mi=(fi.useContext,fi.useScopedContext,fi.useProviderContext,fi.ContextProvider),vi=fi.ScopedContextProvider,pi=((0,Mt.createContext)(void 0),(0,Mt.createContext)(void 0),jn([mi],[vi])),hi=(pi.useContext,pi.useScopedContext,pi.useProviderContext),gi=pi.ContextProvider,bi=pi.ScopedContextProvider,xi=(0,Mt.createContext)(void 0),wi=jn([gi,Nn],[bi,Mn]),yi=wi.useContext,_i=wi.useScopedContext,Ci=wi.useProviderContext,ji=wi.ContextProvider,Si=wi.ScopedContextProvider,Vi=(0,Mt.createContext)(void 0),ki=(0,Mt.createContext)(!1);function Ii(e={}){const t=ui(e);return(0,i.jsx)(ji,{value:t,children:e.children})}var Ei=Cn(function(e){var t=e,{store:n}=t,i=dt(t,["store"]);const r=Ci();kt(n=n||r,!1);const a=n.useState(e=>{var t;return null==(t=e.baseElement)?void 0:t.id});return Et(i=ut({htmlFor:a},i))}),Ni=wn(xn(function(e){return yn("label",Ei(e))}));function Mi(e,t){return t&&e.item(t)||null}var Fi=Symbol("FOCUS_SILENTLY");function Oi(e,t,n){if(!t)return!1;if(t===n)return!1;const i=e.item(t.id);return!(!i||n&&i.element===n)}var Ai=(0,Mt.createContext)(!0),Pi="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function Li(e){return!!e.matches(Pi)&&!!function(e){if("function"==typeof e.checkVisibility)return e.checkVisibility();const t=e;return t.offsetWidth>0||t.offsetHeight>0||e.getClientRects().length>0}(e)&&!e.closest("[inert]")}function Di(e){const t=Dt(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&n===e.id}function Ti(e){const t=Dt(e);if(!t)return!1;if(Tt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!!n&&"id"in e&&(n===e.id||!!e.querySelector(`#${CSS.escape(n)}`))}var Bi=Yt(),zi=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],Hi=Symbol("safariFocusAncestor");function Ri(e,t){e&&(e[Hi]=t)}function $i(e){return!("input"!==e.tagName.toLowerCase()||!e.type||"radio"!==e.type&&"checkbox"!==e.type)}function Wi(e,t,n,i,r){return e?t?n&&!i?-1:void 0:n?r:r||0:r}function qi(e,t){return ln(n=>{null==e||e(n),n.defaultPrevented||t&&(n.stopPropagation(),n.preventDefault())})}var Gi=!1,Ki=!0;function Yi(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(Ki=!1))}function Ui(e){e.metaKey||e.ctrlKey||e.altKey||(Ki=!0)}var Zi=Cn(function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:i,autoFocus:r,onFocusVisible:a}=t,s=dt(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const l=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{n&&(Gi||(tn("mousedown",Yi,!0),tn("keydown",Ui,!0),Gi=!0))},[n]),Bi&&(0,Mt.useEffect)(()=>{if(!n)return;const e=l.current;if(!e)return;if(!$i(e))return;const t=function(e){return"labels"in e?e.labels:null}(e);if(!t)return;const i=()=>queueMicrotask(()=>e.focus());for(const e of t)e.addEventListener("mouseup",i);return()=>{for(const e of t)e.removeEventListener("mouseup",i)}},[n]);const o=n&&It(s),u=!!o&&!i,[c,d]=(0,Mt.useState)(!1);(0,Mt.useEffect)(()=>{n&&u&&c&&d(!1)},[n,u,c]),(0,Mt.useEffect)(()=>{if(!n)return;if(!c)return;const e=l.current;if(!e)return;if("undefined"==typeof IntersectionObserver)return;const t=new IntersectionObserver(()=>{Li(e)||d(!1)});return t.observe(e),()=>t.disconnect()},[n,c]);const f=qi(s.onKeyPressCapture,o),m=qi(s.onMouseDownCapture,o),v=qi(s.onClickCapture,o),p=s.onMouseDown,h=ln(e=>{if(null==p||p(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget;if(!Bi)return;if(Ut(e))return;if(!Bt(t)&&!$i(t))return;let i=!1;const r=()=>{i=!0};t.addEventListener("focusin",r,{capture:!0,once:!0});const a=function(e){for(;e&&!Li(e);)e=e.closest(Pi);return e||null}(t.parentElement);Ri(a,!0),en(t,"mouseup",()=>{t.removeEventListener("focusin",r,!0),Ri(a,!1),i||function(e){!Ti(e)&&Li(e)&&e.focus()}(t)})}),g=(e,t)=>{if(t&&(e.currentTarget=t),!n)return;const i=e.currentTarget;i&&Di(i)&&(null==a||a(e),e.defaultPrevented||(i.dataset.focusVisible="true",d(!0)))},b=s.onKeyDownCapture,x=ln(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;if(c)return;if(e.metaKey)return;if(e.altKey)return;if(e.ctrlKey)return;if(!Zt(e))return;const t=e.currentTarget;en(t,"focusout",()=>g(e,t))}),w=s.onFocusCapture,y=ln(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!n)return;if(!Zt(e))return void d(!1);const t=e.currentTarget;Ki||function(e){const{tagName:t,readOnly:n,type:i}=e;return"TEXTAREA"===t&&!n||"SELECT"===t&&!n||("INPUT"!==t||n?!!e.isContentEditable||!("combobox"!==e.getAttribute("role")||!e.dataset.name):zi.includes(i))}(e.target)?en(e.target,"focusout",()=>g(e,t)):d(!1)}),_=s.onBlur,C=ln(e=>{null==_||_(e),n&&Jt(e)&&(e.currentTarget.removeAttribute("data-focus-visible"),d(!1))}),j=(0,Mt.useContext)(Ai),S=ln(e=>{n&&r&&e&&j&&queueMicrotask(()=>{Di(e)||Li(e)&&e.focus()})}),V=function(e,t){const n=e=>{if("string"==typeof e)return e},[i,r]=(0,Mt.useState)(()=>n(t));return sn(()=>{const i=e&&"current"in e?e.current:e;r((null==i?void 0:i.tagName.toLowerCase())||n(t))},[e,t]),i}(l),k=n&&function(e){return!e||"button"===e||"summary"===e||"input"===e||"select"===e||"textarea"===e||"a"===e}(V),I=n&&function(e){return!e||"button"===e||"input"===e||"select"===e||"textarea"===e}(V),E=s.style,N=(0,Mt.useMemo)(()=>u?ut({pointerEvents:"none"},E):E,[u,E]);return Et(s=ct(ut({"data-focus-visible":n&&c||void 0,"data-autofocus":r||void 0,"aria-disabled":o||void 0},s),{ref:on(l,S,s.ref),style:N,tabIndex:Wi(n,u,k,I,s.tabIndex),disabled:!(!I||!u)||void 0,contentEditable:o?void 0:s.contentEditable,onKeyPressCapture:f,onClickCapture:v,onMouseDownCapture:m,onMouseDown:h,onKeyDownCapture:x,onFocusCapture:y,onBlur:C}))});function Xi(e,t,n){return ln(i=>{var r;if(null==t||t(i),i.defaultPrevented)return;if(i.isPropagationStopped())return;if(!Zt(i))return;if(function(e){return"Shift"===e.key||"Control"===e.key||"Alt"===e.key||"Meta"===e.key}(i))return;if(function(e){const t=e.target;return!(t&&!Ht(t)||1!==e.key.length||e.ctrlKey||e.metaKey)}(i))return;const a=e.getState(),s=null==(r=Mi(e,a.activeId))?void 0:r.element;if(!s)return;const l=i,{view:o}=l,u=dt(l,["view"]);s!==(null==n?void 0:n.current)&&s.focus(),function(e,t,n){const i=new KeyboardEvent(t,n);return e.dispatchEvent(i)}(s,i.type,u)||i.preventDefault(),i.currentTarget.contains(s)&&i.stopPropagation()})}xn(function(e){return yn("div",Zi(e))});var Qi=Cn(function(e){var t=e,{store:n,composite:r=!0,focusOnMove:a=r,moveOnKeyPress:s=!0}=t,l=dt(t,["store","composite","focusOnMove","moveOnKeyPress"]);const o=En();kt(n=n||o,!1);const u=(0,Mt.useRef)(null),c=(0,Mt.useRef)(null),d=function(e){const[t,n]=(0,Mt.useState)(!1),i=(0,Mt.useCallback)(()=>n(!0),[]),r=e.useState(t=>Mi(e,t.activeId));return(0,Mt.useEffect)(()=>{const e=null==r?void 0:r.element;t&&e&&(n(!1),e.focus({preventScroll:!0}))},[r,t]),i}(n),f=n.useState("moves"),[,m]=function(e){const[t,n]=(0,Mt.useState)(null);return sn(()=>{if(null==t)return;if(!e)return;let n=null;return e(e=>(n=e,t)),()=>{e(n)}},[t,e]),[t,n]}(r?n.setBaseElement:null);(0,Mt.useEffect)(()=>{var e;if(!n)return;if(!f)return;if(!r)return;if(!a)return;const{activeId:t}=n.getState(),i=null==(e=Mi(n,t))?void 0:e.element;var s;i&&("scrollIntoView"in(s=i)?(s.focus({preventScroll:!0}),s.scrollIntoView(xt({block:"nearest",inline:"nearest"},undefined))):s.focus())},[n,f,r,a]),sn(()=>{if(!n)return;if(!f)return;if(!r)return;const{baseElement:e,activeId:t}=n.getState();if(null!==t)return;if(!e)return;const i=c.current;c.current=null,i&&Xt(i,{relatedTarget:e}),Di(e)||e.focus()},[n,f,r]);const v=n.useState("activeId"),p=n.useState("virtualFocus");sn(()=>{var e;if(!n)return;if(!r)return;if(!p)return;const t=c.current;if(c.current=null,!t)return;const i=(null==(e=Mi(n,v))?void 0:e.element)||Dt(t);i!==t&&Xt(t,{relatedTarget:i})},[n,v,p,r]);const h=Xi(n,l.onKeyDownCapture,c),g=Xi(n,l.onKeyUpCapture,c),b=l.onFocusCapture,x=ln(e=>{if(null==b||b(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:t}=n.getState();if(!t)return;const i=e.relatedTarget,r=function(e){const t=e[Fi];return delete e[Fi],t}(e.currentTarget);Zt(e)&&r&&(e.stopPropagation(),c.current=i)}),w=l.onFocus,y=ln(e=>{if(null==w||w(e),e.defaultPrevented)return;if(!r)return;if(!n)return;const{relatedTarget:t}=e,{virtualFocus:i}=n.getState();i?Zt(e)&&!Oi(n,t)&&queueMicrotask(d):Zt(e)&&n.setActiveId(null)}),_=l.onBlurCapture,C=ln(e=>{var t;if(null==_||_(e),e.defaultPrevented)return;if(!n)return;const{virtualFocus:i,activeId:r}=n.getState();if(!i)return;const a=null==(t=Mi(n,r))?void 0:t.element,s=e.relatedTarget,l=Oi(n,s),o=c.current;c.current=null,Zt(e)&&l?(s===a?o&&o!==s&&Xt(o,e):a?Xt(a,e):o&&Xt(o,e),e.stopPropagation()):!Oi(n,e.target)&&a&&Xt(a,e)}),j=l.onKeyDown,S=dn(s),V=ln(e=>{var t;if(null==j||j(e),e.nativeEvent.isComposing)return;if(e.defaultPrevented)return;if(!n)return;if(!Zt(e))return;const{orientation:i,renderedItems:r,activeId:a}=n.getState(),s=Mi(n,a);if(null==(t=null==s?void 0:s.element)?void 0:t.isConnected)return;const l="horizontal"!==i,o="vertical"!==i,u=r.some(e=>!!e.rowId);if(("ArrowLeft"===e.key||"ArrowRight"===e.key||"Home"===e.key||"End"===e.key)&&Ht(e.currentTarget))return;const c={ArrowUp:(u||l)&&(()=>{if(u){const e=function(e){return e.find(e=>!e.disabled)}(Qn(Jn(function(e){const t=[];for(const n of e){const e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===n.rowId});e?e.push(n):t.push([n])}return t}(r))));return null==e?void 0:e.id}return null==n?void 0:n.last()}),ArrowRight:(u||o)&&n.first,ArrowDown:(u||l)&&n.first,ArrowLeft:(u||o)&&n.last,Home:n.first,End:n.last,PageUp:n.first,PageDown:n.last},d=c[e.key];if(d){const t=d();if(void 0!==t){if(!S(e))return;e.preventDefault(),n.move(t)}}});l=fn(l,e=>(0,i.jsx)(Nn,{value:n,children:e}),[n]);const k=n.useState(e=>{var t;if(n&&r&&e.virtualFocus)return null==(t=Mi(n,e.activeId))?void 0:t.id});l=ct(ut({"aria-activedescendant":k},l),{ref:on(u,m,l.ref),onKeyDownCapture:h,onKeyUpCapture:g,onFocusCapture:x,onFocus:y,onBlurCapture:C,onKeyDown:V});const I=n.useState(e=>r&&(e.virtualFocus||null===e.activeId));return Zi(ut({focusable:I},l))}),Ji=(xn(function(e){return yn("div",Qi(e))}),Cn(function(e){var t=e,{store:n}=t,i=dt(t,["store"]);const r=hi();return n=n||r,ct(ut({},i),{ref:on(null==n?void 0:n.setAnchorElement,i.ref)})}));function er(e,t,n){if(!n)return!1;const i=e.find(e=>!e.disabled&&e.value);return(null==i?void 0:i.value)===t}function tr(e,t){return!!t&&null!=e&&(e=St(e),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}xn(function(e){return yn("div",Ji(e))});var nr=Cn(function(e){var t=e,{store:n,focusable:i=!0,autoSelect:r=!1,getAutoSelectId:a,setValueOnChange:s,showMinLength:l=0,showOnChange:o,showOnMouseDown:u,showOnClick:c=u,showOnKeyDown:d,showOnKeyPress:f=d,blurActiveItemOnClick:m,setValueOnClick:v=!0,moveOnKeyPress:p=!0,autoComplete:h="list"}=t,g=dt(t,["store","focusable","autoSelect","getAutoSelectId","setValueOnChange","showMinLength","showOnChange","showOnMouseDown","showOnClick","showOnKeyDown","showOnKeyPress","blurActiveItemOnClick","setValueOnClick","moveOnKeyPress","autoComplete"]);const b=Ci();kt(n=n||b,!1);const x=(0,Mt.useRef)(null),[w,y]=(0,Mt.useReducer)(()=>[],[]),_=(0,Mt.useRef)(!1),C=(0,Mt.useRef)(!1),j=n.useState(e=>e.virtualFocus&&r),S="inline"===h||"both"===h,[V,k]=(0,Mt.useState)(S);!function(e,t){const n=(0,Mt.useRef)(!1);sn(()=>{n.current?S&&k(!0):n.current=!0},t),sn(()=>()=>{n.current=!1},[])}(0,[S]);const I=n.useState("value"),E=(0,Mt.useRef)();(0,Mt.useEffect)(()=>Hn(n,["selectedValue","activeId"],(e,t)=>{E.current=t.selectedValue}),[]);const N=n.useState(e=>{var t;if(S&&V){if(e.activeValue&&Array.isArray(e.selectedValue)){if(e.selectedValue.includes(e.activeValue))return;if(null==(t=E.current)?void 0:t.includes(e.activeValue))return}return e.activeValue}}),M=n.useState("renderedItems"),F=n.useState("open"),O=n.useState("contentElement"),A=(0,Mt.useMemo)(()=>{if(!S)return I;if(!V)return I;if(er(M,N,j)){if(tr(I,N)){const e=(null==N?void 0:N.slice(I.length))||"";return I+e}return I}return N||I},[S,V,M,N,j,I]);(0,Mt.useEffect)(()=>{const e=x.current;if(!e)return;const t=()=>k(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,Mt.useEffect)(()=>{if(!S)return;if(!V)return;if(!N)return;if(!er(M,N,j))return;if(!tr(I,N))return;let e=_t;return queueMicrotask(()=>{const t=x.current;if(!t)return;const{start:n,end:i}=$t(t),r=I.length,a=N.length;Gt(t,r,a),e=()=>{if(!Di(t))return;const{start:e,end:s}=$t(t);e===r&&s===a&&Gt(t,n,i)}}),()=>e()},[w,S,V,N,M,j,I]);const P=(0,Mt.useRef)(null),L=ln(a),D=(0,Mt.useRef)(null);(0,Mt.useEffect)(()=>{if(!F)return;if(!O)return;const e=qt(O);if(!e)return;P.current=e;const t=()=>{_.current=!1},i=()=>{if(!n)return;if(!_.current)return;const{activeId:e}=n.getState();null!==e&&e!==D.current&&(_.current=!1)},r={passive:!0,capture:!0};return e.addEventListener("wheel",t,r),e.addEventListener("touchmove",t,r),e.addEventListener("scroll",i,r),()=>{e.removeEventListener("wheel",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("scroll",i,!0)}},[F,O,n]),sn(()=>{I&&(C.current||(_.current=!0))},[I]),sn(()=>{"always"!==j&&F||(_.current=F)},[j,F]);const T=n.useState("resetValueOnSelect");cn(()=>{var e,t;const i=_.current;if(!n)return;if(!F)return;if(!i&&!T)return;const{baseElement:r,contentElement:a,activeId:s}=n.getState();if(!r||Di(r)){if(null==a?void 0:a.hasAttribute("data-placing")){const e=new MutationObserver(y);return e.observe(a,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(j&&i){const t=L(M),i=void 0!==t?t:null!=(e=function(e){const t=e.find(e=>{var t;return!e.disabled&&"tab"!==(null==(t=e.element)?void 0:t.getAttribute("role"))});return null==t?void 0:t.id}(M))?e:n.first();D.current=i,n.move(null!=i?i:null)}else{const e=null==(t=n.item(s||n.first()))?void 0:t.element;e&&"scrollIntoView"in e&&e.scrollIntoView({block:"nearest",inline:"nearest"})}}},[n,F,w,I,j,T,L,M]),(0,Mt.useEffect)(()=>{if(!S)return;const e=x.current;if(!e)return;const t=[e,O].filter(e=>!!e),i=e=>{t.every(t=>Jt(e,t))&&(null==n||n.setValue(A))};for(const e of t)e.addEventListener("focusout",i);return()=>{for(const e of t)e.removeEventListener("focusout",i)}},[S,O,n,A]);const B=e=>e.currentTarget.value.length>=l,z=g.onChange,H=dn(null!=o?o:B),R=dn(null!=s?s:!n.tag),$=ln(e=>{if(null==z||z(e),e.defaultPrevented)return;if(!n)return;const t=e.currentTarget,{value:i,selectionStart:r,selectionEnd:a}=t,s=e.nativeEvent;if(_.current=!0,function(e){return"input"===e.type}(s)&&(s.isComposing&&(_.current=!1,C.current=!0),S)){const e="insertText"===s.inputType||"insertCompositionText"===s.inputType,t=r===i.length;k(e&&t)}if(R(e)){const e=i===n.getState().value;n.setValue(i),queueMicrotask(()=>{Gt(t,r,a)}),S&&j&&e&&y()}H(e)&&n.show(),j&&_.current||n.setActiveId(null)}),W=g.onCompositionEnd,q=ln(e=>{_.current=!0,C.current=!1,null==W||W(e),e.defaultPrevented||j&&y()}),G=g.onMouseDown,K=dn(null!=m?m:()=>!!(null==n?void 0:n.getState().includesBaseElement)),Y=dn(v),U=dn(null!=c?c:B),Z=ln(e=>{null==G||G(e),e.defaultPrevented||e.button||e.ctrlKey||n&&(K(e)&&n.setActiveId(null),Y(e)&&n.setValue(A),U(e)&&en(e.currentTarget,"mouseup",n.show))}),X=g.onKeyDown,Q=dn(null!=f?f:B),J=ln(e=>{if(null==X||X(e),e.repeat||(_.current=!1),e.defaultPrevented)return;if(e.ctrlKey)return;if(e.altKey)return;if(e.shiftKey)return;if(e.metaKey)return;if(!n)return;const{open:t}=n.getState();t||"ArrowUp"!==e.key&&"ArrowDown"!==e.key||Q(e)&&(e.preventDefault(),n.show())}),ee=g.onBlur,te=ln(e=>{_.current=!1,null==ee||ee(e),e.defaultPrevented}),ne=un(g.id),ie=function(e){return"inline"===e||"list"===e||"both"===e||"none"===e}(h)?h:void 0,re=n.useState(e=>null===e.activeId);return g=ct(ut({id:ne,role:"combobox","aria-autocomplete":ie,"aria-haspopup":Wt(O,"listbox"),"aria-expanded":F,"aria-controls":null==O?void 0:O.id,"data-active-item":re||void 0,value:A},g),{ref:on(x,g.ref),onChange:$,onCompositionEnd:q,onMouseDown:Z,onKeyDown:J,onBlur:te}),g=Qi(ct(ut({store:n,focusable:i},g),{moveOnKeyPress:e=>!function(e,...t){const n="function"==typeof e?e(...t):e;return null!=n&&!n}(p,e)&&(S&&k(!0),!0)})),g=Ji(ut({store:n},g)),ut({autoComplete:"off"},g)}),ir=xn(function(e){return yn("input",nr(e))}),rr=n(795);function ar(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function sr(...e){return e.join(", ").split(", ").reduce((e,t)=>{const n=t.endsWith("ms")?1:1e3,i=Number.parseFloat(t||"0s")*n;return i>e?i:e},0)}function lr(e,t,n){return!(n||!1===t||e&&!t)}var or=Cn(function(e){var t=e,{store:n,alwaysVisible:r}=t,a=dt(t,["store","alwaysVisible"]);const s=di();kt(n=n||s,!1);const l=(0,Mt.useRef)(null),o=un(a.id),[u,c]=(0,Mt.useState)(null),d=n.useState("open"),f=n.useState("mounted"),m=n.useState("animated"),v=n.useState("contentElement"),p=Kn(n.disclosure,"contentElement");sn(()=>{l.current&&(null==n||n.setContentElement(l.current))},[n]),sn(()=>{let e;return null==n||n.setState("animated",t=>(e=t,!0)),()=>{void 0!==e&&(null==n||n.setState("animated",e))}},[n]),sn(()=>{if(m){if(null==v?void 0:v.isConnected)return function(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}(()=>{c(d?"enter":f?"leave":null)});c(null)}},[m,v,d,f]),sn(()=>{if(!n)return;if(!m)return;if(!u)return;if(!v)return;const e=()=>null==n?void 0:n.setState("animating",!1),t=()=>(0,rr.flushSync)(e);if("leave"===u&&d)return;if("enter"===u&&!d)return;if("number"==typeof m)return ar(m,t);const{transitionDuration:i,animationDuration:r,transitionDelay:a,animationDelay:s}=getComputedStyle(v),{transitionDuration:l="0",animationDuration:o="0",transitionDelay:c="0",animationDelay:f="0"}=p?getComputedStyle(p):{},h=sr(a,s,c,f)+sr(i,r,l,o);return h?ar(Math.max(h-1e3/60,0),t):("enter"===u&&n.setState("animated",!1),void e())},[n,m,v,p,d,u]),a=fn(a,e=>(0,i.jsx)(vi,{value:n,children:e}),[n]);const h=lr(f,a.hidden,r),g=a.style,b=(0,Mt.useMemo)(()=>h?ct(ut({},g),{display:"none"}):g,[h,g]);return Et(a=ct(ut({id:o,"data-open":d||void 0,"data-enter":"enter"===u||void 0,"data-leave":"leave"===u||void 0,hidden:h},a),{ref:on(o?n.setContentElement:null,l,a.ref),style:b}))}),ur=xn(function(e){return yn("div",or(e))}),cr=(xn(function(e){var t=e,{unmountOnHide:n}=t,r=dt(t,["unmountOnHide"]);const a=di();return!1===Kn(r.store||a,e=>!n||(null==e?void 0:e.mounted))?null:(0,i.jsx)(ur,ut({},r))}),Cn(function(e){var t=e,{store:n,alwaysVisible:r}=t,a=dt(t,["store","alwaysVisible"]);const s=_i(!0),l=yi(),o=!!(n=n||l)&&n===s;kt(n,!1);const u=(0,Mt.useRef)(null),c=un(a.id),d=n.useState("mounted"),f=lr(d,a.hidden,r),m=f?ct(ut({},a.style),{display:"none"}):a.style,v=n.useState(e=>Array.isArray(e.selectedValue)),p=function(e,t,n){const i=function(e){const[t]=(0,Mt.useState)(e);return t}(n),[r,a]=(0,Mt.useState)(i);return(0,Mt.useEffect)(()=>{const n=e&&"current"in e?e.current:e;if(!n)return;const r=()=>{const e=n.getAttribute(t);a(null==e?i:e)},s=new MutationObserver(r);return s.observe(n,{attributeFilter:[t]}),r(),()=>s.disconnect()},[e,t,i]),r}(u,"role",a.role),h=("listbox"===p||"tree"===p||"grid"===p)&&v||void 0,[g,b]=(0,Mt.useState)(!1),x=n.useState("contentElement");sn(()=>{if(!d)return;const e=u.current;if(!e)return;if(x!==e)return;const t=()=>{b(!!e.querySelector("[role='listbox']"))},n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>n.disconnect()},[d,x]),g||(a=ut({role:"listbox","aria-multiselectable":h},a)),a=fn(a,e=>(0,i.jsx)(Si,{value:n,children:(0,i.jsx)(xi.Provider,{value:p,children:e})}),[n,p]);const w=!c||s&&o?null:n.setContentElement;return Et(a=ct(ut({id:c,hidden:f},a),{ref:on(w,u,a.ref),style:m}))})),dr=xn(function(e){return yn("div",cr(e))});function fr(e){const t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}var mr=Symbol("composite-hover"),vr=Cn(function(e){var t=e,{store:n,focusOnHover:i=!0,blurOnHoverEnd:r=!!i}=t,a=dt(t,["store","focusOnHover","blurOnHoverEnd"]);const s=In();kt(n=n||s,!1);const l=((0,Mt.useEffect)(()=>{mn||(tn("mousemove",gn,!0),tn("mousedown",bn,!0),tn("mouseup",bn,!0),tn("keydown",bn,!0),tn("scroll",bn,!0),mn=!0)},[]),ln(()=>vn)),o=a.onMouseMove,u=dn(i),c=ln(e=>{if(null==o||o(e),!e.defaultPrevented&&l()&&u(e)){if(!Ti(e.currentTarget)){const e=null==n?void 0:n.getState().baseElement;e&&!Di(e)&&e.focus()}null==n||n.setActiveId(e.currentTarget.id)}}),d=a.onMouseLeave,f=dn(r),m=ln(e=>{var t;null==d||d(e),e.defaultPrevented||l()&&(function(e){const t=fr(e);return!!t&&Tt(e.currentTarget,t)}(e)||function(e){let t=fr(e);if(!t)return!1;do{if(Ct(t,mr)&&t[mr])return!0;t=t.parentElement}while(t);return!1}(e)||u(e)&&f(e)&&(null==n||n.setActiveId(null),null==(t=null==n?void 0:n.getState().baseElement)||t.focus()))}),v=(0,Mt.useCallback)(e=>{e&&(e[mr]=!0)},[]);return Et(a=ct(ut({},a),{ref:on(v,a.ref),onMouseMove:c,onMouseLeave:m}))}),pr=(wn(xn(function(e){return yn("div",vr(e))})),Cn(function(e){var t=e,{store:n,shouldRegisterItem:i=!0,getItem:r=Vt,element:a}=t,s=dt(t,["store","shouldRegisterItem","getItem","element"]);const l=Vn();n=n||l;const o=un(s.id),u=(0,Mt.useRef)(a);return(0,Mt.useEffect)(()=>{const e=u.current;if(!o)return;if(!e)return;if(!i)return;const t=r({id:o,element:e});return null==n?void 0:n.renderItem(t)},[o,i,r,n]),Et(s=ct(ut({},s),{ref:on(u,s.ref)}))}));function hr(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return"Enter"===e.key?Bt(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(Bt(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}xn(function(e){return yn("div",pr(e))});var gr=Symbol("command"),br=Cn(function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:i=!0}=t,r=dt(t,["clickOnEnter","clickOnSpace"]);const a=(0,Mt.useRef)(null),[s,l]=(0,Mt.useState)(!1);(0,Mt.useEffect)(()=>{a.current&&l(Bt(a.current))},[]);const[o,u]=(0,Mt.useState)(!1),c=(0,Mt.useRef)(!1),d=It(r),[f,m]=function(e,t,n){const i=e.onLoadedMetadataCapture,r=(0,Mt.useMemo)(()=>Object.assign(()=>{},ct(ut({},i),{[t]:n})),[i,t,n]);return[null==i?void 0:i[t],{onLoadedMetadataCapture:r}]}(r,gr,!0),v=r.onKeyDown,p=ln(e=>{null==v||v(e);const t=e.currentTarget;if(e.defaultPrevented)return;if(f)return;if(d)return;if(!Zt(e))return;if(Ht(t))return;if(t.isContentEditable)return;const r=n&&"Enter"===e.key,a=i&&" "===e.key,s="Enter"===e.key&&!n,l=" "===e.key&&!i;if(s||l)e.preventDefault();else if(r||a){const n=hr(e);if(r){if(!n){e.preventDefault();const n=e,{view:i}=n,r=dt(n,["view"]),a=()=>Qt(t,r);Pt&&/firefox\//i.test(navigator.userAgent)?en(t,"keyup",a):queueMicrotask(a)}}else a&&(c.current=!0,n||(e.preventDefault(),u(!0)))}}),h=r.onKeyUp,g=ln(e=>{if(null==h||h(e),e.defaultPrevented)return;if(f)return;if(d)return;if(e.metaKey)return;const t=i&&" "===e.key;if(c.current&&t&&(c.current=!1,!hr(e))){e.preventDefault(),u(!1);const t=e.currentTarget,n=e,{view:i}=n,r=dt(n,["view"]);queueMicrotask(()=>Qt(t,r))}});return r=ct(ut(ut({"data-active":o||void 0,type:s?"button":void 0},m),r),{ref:on(a,r.ref),onKeyDown:p,onKeyUp:g}),Zi(r)});function xr(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function wr(e,t,n,i=!1){var r;if(!t)return;if(!n)return;const{renderedItems:a}=t.getState(),s=qt(e);if(!s)return;const l=function(e,t=!1){const n=e.clientHeight,{top:i}=e.getBoundingClientRect(),r=1.5*Math.max(.875*n,n-40),a=t?n-r+i:r+i;return"HTML"===e.tagName?a+e.scrollTop:a}(s,i);let o,u;for(let e=0;e=0){void 0!==u&&ur||(e&&(null==p?void 0:p.baseElement)&&p.baseElement===e.baseElement?p.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===m,ariaSetSize:e=>null!=u?u:e&&(null==p?void 0:p.ariaSetSize)&&p.baseElement===e.baseElement?p.ariaSetSize:void 0,ariaPosInSet(e){if(null!=c)return c;if(!e)return;if(!(null==p?void 0:p.ariaPosInSet))return;if(p.baseElement!==e.baseElement)return;const t=e.renderedItems.filter(e=>e.rowId===g);return p.ariaPosInSet+t.findIndex(e=>e.id===m)},isTabbable(e){if(!(null==e?void 0:e.renderedItems.length))return!0;if(e.virtualFocus)return!1;if(l)return!0;if(null===e.activeId)return!1;const t=null==n?void 0:n.item(e.activeId);return!!(null==t?void 0:t.disabled)||!(null==t?void 0:t.element)||e.activeId===m}}),C=(0,Mt.useCallback)(e=>{var t;const n=ct(ut({},e),{id:m||e.id,rowId:g,disabled:!!h,children:null==(t=e.element)?void 0:t.textContent});return o?o(n):n},[m,g,h,o]),j=d.onFocus,S=(0,Mt.useRef)(!1),V=ln(e=>{if(null==j||j(e),e.defaultPrevented)return;if(Ut(e))return;if(!m)return;if(!n)return;if(function(e,t){return!Zt(e)&&Oi(t,e.target)}(e,n))return;const{virtualFocus:t,baseElement:i}=n.getState();var r;(n.setActiveId(m),Rt(e.currentTarget)&&function(e,t=!1){if(Ht(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=Lt(e).getSelection();null==n||n.selectAllChildren(e),t&&(null==n||n.collapseToEnd())}}(e.currentTarget),t)&&(Zt(e)&&(Rt(r=e.currentTarget)||"INPUT"===r.tagName&&!Bt(r)||(null==i?void 0:i.isConnected)&&(Yt()&&e.currentTarget.hasAttribute("data-autofocus")&&e.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),S.current=!0,e.relatedTarget===i||Oi(n,e.relatedTarget)?function(e){e[Fi]=!0,e.focus({preventScroll:!0})}(i):i.focus())))}),k=d.onBlurCapture,I=ln(e=>{if(null==k||k(e),e.defaultPrevented)return;const t=null==n?void 0:n.getState();(null==t?void 0:t.virtualFocus)&&S.current&&(S.current=!1,e.preventDefault(),e.stopPropagation())}),E=d.onKeyDown,N=dn(a),M=dn(s),F=ln(e=>{if(null==E||E(e),e.defaultPrevented)return;if(!Zt(e))return;if(!n)return;const{currentTarget:t}=e,i=n.getState(),r=n.item(m),a=!!(null==r?void 0:r.rowId),s="horizontal"!==i.orientation,l="vertical"!==i.orientation,o=()=>!(!a&&!l&&i.baseElement&&Ht(i.baseElement)),u={ArrowUp:(a||s)&&n.up,ArrowRight:(a||l)&&n.next,ArrowDown:(a||s)&&n.down,ArrowLeft:(a||l)&&n.previous,Home:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.first():null==n?void 0:n.previous(-1)},End:()=>{if(o())return!a||e.ctrlKey?null==n?void 0:n.last():null==n?void 0:n.next(-1)},PageUp:()=>wr(t,n,null==n?void 0:n.up,!0),PageDown:()=>wr(t,n,null==n?void 0:n.down)}[e.key];if(u){if(Rt(t)){const n=$t(t),i=l&&"ArrowLeft"===e.key,r=l&&"ArrowRight"===e.key,a=s&&"ArrowUp"===e.key,o=s&&"ArrowDown"===e.key;if(r||o){const{length:e}=function(e){if(Ht(e))return e.value;if(e.isContentEditable){const t=Lt(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(t);if(n.end!==e)return}else if((i||a)&&0!==n.start)return}const i=u();if(N(e)||void 0!==i){if(!M(e))return;e.preventDefault(),n.move(i)}}}),O=(0,Mt.useMemo)(()=>({id:m,baseElement:b}),[m,b]);return d=fn(d,e=>(0,i.jsx)(Fn.Provider,{value:O,children:e}),[O]),d=ct(ut({id:m,"data-active-item":x||void 0},d),{ref:on(v,d.ref),tabIndex:_?d.tabIndex:-1,onFocus:V,onBlurCapture:I,onKeyDown:F}),d=br(d),d=pr(ct(ut({store:n},d),{getItem:C,shouldRegisterItem:!!m&&d.shouldRegisterItem})),Et(ct(ut({},d),{"aria-setsize":w,"aria-posinset":y}))});function _r(e){var t;return null!=(t={menu:"menuitem",listbox:"option",tree:"treeitem"}[e])?t:"option"}wn(xn(function(e){return yn("button",yr(e))}));var Cr=Cn(function(e){var t,n=e,{store:r,value:a,hideOnClick:s,setValueOnClick:l,selectValueOnClick:o=!0,resetValueOnSelect:u,focusOnHover:c=!1,moveOnKeyPress:d=!0,getItem:f}=n,m=dt(n,["store","value","hideOnClick","setValueOnClick","selectValueOnClick","resetValueOnSelect","focusOnHover","moveOnKeyPress","getItem"]);const v=_i();kt(r=r||v,!1);const{resetValueOnSelectState:p,multiSelectable:h,selected:g}=Yn(r,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)}(e.selectedValue,a)}),b=(0,Mt.useCallback)(e=>{const t=ct(ut({},e),{value:a});return f?f(t):t},[a,f]);l=null!=l?l:!h,s=null!=s?s:null!=a&&!h;const x=m.onClick,w=dn(l),y=dn(o),_=dn(null!=(t=null!=u?u:p)?t:h),C=dn(s),j=ln(e=>{null==x||x(e),e.defaultPrevented||function(e){const t=e.currentTarget;if(!t)return!1;const n=t.tagName.toLowerCase();return!!e.altKey&&("a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type)}(e)||function(e){const t=e.currentTarget;if(!t)return!1;const n=Kt();if(n&&!e.metaKey)return!1;if(!n&&!e.ctrlKey)return!1;const i=t.tagName.toLowerCase();return"a"===i||"button"===i&&"submit"===t.type||"input"===i&&"submit"===t.type}(e)||(null!=a&&(y(e)&&(_(e)&&(null==r||r.resetValue()),null==r||r.setSelectedValue(e=>Array.isArray(e)?e.includes(a)?e.filter(e=>e!==a):[...e,a]:a)),w(e)&&(null==r||r.setValue(a))),C(e)&&(null==r||r.hide()))}),S=m.onKeyDown,V=ln(e=>{if(null==S||S(e),e.defaultPrevented)return;const t=null==r?void 0:r.getState().baseElement;t&&(Di(t)||(1===e.key.length||"Backspace"===e.key||"Delete"===e.key)&&(queueMicrotask(()=>t.focus()),Ht(t)&&(null==r||r.setValue(t.value))))});h&&null!=g&&(m=ut({"aria-selected":g},m)),m=fn(m,e=>(0,i.jsx)(Vi.Provider,{value:a,children:(0,i.jsx)(ki.Provider,{value:null!=g&&g,children:e})}),[a,g]);const k=(0,Mt.useContext)(xi);m=ct(ut({role:_r(k),children:a},m),{onClick:j,onKeyDown:V});const I=dn(d);return m=yr(ct(ut({store:r},m),{getItem:b,moveOnKeyPress:e=>{if(!I(e))return!1;const t=new Event("combobox-item-move"),n=null==r?void 0:r.getState().baseElement;return null==n||n.dispatchEvent(t),!0}})),vr(ut({store:r,focusOnHover:c},m))}),jr=wn(xn(function(e){return yn("div",Cr(e))}));function Sr(e){return St(e).toLowerCase()}var Vr=Cn(function(e){var t=e,{store:n,value:r,userValue:a}=t,s=dt(t,["store","value","userValue"]);const l=_i();n=n||l;const o=(0,Mt.useContext)(Vi),u=null!=r?r:o,c=Kn(n,e=>null!=a?a:null==e?void 0:e.value),d=(0,Mt.useMemo)(()=>{if(u)return c?function(e,t){if(!e)return e;if(!t)return e;const n=(r=t,Array.isArray(r)?r:void 0!==r?[r]:[]).filter(Boolean).map(Sr);var r;const a=[],s=(e,t=!1)=>(0,i.jsx)("span",{"data-autocomplete-value":t?"":void 0,"data-user-value":t?void 0:"",children:e},a.length),l=function(e){return e.sort(([e],[t])=>e-t)}(function(e){return e.filter(([e,t],n,i)=>!i.some(([i,r],a)=>a!==n&&i<=e&&i+r>=e+t))}(function(e,t){const n=[];for(const i of t){let t=0;const r=i.length;for(;-1!==e.indexOf(i,t);){const a=e.indexOf(i,t);-1!==a&&n.push([a,r]),t=a+1}}return n}(Sr(e),new Set(n))));if(!l.length)return a.push(s(e,!0)),a;const[o]=l[0],u=[e.slice(0,o),...l.flatMap(([t,n],i)=>{var r;const a=e.slice(t,t+n),s=null==(r=l[i+1])?void 0:r[0];return[a,e.slice(t+n,s)]})];return u.forEach((e,t)=>{e&&a.push(s(e,t%2==0))}),a}(u,c):u},[u,c]);return Et(s=ut({children:d},s))}),kr=xn(function(e){return yn("span",Vr(e))}),Ir=n(731),Er=n.n(Ir),Nr=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z"})}),Mr=n(307);const Fr=[],Or=(e,t)=>e.singleSelection?t?.value:Array.isArray(t?.value)?t.value:!Array.isArray(t?.value)&&t?.value?[t.value]:Fr,Ar=[];function Pr({elements:e,getElements:t}){const n=Array.isArray(e)&&e.length>0?e:Ar,[i,r]=(0,a.useState)(n),[s,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!t)return void r(n);let e=!1;return l(!0),t().then(t=>{if(!e){const e=Array.isArray(t)&&t.length>0?t:n;r(e)}}).catch(()=>{e||r(n)}).finally(()=>{e||l(!1)}),()=>{e=!0}},[t,n]),{elements:i,isLoading:s}}function Lr(e=""){return Er()(e.trim().toLowerCase())}const Dr=(e,t,n)=>e.singleSelection?n:Array.isArray(t?.value)?t.value.includes(n)?t.value.filter(e=>e!==n):[...t.value,n]:[n];function Tr(e,t){return`${e}-${t}`}const Br=({selected:e})=>(0,i.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-multi-selection",{"is-selected":e}),children:e&&(0,i.jsx)(r.Icon,{icon:Nr})}),zr=({selected:e})=>(0,i.jsx)("span",{className:(0,U.A)("dataviews-filters__search-widget-listitem-single-selection",{"is-selected":e})});function Hr({view:e,filter:t,onChangeView:n}){const o=(0,s.useInstanceId)(Hr,"dataviews-filter-list-box"),[u,c]=(0,a.useState)(1===t.operators?.length?void 0:null),d=e.filters?.find(e=>e.field===t.field),f=Or(t,d);return(0,i.jsx)(r.Composite,{virtualFocus:!0,focusLoop:!0,activeId:u,setActiveId:c,role:"listbox",className:"dataviews-filters__search-widget-listbox","aria-label":(0,l.sprintf)( +/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ +/* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */ +(0,l.__)("List of: %1$s"),t.name),onFocusVisible:()=>{!u&&t.elements.length&&c(Tr(o,t.elements[0].value))},render:(0,i.jsx)(r.Composite.Typeahead,{}),children:t.elements.map(a=>(0,i.jsxs)(r.Composite.Hover,{render:(0,i.jsx)(r.Composite.Item,{id:Tr(o,a.value),render:(0,i.jsx)("div",{"aria-label":a.label,role:"option",className:"dataviews-filters__search-widget-listitem"}),onClick:()=>{const i=d?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:d.operator||t.operators[0],value:Dr(t,d,a.value)}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:Dr(t,d,a.value)}];n({...e,page:1,filters:i})}}),children:[t.singleSelection&&(0,i.jsx)(zr,{selected:f===a.value}),!t.singleSelection&&(0,i.jsx)(Br,{selected:f.includes(a.value)}),(0,i.jsx)("span",{children:a.label})]},a.value))})}function Rr({view:e,filter:t,onChangeView:n}){const[s,o]=(0,a.useState)(""),u=(0,a.useDeferredValue)(s),c=e.filters?.find(e=>e.field===t.field),d=Or(t,c),f=(0,a.useMemo)(()=>{const e=Lr(u);return t.elements.filter(t=>Lr(t.label).includes(e))},[t.elements,u]);return(0,i.jsxs)(Ii,{selectedValue:d,setSelectedValue:i=>{const r=c?[...(e.filters??[]).map(e=>e.field===t.field?{...e,operator:c.operator||t.operators[0],value:i}:e)]:[...e.filters??[],{field:t.field,operator:t.operators[0],value:i}];n({...e,page:1,filters:r})},setValue:o,children:[(0,i.jsxs)("div",{className:"dataviews-filters__search-widget-filter-combobox__wrapper",children:[(0,i.jsx)(Ni,{render:(0,i.jsx)(r.VisuallyHidden,{children:(0,l.__)("Search items")}),children:(0,l.__)("Search items")}),(0,i.jsx)(ir,{autoSelect:"always",placeholder:(0,l.__)("Search"),className:"dataviews-filters__search-widget-filter-combobox__input"}),(0,i.jsx)("div",{className:"dataviews-filters__search-widget-filter-combobox__icon",children:(0,i.jsx)(r.Icon,{icon:Mr.A})})]}),(0,i.jsxs)(dr,{className:"dataviews-filters__search-widget-filter-combobox-list",alwaysVisible:!0,children:[f.map(e=>(0,i.jsxs)(jr,{resetValueOnSelect:!1,value:e.value,className:"dataviews-filters__search-widget-listitem",hideOnClick:!1,setValueOnClick:!1,focusOnHover:!0,children:[t.singleSelection&&(0,i.jsx)(zr,{selected:d===e.value}),!t.singleSelection&&(0,i.jsx)(Br,{selected:d.includes(e.value)}),(0,i.jsxs)("span",{children:[(0,i.jsx)(kr,{className:"dataviews-filters__search-widget-filter-combobox-item-value",value:e.label}),!!e.description&&(0,i.jsx)("span",{className:"dataviews-filters__search-widget-listitem-description",children:e.description})]})]},e.value)),!f.length&&(0,i.jsx)("p",{children:(0,l.__)("No results found")})]})]})}function $r(e){const{elements:t,isLoading:n}=Pr({elements:e.filter.elements,getElements:e.filter.getElements});if(n)return(0,i.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,i.jsx)(r.Spinner,{})});if(0===t.length)return(0,i.jsx)("div",{className:"dataviews-filters__search-widget-no-elements",children:(0,l.__)("No elements found")});const a=t.length>10?Rr:Hr;return(0,i.jsx)(a,{...e,filter:{...e.filter,elements:t}})}var Wr=n(252),qr=n.n(Wr);function Gr({filter:e,view:t,onChangeView:n,fields:l}){const o=t.filters?.find(t=>t.field===e.field),u=Or(e,o),c=(0,a.useMemo)(()=>{const t=l.find(t=>t.id===e.field);return t?{...t,isValid:{required:!1,custom:()=>null},getValue:({item:e})=>e[t.id],setValue:({value:e})=>({[t.id]:e})}:t},[l,e.field]),d=(0,a.useMemo)(()=>(t.filters??[]).reduce((e,t)=>(e[t.field]=t.value,e),{}),[t.filters]),f=(0,s.useEvent)(i=>{if(!c||!o)return;const r=c.getValue({item:i});qr()(r,u)||n({...t,filters:(t.filters??[]).map(t=>t.field===e.field?{...t,operator:o.operator||e.operators[0],value:""===r?void 0:r}:t)})});return c&&c.Edit&&o?(0,i.jsx)(r.Flex,{className:"dataviews-filters__user-input-widget",gap:2.5,direction:"column",children:(0,i.jsx)(c.Edit,{hideLabelFromVision:!0,data:d,field:c,operator:o.operator,onChange:f})}):null}const Kr="Enter",Yr=" ",Ur=({activeElements:e,filterInView:t,filter:n})=>{if(void 0===e||0===e.length)return n.name;const r={Name:(0,i.jsx)("span",{className:"dataviews-filters__summary-filter-text-name"}),Value:(0,i.jsx)("span",{className:"dataviews-filters__summary-filter-text-value"})};if(t?.operator===m)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is any: Admin, Editor". */ +(0,l.__)("%1$s is any: %2$s"),n.name,e.map(e=>e.label).join(", ")),r);if(t?.operator===v)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is none: Admin, Editor". */ +(0,l.__)("%1$s is none: %2$s"),n.name,e.map(e=>e.label).join(", ")),r);if(t?.operator===p)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is all: Admin, Editor". */ +(0,l.__)("%1$s is all: %2$s"),n.name,e.map(e=>e.label).join(", ")),r);if(t?.operator===h)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not all: Admin, Editor". */ +(0,l.__)("%1$s is not all: %2$s"),n.name,e.map(e=>e.label).join(", ")),r);if(t?.operator===d)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is: Admin". */ +(0,l.__)("%1$s is: %2$s"),n.name,e[0].label),r);if(t?.operator===f)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Author is not: Admin". */ +(0,l.__)("%1$s is not: %2$s"),n.name,e[0].label),r);if(t?.operator===g)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than: 10". */ +(0,l.__)("%1$s is less than: %2$s"),n.name,e[0].label),r);if(t?.operator===b)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than: 10". */ +(0,l.__)("%1$s is greater than: %2$s"),n.name,e[0].label),r);if(t?.operator===x)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is less than or equal to: 10". */ +(0,l.__)("%1$s is less than or equal to: %2$s"),n.name,e[0].label),r);if(t?.operator===w)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Price is greater than or equal to: 10". */ +(0,l.__)("%1$s is greater than or equal to: %2$s"),n.name,e[0].label),r);if(t?.operator===S)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Title contains: Mars". */ +(0,l.__)("%1$s contains: %2$s"),n.name,e[0].label),r);if(t?.operator===V)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Description doesn't contain: photo". */ +(0,l.__)("%1$s doesn't contain: %2$s"),n.name,e[0].label),r);if(t?.operator===k)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Title starts with: Mar". */ +(0,l.__)("%1$s starts with: %2$s"),n.name,e[0].label),r);if(t?.operator===y)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is before: 2024-01-01". */ +(0,l.__)("%1$s is before: %2$s"),n.name,e[0].label),r);if(t?.operator===_)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is after: 2024-01-01". */ +(0,l.__)("%1$s is after: %2$s"),n.name,e[0].label),r);if(t?.operator===C)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or before: 2024-01-01". */ +(0,l.__)("%1$s is on or before: %2$s"),n.name,e[0].label),r);if(t?.operator===j)return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is on or after: 2024-01-01". */ +(0,l.__)("%1$s is on or after: %2$s"),n.name,e[0].label),r);if(t?.operator===I){const{label:t}=e[0];return(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */ +/* translators: 1: Filter name. 2: Min value. 3: Max value. e.g.: "Item count between (inc): 10 and 180". */ +(0,l.__)("%1$s between (inc): %2$s and %3$s"),n.name,t[0],t[1]),r)}return t?.operator===E?(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is: 2024-01-01". */ +(0,l.__)("%1$s is: %2$s"),n.name,e[0].label),r):t?.operator===N?(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is not: 2024-01-01". */ +(0,l.__)("%1$s is not: %2$s"),n.name,e[0].label),r):t?.operator===M?(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is in the past: 1 days". */ +(0,l.__)("%1$s is in the past: %2$s"),n.name,`${e[0].value.value} ${e[0].value.unit}`),r):t?.operator===F?(0,a.createInterpolateElement)((0,l.sprintf)( +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */ +/* translators: 1: Filter name. 2: Filter value. e.g.: "Date is over: 1 days ago". */ +(0,l.__)("%1$s is over: %2$s ago"),n.name,`${e[0].value.value} ${e[0].value.unit}`),r):(0,l.sprintf)( +/* translators: 1: Filter name e.g.: "Unknown status for Author". */ +/* translators: 1: Filter name e.g.: "Unknown status for Author". */ +(0,l.__)("Unknown status for %1$s"),n.name)};function Zr({filter:e,view:t,onChangeView:n}){const a=e.operators?.map(e=>({value:e,label:P[e]?.label})),s=t.filters?.find(t=>t.field===e.field),o=s?.operator||e.operators[0];return a.length>1&&(0,i.jsxs)(r.__experimentalHStack,{spacing:2,justify:"flex-start",className:"dataviews-filters__summary-operators-container",children:[(0,i.jsx)(r.FlexItem,{className:"dataviews-filters__summary-operators-filter-name",children:e.name}),(0,i.jsx)(r.SelectControl,{className:"dataviews-filters__summary-operators-filter-select",label:(0,l.__)("Conditions"),value:o,options:a,onChange:i=>{const r=i,a=s?.operator,l=s?[...(t.filters??[]).map(t=>{if(t.field===e.field){const e=[I,M,F],n=a&&(e.includes(a)||e.includes(r));return{...t,value:n?void 0:t.value,operator:r}}return t})]:[...t.filters??[],{field:e.field,operator:r,value:void 0}];n({...t,page:1,filters:l})},size:"small",variant:"minimal",__nextHasNoMarginBottom:!0,hideLabelFromVision:!0})]})}function Xr({addFilterRef:e,openedFilter:t,fields:n,...s}){const o=(0,a.useRef)(null),{filter:u,view:c,onChangeView:d}=s,f=c.filters?.find(e=>e.field===u.field);let m=[];const{elements:v}=Pr({elements:u.elements,getElements:u.getElements});v.length>0?m=v.filter(e=>u.singleSelection?e.value===f?.value:f?.value?.includes(e.value)):void 0!==f?.value&&(m=[{value:f.value,label:f.value}]);const p=u.isPrimary,h=f?.isLocked,g=!h&&void 0!==f?.value,b=!h&&(!p||g);return(0,i.jsx)(r.Dropdown,{defaultOpen:t===u.field,contentClassName:"dataviews-filters__summary-popover",popoverProps:{placement:"bottom-start",role:"dialog"},onClose:()=>{o.current?.focus()},renderToggle:({isOpen:t,onToggle:n})=>(0,i.jsxs)("div",{className:"dataviews-filters__summary-chip-container",children:[(0,i.jsx)(r.Tooltip,{text:(0,l.sprintf)( +/* translators: 1: Filter name. */ +/* translators: 1: Filter name. */ +(0,l.__)("Filter by: %1$s"),u.name.toLowerCase()),placement:"top",children:(0,i.jsx)("div",{className:(0,U.A)("dataviews-filters__summary-chip",{"has-reset":b,"has-values":g,"is-not-clickable":h}),role:"button",tabIndex:h?-1:0,onClick:()=>{h||n()},onKeyDown:e=>{!h&&[Kr,Yr].includes(e.key)&&(n(),e.preventDefault())},"aria-disabled":h,"aria-pressed":t,"aria-expanded":t,ref:o,children:(0,i.jsx)(Ur,{activeElements:m,filterInView:f,filter:u})})}),b&&(0,i.jsx)(r.Tooltip,{text:p?(0,l.__)("Reset"):(0,l.__)("Remove"),placement:"top",children:(0,i.jsx)("button",{className:(0,U.A)("dataviews-filters__summary-chip-remove",{"has-values":g}),onClick:()=>{d({...c,page:1,filters:c.filters?.filter(e=>e.field!==u.field)}),p?o.current?.focus():e.current?.focus()},children:(0,i.jsx)(r.Icon,{icon:fe})})})]}),renderContent:()=>(0,i.jsxs)(r.__experimentalVStack,{spacing:0,justify:"flex-start",children:[(0,i.jsx)(Zr,{...s}),s.filter.hasElements?(0,i.jsx)($r,{...s,filter:{...s.filter,elements:v}}):(0,i.jsx)(Gr,{...s,fields:n})]})})}function Qr({filters:e,view:t,onChangeView:n}){const a=!t.search&&!t.filters?.some(t=>{return!(t.isLocked||void 0===t.value&&(n=t.field,e.some(e=>e.field===n&&e.isPrimary)));var n});return(0,i.jsx)(r.Button,{disabled:a,accessibleWhenDisabled:!0,size:"compact",variant:"tertiary",className:"dataviews-filters__reset-button",onClick:()=>{n({...t,page:1,search:"",filters:t.filters?.filter(e=>!!e.isLocked)||[]})},children:(0,l.__)("Reset")})}var Jr=function(e,t){return(0,a.useMemo)(()=>{const n=[];return e.forEach(e=>{if(!1===e.filterBy||!e.hasElements&&!e.Edit)return;const i=e.filterBy.operators,r=!!e.filterBy?.isPrimary,a=t.filters?.some(t=>t.field===e.id&&!!t.isLocked)??!1;n.push({field:e.id,name:e.label,elements:e.elements,getElements:e.getElements,hasElements:e.hasElements,singleSelection:i.some(e=>A.includes(e)),operators:i,isVisible:a||r||!!t.filters?.some(t=>t.field===e.id&&O.includes(t.operator)),isPrimary:r,isLocked:a})}),n.sort((e,t)=>e.isLocked&&!t.isLocked?-1:!e.isLocked&&t.isLocked?1:e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.name.localeCompare(t.name)),n},[e,t])},ea=(0,a.memo)(function({className:e}){const{fields:t,view:n,onChangeView:s,openedFilter:l,setOpenedFilter:o}=(0,a.useContext)(W),u=(0,a.useRef)(null),c=Jr(t,n),d=(0,i.jsx)(Je,{filters:c,view:n,onChangeView:s,ref:u,setOpenedFilter:o},"add-filter"),f=c.filter(e=>e.isVisible);if(0===f.length)return null;const m=[...f.map(e=>(0,i.jsx)(Xr,{filter:e,view:n,fields:t,onChangeView:s,addFilterRef:u,openedFilter:l},e.field)),d];return m.push((0,i.jsx)(Qr,{filters:c,view:n,onChangeView:s},"reset-filters")),(0,i.jsx)(r.__experimentalHStack,{justify:"flex-start",style:{width:"fit-content"},wrap:!0,className:e,children:m})}),ta=function(e){const{isShowingFilter:t}=(0,a.useContext)(W);return t?(0,i.jsx)(ea,{...e}):null};function na({className:e}){const{actions:t=[],data:n,fields:r,getItemId:s,getItemLevel:o,isLoading:u,view:c,onChangeView:d,selection:f,onChangeSelection:m,setOpenedFilter:v,onClickItem:p,isItemClickable:h,renderItemLink:g,defaultLayouts:b,empty:x=(0,i.jsx)("p",{children:(0,l.__)("No results")})}=(0,a.useContext)(W),w=Ze.find(e=>e.type===c.type&&b[e.type])?.component;return(0,i.jsx)(w,{className:e,actions:t,data:n,fields:r,getItemId:s,getItemLevel:o,isLoading:u,onChangeView:d,onChangeSelection:m,selection:f,setOpenedFilter:v,onClickItem:p,renderItemLink:g,isItemClickable:h,view:c,empty:x})}var ia=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z"})}),ra=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z"})});function aa(){const{view:e,onChangeView:t,paginationInfo:{totalItems:n=0,totalPages:s}}=(0,a.useContext)(W);if(!n||!s||e.infiniteScrollEnabled)return null;const o=e.page??1,u=Array.from(Array(s)).map((e,t)=>{const n=t+1;return{value:n.toString(),label:n.toString(),"aria-label":o===n?(0,l.sprintf)( +// translators: 1: current page number. 2: total number of pages. +// translators: 1: current page number. 2: total number of pages. +(0,l.__)("Page %1$d of %2$d"),o,s):n.toString()}});return!!n&&1!==s&&(0,i.jsxs)(r.__experimentalHStack,{expanded:!1,className:"dataviews-pagination",justify:"end",spacing:6,children:[(0,i.jsx)(r.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"dataviews-pagination__page-select",children:(0,a.createInterpolateElement)((0,l.sprintf)( +// translators: 1: Current page number, 2: Total number of pages. +// translators: 1: Current page number, 2: Total number of pages. +(0,l._x)("
Page
%1$s
of %2$d
","paging"),"",s),{div:(0,i.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,i.jsx)(r.SelectControl,{"aria-label":(0,l.__)("Current page"),value:o.toString(),options:u,onChange:n=>{t({...e,page:+n})},size:"small",__nextHasNoMarginBottom:!0,variant:"minimal"})})}),(0,i.jsxs)(r.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,i.jsx)(r.Button,{onClick:()=>t({...e,page:o-1}),disabled:1===o,accessibleWhenDisabled:!0,label:(0,l.__)("Previous page"),icon:(0,l.isRTL)()?ia:ra,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,i.jsx)(r.Button,{onClick:()=>t({...e,page:o+1}),disabled:o>=s,accessibleWhenDisabled:!0,label:(0,l.__)("Next page"),icon:(0,l.isRTL)()?ra:ia,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})}var sa=(0,a.memo)(aa);const la=[];function oa(){const{view:e,paginationInfo:{totalItems:t=0,totalPages:n},data:s,actions:l=la}=(0,a.useContext)(W),o=pe(l,s)&&[H,R].includes(e.type);return!t||!n||n<=1&&!o?null:!!t&&(0,i.jsxs)(r.__experimentalHStack,{expanded:!1,justify:"end",className:"dataviews-footer",children:[o&&(0,i.jsx)(_e,{}),(0,i.jsx)(sa,{})]})}const ua=(0,a.memo)(function({label:e}){const{view:t,onChangeView:n}=(0,a.useContext)(W),[o,u,c]=(0,s.useDebouncedInput)(t.search);(0,a.useEffect)(()=>{u(t.search??"")},[t.search,u]);const d=(0,a.useRef)(n),f=(0,a.useRef)(t);(0,a.useEffect)(()=>{d.current=n,f.current=t},[n,t]),(0,a.useEffect)(()=>{c!==f.current?.search&&d.current({...f.current,page:1,search:c})},[c]);const m=e||(0,l.__)("Search");return(0,i.jsx)(r.SearchControl,{className:"dataviews-search",__nextHasNoMarginBottom:!0,onChange:u,value:o,label:m,placeholder:m,size:"compact"})});var ca=ua,da=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"})}),fa=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})}),ma=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})}),va=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})}),pa=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{fillRule:"evenodd",d:"M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z",clipRule:"evenodd"})}),ha=n(979),ga=n.n(ha);function ba(){const e=(0,a.useContext)(W),{view:t,onChangeView:n}=e,s=t.infiniteScrollEnabled??!1;return e.hasInfiniteScrollHandler?(0,i.jsx)(r.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,l.__)("Enable infinite scroll"),help:(0,l.__)("Automatically load more content as you scroll, instead of showing pagination links."),checked:s,onChange:e=>{n({...t,infiniteScrollEnabled:e})}}):null}const{Menu:xa}=ne(r.privateApis),wa={className:"dataviews-config__popover",placement:"bottom-end",offset:9};function ya(){const{view:e,onChangeView:t,defaultLayouts:n}=(0,a.useContext)(W),s=Object.keys(n);if(s.length<=1)return null;const o=Ze.find(t=>e.type===t.type);return(0,i.jsxs)(xa,{children:[(0,i.jsx)(xa.TriggerButton,{render:(0,i.jsx)(r.Button,{size:"compact",icon:o?.icon,label:(0,l.__)("Layout")})}),(0,i.jsx)(xa.Popover,{children:s.map(r=>{const a=Ze.find(e=>e.type===r);return a?(0,i.jsx)(xa.RadioItem,{value:r,name:"view-actions-available-view",checked:r===e.type,hideOnClick:!0,onChange:i=>{switch(i.target.value){case"list":case"grid":case"table":case"pickerGrid":const r={...e};return"layout"in r&&delete r.layout,t({...r,type:i.target.value,...n[i.target.value]})}ga()("Invalid dataview")},children:(0,i.jsx)(xa.ItemLabel,{children:a.label})},r):null})})]})}function _a(){const{view:e,fields:t,onChangeView:n}=(0,a.useContext)(W),s=(0,a.useMemo)(()=>t.filter(e=>!1!==e.enableSorting).map(e=>({label:e.label,value:e.id})),[t]);return(0,i.jsx)(r.SelectControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,label:(0,l.__)("Sort by"),value:e.sort?.field,options:s,onChange:t=>{n({...e,sort:{direction:e?.sort?.direction||"desc",field:t},showLevels:!1})}})}function Ca(){const{view:e,fields:t,onChangeView:n}=(0,a.useContext)(W);if(0===t.filter(e=>!1!==e.enableSorting).length)return null;let s=e.sort?.direction;return!s&&e.sort?.field&&(s="desc"),(0,i.jsx)(r.__experimentalToggleGroupControl,{className:"dataviews-view-config__sort-direction",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,l.__)("Order"),value:s,onChange:i=>{"asc"!==i&&"desc"!==i?ga()("Invalid direction"):n({...e,sort:{direction:i,field:e.sort?.field||t.find(e=>!1!==e.enableSorting)?.id||""},showLevels:!1})},children:L.map(e=>(0,i.jsx)(r.__experimentalToggleGroupControlOptionIcon,{value:e,icon:z[e],label:B[e]},e))})}function ja(){const{view:e,config:t,onChangeView:n}=(0,a.useContext)(W),{infiniteScrollEnabled:s}=e;return!t||!t.perPageSizes||t.perPageSizes.length<2||t.perPageSizes.length>6||s?null:(0,i.jsx)(r.__experimentalToggleGroupControl,{__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,isBlock:!0,label:(0,l.__)("Items per page"),value:e.perPage||10,disabled:!e?.sort?.field,onChange:t=>{const i="number"==typeof t||void 0===t?t:parseInt(t,10);n({...e,perPage:i,page:1})},children:t.perPageSizes.map(e=>(0,i.jsx)(r.__experimentalToggleGroupControlOption,{value:e,label:e.toString()},e))})}function Sa({previewOptions:e,onChangePreviewOption:t,onMenuOpenChange:n,activeOption:a}){return(0,i.jsxs)(xa,{onOpenChange:n,children:[(0,i.jsx)(xa.TriggerButton,{render:(0,i.jsx)(r.Button,{className:"dataviews-field-control__field-preview-options-button",size:"compact",icon:Q,label:(0,l.__)("Preview")})}),(0,i.jsx)(xa.Popover,{children:e?.map(({id:e,label:n})=>(0,i.jsx)(xa.RadioItem,{value:e,checked:e===a,onChange:()=>{t?.(e),(e=>{setTimeout(()=>{const t=document.querySelector(`.dataviews-field-control__field-${e} .dataviews-field-control__field-preview-options-button`);t instanceof HTMLElement&&t.focus()},50)})(e)},children:(0,i.jsx)(xa.ItemLabel,{children:n})},e))})]})}function Va({field:e,label:t,description:n,isVisible:s,isFirst:o,isLast:u,canMove:c=!0,onToggleVisibility:d,onMoveUp:f,onMoveDown:m,previewOptions:v,onChangePreviewOption:p}){const[h,g]=(0,a.useState)(!1);return(0,i.jsx)(r.__experimentalItem,{children:(0,i.jsxs)(r.__experimentalHStack,{expanded:!0,className:(0,U.A)("dataviews-field-control__field",`dataviews-field-control__field-${e.id}`,{"is-interacting":h}),justify:"flex-start",children:[(0,i.jsx)("span",{className:"dataviews-field-control__icon",children:!c&&!e.enableHiding&&(0,i.jsx)(r.Icon,{icon:da})}),(0,i.jsxs)("span",{className:"dataviews-field-control__label-sub-label-container",children:[(0,i.jsx)("span",{className:"dataviews-field-control__label",children:t||e.label}),n&&(0,i.jsx)("span",{className:"dataviews-field-control__sub-label",children:n})]}),(0,i.jsxs)(r.__experimentalHStack,{justify:"flex-end",expanded:!1,className:"dataviews-field-control__actions",children:[s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.Button,{disabled:o||!c,accessibleWhenDisabled:!0,size:"compact",onClick:f,icon:fa,label:o||!c?(0,l.__)("This field can't be moved up"):(0,l.sprintf)( +/* translators: %s: field label */ +/* translators: %s: field label */ +(0,l.__)("Move %s up"),e.label)}),(0,i.jsx)(r.Button,{disabled:u||!c,accessibleWhenDisabled:!0,size:"compact",onClick:m,icon:ma,label:u||!c?(0,l.__)("This field can't be moved down"):(0,l.sprintf)( +/* translators: %s: field label */ +/* translators: %s: field label */ +(0,l.__)("Move %s down"),e.label)})]}),d&&(0,i.jsx)(r.Button,{className:"dataviews-field-control__field-visibility-button",disabled:!e.enableHiding,accessibleWhenDisabled:!0,size:"compact",onClick:()=>{d(),setTimeout(()=>{const t=document.querySelector(`.dataviews-field-control__field-${e.id} .dataviews-field-control__field-visibility-button`);t instanceof HTMLElement&&t.focus()},50)},icon:s?Ve:va,label:s?(0,l.sprintf)( +/* translators: %s: field label */ +/* translators: %s: field label */ +(0,l._x)("Hide %s","field"),e.label):(0,l.sprintf)( +/* translators: %s: field label */ +/* translators: %s: field label */ +(0,l._x)("Show %s","field"),e.label)}),v&&(0,i.jsx)(Sa,{previewOptions:v,onChangePreviewOption:p,onMenuOpenChange:g,activeOption:e.id})]})]})})}function ka({index:e,field:t,view:n,onChangeView:r}){const a=n.fields??[],s=void 0!==e&&a.includes(t.id);return(0,i.jsx)(Va,{field:t,isVisible:s,isFirst:void 0!==e&&e<1,isLast:void 0!==e&&e===a.length-1,onToggleVisibility:()=>{r({...n,fields:s?a.filter(e=>e!==t.id):[...a,t.id]})},onMoveUp:void 0!==e?()=>{r({...n,fields:[...a.slice(0,e-1)??[],t.id,a[e-1],...a.slice(e+1)]})}:void 0,onMoveDown:void 0!==e?()=>{r({...n,fields:[...a.slice(0,e)??[],a[e+1],t.id,...a.slice(e+2)]})}:void 0})}function Ia(e){return!!e}function Ea(){const{view:e,fields:t,onChangeView:n}=(0,a.useContext)(W),s=[e?.titleField,e?.mediaField,e?.descriptionField].filter(Boolean),o=e.fields??[],u=t.filter(e=>!o.includes(e.id)&&!s.includes(e.id)&&"media"!==e.type&&!1!==e.enableHiding);let c=o.map(e=>t.find(t=>t.id===e)).filter(Ia);if(!c?.length&&!u?.length)return null;const d=t.find(t=>t.id===e.titleField),f=t.find(t=>t.id===e.mediaField),m=t.find(t=>t.id===e.descriptionField),v=t.filter(e=>"media"===e.type);let p;if(v.length>1){const t=Ia(f)&&(e.showMedia??!0);p=Ia(f)&&(0,i.jsx)(Va,{field:f,label:(0,l.__)("Preview"),description:f.label,isVisible:t,onToggleVisibility:()=>{n({...e,showMedia:!t})},canMove:!1,previewOptions:v.map(e=>({label:e.label,id:e.id})),onChangePreviewOption:t=>n({...e,mediaField:t})},f.id)}const h=[{field:d,isVisibleFlag:"showTitle"},{field:f,isVisibleFlag:"showMedia",ui:p},{field:m,isVisibleFlag:"showDescription"}].filter(({field:e})=>Ia(e));let g=h.filter(({field:t,isVisibleFlag:n})=>Ia(t)&&(e[n]??!0));1===g.length&&(g=g.map(e=>({...e,field:{...e.field,enableHiding:!1}}))),0===g.length&&1===c.length&&(c=[{...c[0],enableHiding:!1}]);const b=h.filter(({field:t,isVisibleFlag:n})=>Ia(t)&&!(e[n]??1));return(0,i.jsxs)(r.__experimentalVStack,{className:"dataviews-field-control",spacing:6,children:[(0,i.jsx)(r.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(g.length>0||!!c?.length)&&(0,i.jsxs)(r.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[g.map(({field:t,isVisibleFlag:r,ui:a})=>a??(0,i.jsx)(Va,{field:t,isVisible:!0,onToggleVisibility:()=>{n({...e,[r]:!1})},canMove:!1},t.id)),c.map((t,r)=>(0,i.jsx)(ka,{field:t,view:e,onChangeView:n,index:r},t.id))]})}),(!!u?.length||!!b.length)&&(0,i.jsxs)(r.__experimentalVStack,{spacing:4,children:[(0,i.jsx)(r.BaseControl.VisualLabel,{style:{margin:0},children:(0,l.__)("Hidden")}),(0,i.jsx)(r.__experimentalVStack,{className:"dataviews-view-config__properties",spacing:0,children:(0,i.jsxs)(r.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,children:[b.length>0&&b.map(({field:t,isVisibleFlag:r,ui:a})=>a??(0,i.jsx)(Va,{field:t,isVisible:!1,onToggleVisibility:()=>{n({...e,[r]:!0})},canMove:!1},t.id)),u.map(t=>(0,i.jsx)(ka,{field:t,view:e,onChangeView:n},t.id))]})})]})]})}function Na({title:e,description:t,children:n}){return(0,i.jsxs)(r.__experimentalGrid,{columns:12,className:"dataviews-settings-section",gap:4,children:[(0,i.jsxs)("div",{className:"dataviews-settings-section__sidebar",children:[(0,i.jsx)(r.__experimentalHeading,{level:2,className:"dataviews-settings-section__title",children:e}),t&&(0,i.jsx)(r.__experimentalText,{variant:"muted",className:"dataviews-settings-section__description",children:t})]}),(0,i.jsx)(r.__experimentalGrid,{columns:8,gap:4,className:"dataviews-settings-section__content",children:n})]})}function Ma(){const{view:e}=(0,a.useContext)(W),t=(0,s.useInstanceId)(Fa,"dataviews-view-config-dropdown"),n=Ze.find(t=>t.type===e.type);return(0,i.jsx)(r.Dropdown,{expandOnMobile:!0,popoverProps:{...wa,id:t},renderToggle:({onToggle:e,isOpen:n})=>(0,i.jsx)(r.Button,{size:"compact",icon:pa,label:(0,l._x)("View options","View is used as a noun"),onClick:e,"aria-expanded":n?"true":"false","aria-controls":t}),renderContent:()=>(0,i.jsx)(r.__experimentalDropdownContentWrapper,{paddingSize:"medium",className:"dataviews-config__popover-content-wrapper",children:(0,i.jsxs)(r.__experimentalVStack,{className:"dataviews-view-config",spacing:6,children:[(0,i.jsxs)(Na,{title:(0,l.__)("Appearance"),children:[(0,i.jsxs)(r.__experimentalHStack,{expanded:!0,className:"is-divided-in-two",children:[(0,i.jsx)(_a,{}),(0,i.jsx)(Ca,{})]}),!!n?.viewConfigOptions&&(0,i.jsx)(n.viewConfigOptions,{}),(0,i.jsx)(ba,{}),(0,i.jsx)(ja,{})]}),(0,i.jsx)(Na,{title:(0,l.__)("Properties"),children:(0,i.jsx)(Ea,{})})]})})})}function Fa(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(ya,{}),(0,i.jsx)(Ma,{})]})}var Oa=(0,a.memo)(Fa);function Aa({item:e,field:t}){const{elements:n,isLoading:i}=Pr({elements:t.elements,getElements:t.getElements}),r=t.getValue({item:e});return i||0===n.length?r:n?.find(e=>e.value===r)?.label||t.getValue({item:e})}const Pa=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;var La={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Pa.test(n)?null:(0,l.__)("Value must be a valid email address.")}},Edit:"email",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,V,k,m,v,p,h]}},Da={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Number.isInteger(n)?null:(0,l.__)("Value must be an integer.")}},Edit:"integer",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},Ta={sort:function(e,t,n){return"asc"===n?e-t:t-e},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return function(e){return""===e||null==e}(n)||Number.isFinite(n)?null:(0,l.__)("Value must be a number.")}},Edit:"number",render:({item:e,field:t})=>{t.hasElements;const n=t.getValue({item:e});return[null,void 0].includes(n)?null:Number(n).toFixed(2)},enableSorting:!0,filterBy:{defaultOperators:[d,f,g,b,x,w,I],validOperators:[d,f,g,b,x,w,I,m,v,p,h]}},Ba={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"text",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,V,k,m,v,p,h]}},za={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},isValid:{elements:!0,custom:()=>null},Edit:"datetime",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,M,F],validOperators:[E,N,y,_,C,j,M,F]}},Ha=n(443),Ra={sort:function(e,t,n){const i=new Date(e).getTime(),r=new Date(t).getTime();return"asc"===n?i-r:r-i},Edit:"date",isValid:{elements:!0,custom:()=>null},render:({item:e,field:t})=>{if(t.hasElements)return(0,i.jsx)(Aa,{item:e,field:t});const n=t.getValue({item:e});return n?(r=n,(0,Ha.dateI18n)((0,Ha.getSettings)().formats.date,(0,Ha.getDate)(r))):"";var r},enableSorting:!0,filterBy:{defaultOperators:[E,N,y,_,C,j,M,F,I],validOperators:[E,N,y,_,C,j,M,F,I]}},$a={sort:function(e,t,n){const i=Boolean(e);return i===Boolean(t)?0:"asc"===n?i?1:-1:i?-1:1},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||[!0,!1].includes(n)?null:(0,l.__)("Value must be true, false, or undefined")}},Edit:"checkbox",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):!0===t.getValue({item:e})?(0,l.__)("True"):!1===t.getValue({item:e})?(0,l.__)("False"):null,enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:[d,f]}},Wa={sort:function(){return 0},isValid:{elements:!0,custom:()=>null},Edit:null,render:()=>null,enableSorting:!1,filterBy:!1};const qa={sort:function(e,t,n){const i=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(i.length!==r.length)return"asc"===n?i.length-r.length:r.length-i.length;const a=i.join(","),s=r.join(",");return"asc"===n?a.localeCompare(s):s.localeCompare(a)},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||Array.isArray(n)?n.every(e=>"string"==typeof e)?null:(0,l.__)("Every value must be a string."):(0,l.__)("Value must be an array.")}},Edit:"array",render:function({item:e,field:t}){return(t.getValue({item:e})||[]).join(", ")},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[m,v,p,h]}};var Ga=qa,Ka={sort:function(e,t,n){return 0},isValid:{elements:!0,custom:()=>null},Edit:"password",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):"••••••••",enableSorting:!1,filterBy:!1},Ya={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"telephone",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,V,k,m,v,p,h]}},Ua={grad:.9,turn:360,rad:360/(2*Math.PI)},Za=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Xa=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Qa=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Ja=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},es=function(e){return{r:Qa(e.r,0,255),g:Qa(e.g,0,255),b:Qa(e.b,0,255),a:Qa(e.a)}},ts=function(e){return{r:Xa(e.r),g:Xa(e.g),b:Xa(e.b),a:Xa(e.a,3)}},ns=/^#([0-9a-f]{3,8})$/i,is=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},rs=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=Math.max(t,n,i),s=a-Math.min(t,n,i),l=s?a===t?(n-i)/s:a===n?2+(i-t)/s:4+(t-n)/s:0;return{h:60*(l<0?l+6:l),s:a?s/a*100:0,v:a/255*100,a:r}},as=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var a=Math.floor(t),s=i*(1-n),l=i*(1-(t-a)*n),o=i*(1-(1-t+a)*n),u=a%6;return{r:255*[i,l,s,s,o,i][u],g:255*[o,i,i,l,s,s][u],b:255*[s,s,o,i,i,l][u],a:r}},ss=function(e){return{h:Ja(e.h),s:Qa(e.s,0,100),l:Qa(e.l,0,100),a:Qa(e.a)}},ls=function(e){return{h:Xa(e.h),s:Xa(e.s),l:Xa(e.l),a:Xa(e.a,3)}},os=function(e){return as((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},us=function(e){return{h:(t=rs(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},cs=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ds=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,fs=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ms=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vs={string:[[function(e){var t=ns.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?Xa(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?Xa(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=fs.exec(e)||ms.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:es({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=cs.exec(e)||ds.exec(e);if(!t)return null;var n,i,r=ss({h:(n=t[1],i=t[2],void 0===i&&(i="deg"),Number(n)*(Ua[i]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return os(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,a=void 0===r?1:r;return Za(t)&&Za(n)&&Za(i)?es({r:Number(t),g:Number(n),b:Number(i),a:Number(a)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,a=void 0===r?1:r;if(!Za(t)||!Za(n)||!Za(i))return null;var s=ss({h:Number(t),s:Number(n),l:Number(i),a:Number(a)});return os(s)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,a=void 0===r?1:r;if(!Za(t)||!Za(n)||!Za(i))return null;var s=function(e){return{h:Ja(e.h),s:Qa(e.s,0,100),v:Qa(e.v,0,100),a:Qa(e.a)}}({h:Number(t),s:Number(n),v:Number(i),a:Number(a)});return as(s)},"hsv"]]},ps=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=(e=ts(this.rgba)).r,n=e.g,i=e.b,a=(r=e.a)<1?is(Xa(255*r)):"","#"+is(t)+is(n)+is(i)+a;var e,t,n,i,r,a},e.prototype.toRgb=function(){return ts(this.rgba)},e.prototype.toRgbString=function(){return t=(e=ts(this.rgba)).r,n=e.g,i=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+i+", "+r+")":"rgb("+t+", "+n+", "+i+")";var e,t,n,i,r},e.prototype.toHsl=function(){return ls(us(this.rgba))},e.prototype.toHslString=function(){return t=(e=ls(us(this.rgba))).h,n=e.s,i=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+i+"%, "+r+")":"hsl("+t+", "+n+"%, "+i+"%)";var e,t,n,i,r},e.prototype.toHsv=function(){return e=rs(this.rgba),{h:Xa(e.h),s:Xa(e.s),v:Xa(e.v),a:Xa(e.a,3)};var e},e.prototype.invert=function(){return ws({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),ws(hs(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),ws(hs(this.rgba,-e))},e.prototype.grayscale=function(){return ws(hs(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),ws(bs(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),ws(bs(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?ws({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Xa(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=us(this.rgba);return"number"==typeof e?ws({h:e,s:t.s,l:t.l,a:t.a}):Xa(t.h)},e.prototype.isEqual=function(e){return this.toHex()===ws(e).toHex()},e}(),ws=function(e){return e instanceof xs?e:new xs(e)},ys={sort:function(e,t,n){const i=ws(e),r=ws(t);if(!i.isValid()&&!r.isValid())return 0;if(!i.isValid())return"asc"===n?1:-1;if(!r.isValid())return"asc"===n?-1:1;const a=i.toHsl(),s=r.toHsl();return a.h!==s.h?"asc"===n?a.h-s.h:s.h-a.h:a.s!==s.s?"asc"===n?a.s-s.s:s.s-a.s:"asc"===n?a.l-s.l:s.l-a.l},isValid:{elements:!0,custom:(e,t)=>{const n=t.getValue({item:e});return[void 0,"",null].includes(n)||ws(n).isValid()?null:(0,l.__)("Value must be a valid color.")}},Edit:"color",render:({item:e,field:t})=>{if(t.hasElements)return(0,i.jsx)(Aa,{item:e,field:t});const n=t.getValue({item:e});return n&&ws(n).isValid()?(0,i.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,i.jsx)("div",{style:{width:"16px",height:"16px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",flexShrink:0}}),(0,i.jsx)("span",{children:n})]}):n},enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f]}},_s={sort:function(e,t,n){return"asc"===n?e.localeCompare(t):t.localeCompare(e)},isValid:{elements:!0,custom:()=>null},Edit:"url",render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[m,v],validOperators:[d,f,S,V,k,m,v,p,h]}};function Cs(e,t){let n;return e?.required&&t?.required?n=t?.required?.message?t.required:void 0:e?.elements&&t?.elements?n=t.elements:t?.custom&&(n=t.custom),n}const{ValidatedCheckboxControl:js}=ne(r.privateApis);Math.pow(10,8);const Ss=6048e5,Vs=Symbol.for("constructDateFrom");function ks(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&Vs in e?e[Vs](t):e instanceof Date?new e.constructor(t):new Date(t)}function Is(e,t){return ks(t||e,e)}function Es(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+Is(e)));var t}const Ns={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Ms(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Fs={date:Ms({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Ms({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Ms({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Os={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function As(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}function Ps(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const s=a[0],l=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],o=Array.isArray(l)?function(e,t){for(let n=0;ne.test(s)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(l,e=>e.test(s));let u;return u=e.valueCallback?e.valueCallback(o):o,u=n.valueCallback?n.valueCallback(u):u,{value:u,rest:t.slice(s.length)}}}var Ls;const Ds={code:"en-US",formatDistance:(e,t,n)=>{let i;const r=Ns[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i},formatLong:Fs,formatRelative:(e,t,n,i)=>Os[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:As({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:As({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:As({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:As({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:As({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Ls={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(Ls.matchPattern);if(!n)return null;const i=n[0],r=e.match(Ls.parsePattern);if(!r)return null;let a=Ls.valueCallback?Ls.valueCallback(r[0]):r[0];return a=t.valueCallback?t.valueCallback(a):a,{value:a,rest:e.slice(i.length)}}),era:Ps({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Ps({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ps({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Ps({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Ps({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ts={};function Bs(){return Ts}function zs(e){const t=Is(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Hs(e,t){const n=Is(e,t?.in);return n.setHours(0,0,0,0),n}function Rs(e,t){const n=Is(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function $s(e,t){const n=Is(e,t?.in);return function(e,t,n){const[i,r]=function(e,...t){const n=ks.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}(n?.in,e,t),a=Hs(i),s=Hs(r),l=+a-zs(a),o=+s-zs(s);return Math.round((l-o)/864e5)}(n,Rs(n))+1}function Ws(e,t){const n=Bs(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=Is(e,t?.in),a=r.getDay(),s=(a=a.getTime()?i+1:n.getTime()>=l.getTime()?i:i-1}function Ks(e,t){const n=Is(e,t?.in),i=+qs(n)-+function(e,t){const n=Gs(e,t),i=ks(t?.in||e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),qs(i)}(n);return Math.round(i/Ss)+1}function Ys(e,t){const n=Is(e,t?.in),i=n.getFullYear(),r=Bs(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,s=ks(t?.in||e,0);s.setFullYear(i+1,0,a),s.setHours(0,0,0,0);const l=Ws(s,t),o=ks(t?.in||e,0);o.setFullYear(i,0,a),o.setHours(0,0,0,0);const u=Ws(o,t);return+n>=+l?i+1:+n>=+u?i:i-1}function Us(e,t){const n=Is(e,t?.in),i=+Ws(n,t)-+function(e,t){const n=Bs(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Ys(e,t),a=ks(t?.in||e,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),Ws(a,t)}(n,t);return Math.round(i/Ss)+1}function Zs(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const Xs={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Zs("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):Zs(n+1,2)},d:(e,t)=>Zs(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>Zs(e.getHours()%12||12,t.length),H:(e,t)=>Zs(e.getHours(),t.length),m:(e,t)=>Zs(e.getMinutes(),t.length),s:(e,t)=>Zs(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return Zs(Math.trunc(i*Math.pow(10,n-3)),t.length)}},Qs={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return Xs.y(e,t)},Y:function(e,t,n,i){const r=Ys(e,i),a=r>0?r:1-r;return"YY"===t?Zs(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Zs(a,t.length)},R:function(e,t){return Zs(Gs(e),t.length)},u:function(e,t){return Zs(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Zs(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Zs(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Xs.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Zs(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=Us(e,i);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):Zs(r,t.length)},I:function(e,t,n){const i=Ks(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):Zs(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):Xs.d(e,t)},D:function(e,t,n){const i=$s(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):Zs(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Zs(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Zs(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=0===i?7:i;switch(t){case"i":return String(r);case"ii":return Zs(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(r=12===i?"noon":0===i?"midnight":i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(r=i>=17?"evening":i>=12?"afternoon":i>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return Xs.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):Xs.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):Zs(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):Zs(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Xs.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Xs.s(e,t)},S:function(e,t){return Xs.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return el(i);case"XXXX":case"XX":return tl(i);default:return tl(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return el(i);case"xxxx":case"xx":return tl(i);default:return tl(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Js(i,":");default:return"GMT"+tl(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Js(i,":");default:return"GMT"+tl(i,":")}},t:function(e,t,n){return Zs(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return Zs(+e,t.length)}};function Js(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),a=i%60;return 0===a?n+String(r):n+String(r)+t+Zs(a,2)}function el(e,t){return e%60==0?(e>0?"-":"+")+Zs(Math.abs(e)/60,2):tl(e,t)}function tl(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+Zs(Math.trunc(i/60),2)+t+Zs(i%60,2)}const nl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},il=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},rl={p:il,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return nl(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",nl(i,t)).replace("{{time}}",il(r,t))}},al=/^D+$/,sl=/^Y+$/,ll=["D","DD","YY","YYYY"],ol=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ul=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cl=/^'([^]*?)'?$/,dl=/''/g,fl=/[a-zA-Z]/;function ml(e,t,n){const i=Bs(),r=n?.locale??i.locale??Ds,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,l=Is(e,n?.in);if(!Es(l))throw new RangeError("Invalid time value");let o=t.match(ul).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,rl[t])(e,r.formatLong):e}).join("").match(ol).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:vl(e)};if(Qs[t])return{isToken:!0,value:e};if(t.match(fl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(o=r.localize.preprocessor(l,o));const u={firstWeekContainsDate:a,weekStartsOn:s,locale:r};return o.map(i=>{if(!i.isToken)return i.value;const a=i.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return sl.test(e)}(a)||!n?.useAdditionalDayOfYearTokens&&function(e){return al.test(e)}(a))&&function(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),ll.includes(e))throw new RangeError(i)}(a,t,String(e)),(0,Qs[a[0]])(l,a,r.localize,u)}).join("")}function vl(e){const t=e.match(cl);return t?t[1].replace(dl,"'"):e}const pl={[M]:[{value:"days",label:(0,l.__)("Days")},{value:"weeks",label:(0,l.__)("Weeks")},{value:"months",label:(0,l.__)("Months")},{value:"years",label:(0,l.__)("Years")}],[F]:[{value:"days",label:(0,l.__)("Days ago")},{value:"weeks",label:(0,l.__)("Weeks ago")},{value:"months",label:(0,l.__)("Months ago")},{value:"years",label:(0,l.__)("Years ago")}]};function hl({className:e,data:t,field:n,onChange:s,hideLabelFromVision:o,operator:u}){const c=pl[u===M?"inThePast":"over"],{id:d,label:f,getValue:m,setValue:v}=n,p=m({item:t}),{value:h="",unit:g=c[0].value}=p&&"object"==typeof p?p:{},b=(0,a.useCallback)(e=>s(v({item:t,value:{value:Number(e),unit:g}})),[s,v,t,g]),x=(0,a.useCallback)(e=>s(v({item:t,value:{value:h,unit:e}})),[s,v,t,h]);return(0,i.jsx)(r.BaseControl,{id:d,__nextHasNoMarginBottom:!0,className:(0,U.A)(e,"dataviews-controls__relative-date"),label:f,hideLabelFromVision:o,children:(0,i.jsxs)(r.__experimentalHStack,{spacing:2.5,children:[(0,i.jsx)(r.__experimentalNumberControl,{__next40pxDefaultSize:!0,className:"dataviews-controls__relative-date-number",spinControls:"none",min:1,step:1,value:h,onChange:b}),(0,i.jsx)(r.SelectControl,{className:"dataviews-controls__relative-date-unit",__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,label:(0,l.__)("Unit"),value:g,options:c,onChange:x,hideLabelFromVision:!0})]})})}const{DateCalendar:gl,ValidatedInputControl:bl}=ne(r.privateApis),xl=e=>{if(!e)return null;const t=(0,Ha.getDate)(e);return t&&Es(t)?t:null};function wl({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:o}){const{id:u,label:c,description:d,setValue:f,getValue:m,isValid:v}=t,p=m({item:e}),h="string"==typeof p?p:void 0,[g,b]=(0,a.useState)(()=>xl(h)||new Date),x=(0,a.useRef)(null),w=(0,a.useRef)(),y=(0,a.useRef)(null),_=(0,a.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);(0,a.useEffect)(()=>()=>{w.current&&clearTimeout(w.current)},[]);const C=(0,a.useCallback)(e=>{let t;if(e){let n=e;if(h){const t=xl(h);t&&(n=new Date(e),n.setHours(t.getHours()),n.setMinutes(t.getMinutes()))}t=n.toISOString(),_(t),w.current&&clearTimeout(w.current)}else _(void 0);y.current=x.current&&x.current.ownerDocument.activeElement,w.current=setTimeout(()=>{x.current&&(x.current.focus(),x.current.blur(),_(t),y.current&&y.current instanceof HTMLElement&&y.current.focus())},0)},[_,h]),j=(0,a.useCallback)(e=>{if(e){const t=new Date(e);_(t.toISOString());const n=xl(t.toISOString());n&&b(n)}else _(void 0)},[_]),{timezone:{string:S},l10n:{startOfWeek:V}}=(0,Ha.getSettings)(),k=v?.required&&!s?`${c} (${(0,l.__)("Required")})`:c;return(0,i.jsx)(r.BaseControl,{__nextHasNoMarginBottom:!0,id:u,label:k,help:d,hideLabelFromVision:s,children:(0,i.jsxs)(r.__experimentalVStack,{spacing:4,children:[(0,i.jsx)(gl,{style:{width:"100%"},selected:h&&xl(h)||void 0,onSelect:C,month:g,onMonthChange:b,timeZone:S||void 0,weekStartsOn:V}),(0,i.jsx)(bl,{ref:x,__next40pxDefaultSize:!0,required:!!v?.required,customValidity:Cs(v,o),type:"datetime-local",label:(0,l.__)("Date time"),hideLabelFromVision:!0,value:h?(I=xl(h)||void 0,I?"string"==typeof I?I:ml(I,"yyyy-MM-dd'T'HH:mm"):""):"",onChange:j})]})});var I}function yl(e,t,n){return function(e,t,n){const i=Is(e,n?.in);return isNaN(t)?ks(n?.in||e,NaN):t?(i.setDate(i.getDate()+t),i):i}(e,-t,n)}function _l(e,t,n){const i=Is(e,n?.in);if(isNaN(t))return ks(n?.in||e,NaN);if(!t)return i;const r=i.getDate(),a=ks(n?.in||e,i.getTime());return a.setMonth(i.getMonth()+t+1,0),r>=a.getDate()?a:(i.setFullYear(a.getFullYear(),a.getMonth(),r),i)}function Cl(e,t){const n=Is(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function jl(e,t,n){return function(e,t,n){return _l(e,12*t,n)}(e,-t,n)}var Sl=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});const{DateCalendar:Vl,DateRangeCalendar:kl}=ne(r.privateApis),Il=[{id:"today",label:(0,l.__)("Today"),getValue:()=>(0,Ha.getDate)(null)},{id:"yesterday",label:(0,l.__)("Yesterday"),getValue:()=>yl((0,Ha.getDate)(null),1)},{id:"past-week",label:(0,l.__)("Past week"),getValue:()=>yl((0,Ha.getDate)(null),7)},{id:"past-month",label:(0,l.__)("Past month"),getValue:()=>{return _l((0,Ha.getDate)(null),-1,e);var e}}],El=[{id:"last-7-days",label:(0,l.__)("Last 7 days"),getValue:()=>{const e=(0,Ha.getDate)(null);return[yl(e,7),e]}},{id:"last-30-days",label:(0,l.__)("Last 30 days"),getValue:()=>{const e=(0,Ha.getDate)(null);return[yl(e,30),e]}},{id:"month-to-date",label:(0,l.__)("Month to date"),getValue:()=>{const e=(0,Ha.getDate)(null);return[Cl(e),e]}},{id:"last-year",label:(0,l.__)("Last year"),getValue:()=>{const e=(0,Ha.getDate)(null);return[jl(e,1),e]}},{id:"year-to-date",label:(0,l.__)("Year to date"),getValue:()=>{const e=(0,Ha.getDate)(null);return[Rs(e),e]}}],Nl=e=>{if(!e)return null;const t=(0,Ha.getDate)(e);return t&&Es(t)?t:null},Ml=e=>e?"string"==typeof e?e:ml(e,"yyyy-MM-dd"):"";function Fl({field:e,validity:t,inputRefs:n,isTouched:s,setIsTouched:l,children:o}){const{isValid:u}=e,[c,d]=(0,a.useState)(void 0),f=(0,a.useCallback)(()=>{const e=Array.isArray(n)?n:[n];for(const t of e){const e=t.current;if(e&&!e.validity.valid)return void d({type:"invalid",message:e.validationMessage})}d(void 0)},[n]);return(0,a.useEffect)(()=>{if(s){const e=setTimeout(()=>{t?d(Cs(u,t)):f()},0);return()=>clearTimeout(e)}},[s,u,t,f]),(0,i.jsxs)("div",{onBlur:e=>{s||e.relatedTarget&&e.currentTarget.contains(e.relatedTarget)||l(!0)},children:[o,(0,i.jsx)("div",{"aria-live":"polite",children:c&&(0,i.jsxs)("p",{className:(0,U.A)("components-validated-control__indicator","invalid"===c.type?"is-invalid":void 0,"valid"===c.type?"is-valid":void 0),children:[(0,i.jsx)(r.Icon,{className:"components-validated-control__indicator-icon",icon:Sl,size:16,fill:"currentColor"}),c.message]})})]})}function Ol({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:o}){const{id:u,label:c,setValue:d,getValue:f,isValid:m}=t,[v,p]=(0,a.useState)(null),h=f({item:e}),g="string"==typeof h?h:void 0,[b,x]=(0,a.useState)(()=>Nl(g)||new Date),[w,y]=(0,a.useState)(!1),_=(0,a.useRef)(null),C=(0,a.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]),j=(0,a.useCallback)(e=>{const t=e?ml(e,"yyyy-MM-dd"):void 0;C(t),p(null),y(!0)},[C]),S=(0,a.useCallback)(e=>{const t=e.getValue(),n=Ml(t);x(t),C(n),p(e.id),y(!0)},[C]),V=(0,a.useCallback)(e=>{if(C(e),e){const t=Nl(e);t&&x(t)}p(null),y(!0)},[C]),{timezone:{string:k},l10n:{startOfWeek:I}}=(0,Ha.getSettings)(),E=m?.required?`${c} (${(0,l.__)("Required")})`:c;return(0,i.jsx)(Fl,{field:t,validity:o,inputRefs:_,isTouched:w,setIsTouched:y,children:(0,i.jsx)(r.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:E,hideLabelFromVision:s,children:(0,i.jsxs)(r.__experimentalVStack,{spacing:4,children:[(0,i.jsxs)(r.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[Il.map(e=>{const t=v===e.id;return(0,i.jsx)(r.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>S(e),children:e.label},e.id)}),(0,i.jsx)(r.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!v,size:"small",disabled:!!v,accessibleWhenDisabled:!1,children:(0,l.__)("Custom")})]}),(0,i.jsx)(r.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:_,type:"date",label:(0,l.__)("Date"),hideLabelFromVision:!0,value:g,onChange:V,required:!!t.isValid?.required}),(0,i.jsx)(Vl,{style:{width:"100%"},selected:g&&Nl(g)||void 0,onSelect:j,month:b,onMonthChange:x,timeZone:k||void 0,weekStartsOn:I})]})})})}function Al({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:o}){const{id:u,label:c,getValue:d,setValue:f}=t;let m;const v=d({item:e});Array.isArray(v)&&2===v.length&&v.every(e=>"string"==typeof e)&&(m=v);const p=(0,a.useCallback)(t=>{n(f({item:e,value:t}))},[e,n,f]),[h,g]=(0,a.useState)(null),b=(0,a.useMemo)(()=>{if(!m)return{from:void 0,to:void 0};const[e,t]=m;return{from:Nl(e)||void 0,to:Nl(t)||void 0}},[m]),[x,w]=(0,a.useState)(()=>b.from||new Date),[y,_]=(0,a.useState)(!1),C=(0,a.useRef)(null),j=(0,a.useRef)(null),S=(0,a.useCallback)((e,t)=>{e&&t?p([Ml(e),Ml(t)]):e||t||p(void 0)},[p]),V=(0,a.useCallback)(e=>{S(e?.from,e?.to),g(null),_(!0)},[S]),k=(0,a.useCallback)(e=>{const[t,n]=e.getValue();w(t),S(t,n),g(e.id),_(!0)},[S]),I=(0,a.useCallback)((e,t)=>{const[n,i]=m||[void 0,void 0];if(S("from"===e?t:n,"to"===e?t:i),t){const e=Nl(t);e&&w(e)}g(null),_(!0)},[m,S]),{timezone:E,l10n:N}=(0,Ha.getSettings)(),M=t.isValid?.required?`${c} (${(0,l.__)("Required")})`:c;return(0,i.jsx)(Fl,{field:t,validity:o,inputRefs:[C,j],isTouched:y,setIsTouched:_,children:(0,i.jsx)(r.BaseControl,{__nextHasNoMarginBottom:!0,id:u,className:"dataviews-controls__date",label:M,hideLabelFromVision:s,children:(0,i.jsxs)(r.__experimentalVStack,{spacing:4,children:[(0,i.jsxs)(r.__experimentalHStack,{spacing:2,wrap:!0,justify:"flex-start",children:[El.map(e=>{const t=h===e.id;return(0,i.jsx)(r.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:t,size:"small",onClick:()=>k(e),children:e.label},e.id)}),(0,i.jsx)(r.Button,{className:"dataviews-controls__date-preset",variant:"tertiary",isPressed:!h,size:"small",accessibleWhenDisabled:!1,disabled:!!h,children:(0,l.__)("Custom")})]}),(0,i.jsxs)(r.__experimentalHStack,{spacing:2,children:[(0,i.jsx)(r.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:C,type:"date",label:(0,l.__)("From"),hideLabelFromVision:!0,value:m?.[0],onChange:e=>I("from",e),required:!!t.isValid?.required}),(0,i.jsx)(r.__experimentalInputControl,{__next40pxDefaultSize:!0,ref:j,type:"date",label:(0,l.__)("To"),hideLabelFromVision:!0,value:m?.[1],onChange:e=>I("to",e),required:!!t.isValid?.required})]}),(0,i.jsx)(kl,{style:{width:"100%"},selected:b,onSelect:V,month:x,onMonthChange:w,timeZone:E.string||void 0,weekStartsOn:N.startOfWeek})]})})})}var Pl=(0,i.jsx)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)(o.Path,{d:"M12.5939 21C14.1472 21 16.1269 20.5701 17.0711 20.1975L16.6447 18.879C16.0964 19.051 14.3299 19.6242 12.6548 19.6242C7.4467 19.6242 4.67513 16.8726 4.67513 12C4.67513 7.21338 7.50762 4.34713 12.2893 4.34713C17.132 4.34713 19.4162 7.55732 19.4162 10.7675C19.4162 14.035 19.0508 15.4968 17.4975 15.4968C16.5838 15.4968 16.0964 14.7803 16.0964 13.9777V7.5H14.4822V8.30255H14.3909C14.1777 7.67198 12.9898 7.12739 11.467 7.2707C9.18274 7.5 7.4467 9.27707 7.4467 11.8567C7.4467 14.5796 8.81726 16.672 11.467 16.758C13.203 16.8153 14.1168 16.0127 14.4822 15.1815H14.5736C14.7563 16.414 16.401 16.8439 17.467 16.8439C20.6954 16.8439 21 13.5764 21 10.7962C21 6.86943 18.0761 3 12.3807 3C6.50254 3 3 6.3535 3 11.9427C3 17.7325 6.38071 21 12.5939 21ZM11.7107 15.2962C9.73096 15.2962 9.03046 13.6051 9.03046 11.7707C9.03046 10.1083 10.0355 8.67516 11.7716 8.67516C13.599 8.67516 14.5736 9.36306 14.5736 11.7707C14.5736 14.1497 13.7513 15.2962 11.7107 15.2962Z"})});const{ValidatedInputControl:Ll}=ne(r.privateApis);function Dl({data:e,field:t,onChange:n,hideLabelFromVision:r,type:s,prefix:l,suffix:o,validity:u}){const{label:c,placeholder:d,description:f,getValue:m,setValue:v,isValid:p}=t,h=m({item:e}),g=(0,a.useCallback)(t=>n(v({item:e,value:t})),[e,v,n]);return(0,i.jsx)(Ll,{required:!!p?.required,customValidity:Cs(p,u),label:c,placeholder:d,value:h??"",help:f,onChange:g,hideLabelFromVision:r,type:s,prefix:l,suffix:o,__next40pxDefaultSize:!0})}var Tl=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"})}),Bl=(0,i.jsx)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(o.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})});const{ValidatedNumberControl:zl}=ne(r.privateApis);function Hl(e){if(""===e||void 0===e)return"";const t=Number(e);return Number.isFinite(t)?t:""}function Rl({value:e,onChange:t,hideLabelFromVision:n,step:s}){const[o="",u=""]=e,c=(0,a.useCallback)(e=>t([Hl(e),u]),[t,u]),d=(0,a.useCallback)(e=>t([o,Hl(e)]),[t,o]);return(0,i.jsx)(r.BaseControl,{__nextHasNoMarginBottom:!0,help:(0,l.__)("The max. value must be greater than the min. value."),children:(0,i.jsxs)(r.Flex,{direction:"row",gap:4,children:[(0,i.jsx)(r.__experimentalNumberControl,{label:(0,l.__)("Min."),value:o,max:u?Number(u)-s:void 0,onChange:c,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:s}),(0,i.jsx)(r.__experimentalNumberControl,{label:(0,l.__)("Max."),value:u,min:o?Number(o)+s:void 0,onChange:d,__next40pxDefaultSize:!0,hideLabelFromVision:n,step:s})]})})}function $l({data:e,field:t,onChange:n,hideLabelFromVision:r,operator:s,decimals:l,validity:o}){const u=Math.pow(10,-1*Math.abs(l)),{label:c,description:d,getValue:f,setValue:m,isValid:v}=t,p=f({item:e})??"",h=(0,a.useCallback)(t=>{n(m({item:e,value:["",void 0].includes(t)?void 0:Number(t)}))},[e,n,m]),g=(0,a.useCallback)(t=>{n(m({item:e,value:t}))},[e,n,m]);if(s===I){let e=["",""];return Array.isArray(p)&&2===p.length&&p.every(e=>"number"==typeof e||""===e)&&(e=p),(0,i.jsx)(Rl,{value:e,onChange:g,hideLabelFromVision:r,step:u})}return(0,i.jsx)(zl,{required:!!v?.required,customValidity:Cs(v,o),label:c,help:d,value:p,onChange:h,__next40pxDefaultSize:!0,hideLabelFromVision:r,step:u})}const{ValidatedRadioControl:Wl}=ne(r.privateApis),{ValidatedSelectControl:ql}=ne(r.privateApis),{ValidatedToggleControl:Gl}=ne(r.privateApis),{ValidatedTextareaControl:Kl}=ne(r.privateApis),{ValidatedToggleGroupControl:Yl}=ne(r.privateApis),{ValidatedFormTokenField:Ul}=ne(r.privateApis),{ValidatedInputControl:Zl,Picker:Xl}=ne(r.privateApis),Ql=({color:e,onColorChange:t})=>{const n=e&&ws(e).isValid()?e:"#ffffff";return(0,i.jsx)(r.Dropdown,{renderToggle:({onToggle:e,isOpen:t})=>(0,i.jsx)(r.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,i.jsx)("button",{type:"button",onClick:e,style:{width:"24px",height:"24px",borderRadius:"50%",backgroundColor:n,border:"1px solid #ddd",cursor:"pointer",outline:t?"2px solid #007cba":"none",outlineOffset:"2px",display:"flex",alignItems:"center",justifyContent:"center",padding:0,margin:0},"aria-label":"Open color picker"})}),renderContent:()=>(0,i.jsx)("div",{style:{padding:"16px"},children:(0,i.jsx)(Xl,{color:ws(n),onChange:t,enableAlpha:!0})})})};function Jl(e){return Array.isArray(e.elements)&&e.elements.length>0||"function"==typeof e.getElements}const eo={array:function({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:l}){const{label:o,placeholder:u,getValue:c,setValue:d,isValid:f}=t,m=c({item:e}),{elements:v,isLoading:p}=Pr({elements:t.elements,getElements:t.getElements}),h=(0,a.useMemo)(()=>Array.isArray(m)?m.map(e=>{const t=v?.find(t=>t.value===e);return t||{value:e,label:e}}):[],[m,v]),g=(0,a.useCallback)(t=>{const i=t.map(e=>"object"==typeof e&&"value"in e?e.value:e);n(d({item:e,value:i}))},[n,d,e]);return p?(0,i.jsx)(r.Spinner,{}):(0,i.jsx)(Ul,{required:!!f?.required,customValidity:Cs(f,l),label:s?void 0:o,value:h,onChange:g,placeholder:u,suggestions:v?.map(e=>e.value),__experimentalValidateInput:e=>!t.isValid?.elements||!v||v.some(t=>t.value===e||t.label===e),__experimentalExpandOnFocus:v&&v.length>0,__experimentalShowHowTo:!t.isValid?.elements,displayTransform:e=>{if("object"==typeof e&&"label"in e)return e.label;if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return t?.label||e}return e},__experimentalRenderItem:({item:e})=>{if("string"==typeof e&&v){const t=v.find(t=>t.value===e);return(0,i.jsx)("span",{children:t?.label||e})}return(0,i.jsx)("span",{children:e})}})},checkbox:function({field:e,onChange:t,data:n,hideLabelFromVision:r,validity:s}){const{getValue:l,setValue:o,label:u,description:c,isValid:d}=e,f=(0,a.useCallback)(()=>{t(o({item:n,value:!l({item:n})}))},[n,l,t,o]);return(0,i.jsx)(js,{required:!!e.isValid?.required,customValidity:Cs(d,s),hidden:r,label:u,help:c,checked:l({item:n}),onChange:f})},color:function({data:e,field:t,onChange:n,hideLabelFromVision:r,validity:s}){const{label:l,placeholder:o,description:u,setValue:c,isValid:d}=t,f=t.getValue({item:e})||"",m=(0,a.useCallback)(t=>{n(c({item:e,value:t.toHex()}))},[e,n,c]),v=(0,a.useCallback)(t=>{n(c({item:e,value:t||""}))},[e,n,c]);return(0,i.jsx)(Zl,{required:!!t.isValid?.required,customValidity:Cs(d,s),label:l,placeholder:o,value:f,help:u,onChange:v,hideLabelFromVision:r,type:"text",prefix:(0,i.jsx)(Ql,{color:f,onColorChange:m})})},datetime:function({data:e,field:t,onChange:n,hideLabelFromVision:r,operator:a,validity:s}){return a===M||a===F?(0,i.jsx)(hl,{className:"dataviews-controls__datetime",data:e,field:t,onChange:n,hideLabelFromVision:r,operator:a}):(0,i.jsx)(wl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:s})},date:function({data:e,field:t,onChange:n,hideLabelFromVision:r,operator:a,validity:s}){return a===M||a===F?(0,i.jsx)(hl,{className:"dataviews-controls__date",data:e,field:t,onChange:n,hideLabelFromVision:r,operator:a}):a===I?(0,i.jsx)(Al,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:s}):(0,i.jsx)(Ol,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:s})},email:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){return(0,i.jsx)(Dl,{data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s,type:"email",prefix:(0,i.jsx)(r.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,i.jsx)(r.Icon,{icon:Pl})})})},telephone:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){return(0,i.jsx)(Dl,{data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s,type:"tel",prefix:(0,i.jsx)(r.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,i.jsx)(r.Icon,{icon:Tl})})})},url:function({data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s}){return(0,i.jsx)(Dl,{data:e,field:t,onChange:n,hideLabelFromVision:a,validity:s,type:"url",prefix:(0,i.jsx)(r.__experimentalInputControlPrefixWrapper,{variant:"icon",children:(0,i.jsx)(r.Icon,{icon:Bl})})})},integer:function(e){return(0,i.jsx)($l,{...e,decimals:0})},number:function(e){return(0,i.jsx)($l,{...e,decimals:2})},password:function({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:o}){const[u,c]=(0,a.useState)(!1),d=(0,a.useCallback)(()=>{c(e=>!e)},[]);return(0,i.jsx)(Dl,{data:e,field:t,onChange:n,hideLabelFromVision:s,validity:o,type:u?"text":"password",suffix:(0,i.jsx)(r.__experimentalInputControlSuffixWrapper,{variant:"control",children:(0,i.jsx)(r.Button,{icon:u?Ve:va,onClick:d,size:"small",label:u?(0,l.__)("Hide password"):(0,l.__)("Show password")})})})},radio:function({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:l}){const{label:o,description:u,getValue:c,setValue:d,isValid:f}=t,{elements:m,isLoading:v}=Pr({elements:t.elements,getElements:t.getElements}),p=c({item:e}),h=(0,a.useCallback)(t=>n(d({item:e,value:t})),[e,n,d]);return v?(0,i.jsx)(r.Spinner,{}):(0,i.jsx)(Wl,{required:!!t.isValid?.required,customValidity:Cs(f,l),label:o,help:u,onChange:h,options:m,selected:p,hideLabelFromVision:s})},select:function({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:l}){const{type:o,label:u,description:c,getValue:d,setValue:f,isValid:m}=t,v="array"===o,p=d({item:e})??(v?[]:""),h=(0,a.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]),{elements:g,isLoading:b}=Pr({elements:t.elements,getElements:t.getElements});return b?(0,i.jsx)(r.Spinner,{}):(0,i.jsx)(ql,{required:!!t.isValid?.required,customValidity:Cs(m,l),label:u,value:p,help:c,options:g,onChange:h,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:s,multiple:v})},text:function({data:e,field:t,onChange:n,hideLabelFromVision:r,config:s,validity:l}){const{prefix:o,suffix:u}=s||{};return(0,i.jsx)(Dl,{data:e,field:t,onChange:n,hideLabelFromVision:r,validity:l,prefix:o?(0,a.createElement)(o):void 0,suffix:u?(0,a.createElement)(u):void 0})},toggle:function({field:e,onChange:t,data:n,hideLabelFromVision:r,validity:s}){const{label:l,description:o,getValue:u,setValue:c,isValid:d}=e,f=(0,a.useCallback)(()=>{t(c({item:n,value:!u({item:n})}))},[t,c,n,u]);return(0,i.jsx)(Gl,{required:!!d.required,customValidity:Cs(d,s),hidden:r,__nextHasNoMarginBottom:!0,label:l,help:o,checked:u({item:n}),onChange:f})},textarea:function({data:e,field:t,onChange:n,hideLabelFromVision:r,config:s,validity:l}){const{rows:o=4}=s||{},{label:u,placeholder:c,description:d,setValue:f,isValid:m}=t,v=t.getValue({item:e}),p=(0,a.useCallback)(t=>n(f({item:e,value:t})),[e,n,f]);return(0,i.jsx)(Kl,{required:!!m?.required,customValidity:Cs(m,l),label:u,placeholder:c,value:v??"",help:d,onChange:p,rows:o,__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,hideLabelFromVision:r})},toggleGroup:function({data:e,field:t,onChange:n,hideLabelFromVision:s,validity:l}){const{getValue:o,setValue:u,isValid:c}=t,d=o({item:e}),f=(0,a.useCallback)(t=>n(u({item:e,value:t})),[e,n,u]),{elements:m,isLoading:v}=Pr({elements:t.elements,getElements:t.getElements});if(v)return(0,i.jsx)(r.Spinner,{});if(0===m.length)return null;const p=m.find(e=>e.value===d);return(0,i.jsx)(Yl,{required:!!t.isValid?.required,customValidity:Cs(c,l),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,isBlock:!0,label:t.label,help:p?.description||t.description,onChange:f,value:d,hideLabelFromVision:s,children:m.map(e=>(0,i.jsx)(r.__experimentalToggleGroupControlOption,{label:e.label,value:e.value},e.value))})}};function to(e){return e&&"object"==typeof e&&"string"==typeof e.control}function no(e){const{control:t,...n}=e,r=io(t);return function(e){return(0,i.jsx)(r,{...e,config:n})}}function io(e){if(Object.keys(eo).includes(e))return eo[e];throw"Control "+e+" not found"}const ro=e=>e.id,ao=()=>!0,so=[],lo=Ze.filter(e=>!e.isPicker);function oo({header:e,search:t=!0,searchLabel:n}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r.__experimentalHStack,{alignment:"top",justify:"space-between",className:"dataviews__view-actions",spacing:1,children:[(0,i.jsxs)(r.__experimentalHStack,{justify:"start",expanded:!1,className:"dataviews__search",children:[t&&(0,i.jsx)(ca,{label:n}),(0,i.jsx)(tt,{})]}),(0,i.jsxs)(r.__experimentalHStack,{spacing:1,expanded:!1,style:{flexShrink:0},children:[(0,i.jsx)(Oa,{}),e]})]}),(0,i.jsx)(ta,{className:"dataviews-filters__container"}),(0,i.jsx)(na,{}),(0,i.jsx)(oa,{})]})}const uo=function({view:e,onChangeView:t,fields:n,search:r=!0,searchLabel:l,actions:o=so,data:u,getItemId:c=ro,getItemLevel:m,isLoading:v=!1,paginationInfo:p,defaultLayouts:h,selection:g,onChangeSelection:b,onClickItem:x,renderItemLink:w,isItemClickable:y=ao,header:_,children:C,config:j={perPageSizes:[10,20,50,100]},empty:S}){const{infiniteScrollHandler:V}=p,k=(0,a.useRef)(null),[E,N]=(0,a.useState)(0),M=(0,s.useResizeObserver)(e=>{N(e[0].borderBoxSize[0].inlineSize)},{box:"border-box"}),[F,P]=(0,a.useState)([]),L=void 0===g||void 0===b,D=L?F:g,[T,B]=(0,a.useState)(null),z=(0,a.useMemo)(()=>function(e){return e.map(e=>{const t="email"===(n=e.type)?La:"integer"===n?Da:"number"===n?Ta:"text"===n?Ba:"datetime"===n?za:"date"===n?Ra:"boolean"===n?$a:"media"===n?Wa:"array"===n?Ga:"password"===n?Ka:"telephone"===n?Ya:"color"===n?ys:"url"===n?_s:{sort:(e,t,n)=>"number"==typeof e&&"number"==typeof t?"asc"===n?e-t:t-e:"asc"===n?e.localeCompare(t):t.localeCompare(e),isValid:{elements:!0,custom:()=>null},Edit:null,render:({item:e,field:t})=>t.hasElements?(0,i.jsx)(Aa,{item:e,field:t}):t.getValue({item:e}),enableSorting:!0,filterBy:{defaultOperators:[d,f],validOperators:O}};var n;const r=e.getValue||(a=e.id,({item:e})=>{const t=a.split(".");let n=e;for(const e of t)n=n.hasOwnProperty(e)?n[e]:void 0;return n});var a;const s=e.setValue||(e=>({value:t})=>{const n=e.split("."),i={};let r=i;for(const e of n.slice(0,-1))r[e]={},r=r[e];return r[n.at(-1)]=t,i})(e.id),l=e.sort??function(e,n,i){return t.sort(r({item:e}),r({item:n}),i)},o={...t.isValid,...e.isValid},u=function(e,t){return"function"==typeof e.Edit?e.Edit:"string"==typeof e.Edit?io(e.Edit):to(e.Edit)?no(e.Edit):Jl(e)&&"array"!==e.type?io("select"):"string"==typeof t.Edit?io(t.Edit):to(t.Edit)?no(t.Edit):t.Edit}(e,t),c=e.render??function({item:e,field:n}){return t.render({item:e,field:n})},m=function(e,t){if(!1===e.filterBy)return!1;if("object"==typeof e.filterBy){let n=e.filterBy.operators;n&&Array.isArray(n)||(n=t.filterBy?t.filterBy.defaultOperators:[]);let i=O;return"object"==typeof t.filterBy&&(i=t.filterBy.validOperators),n=n.filter(e=>i.includes(e)),Jl(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),n.some(e=>A.includes(e))&&(n=n.filter(e=>[...A,I].includes(e))),0!==n.length&&{isPrimary:!!e.filterBy.isPrimary,operators:n}}if(!1===t.filterBy)return!1;let n=t.filterBy.defaultOperators;return Jl(e)&&n.includes(I)&&(n=n.filter(e=>e!==I)),{operators:n}}(e,t);return{...e,label:e.label||e.id,header:e.header||e.label||e.id,getValue:r,setValue:s,render:c,sort:l,isValid:o,Edit:u,hasElements:Jl(e),enableHiding:e.enableHiding??!0,enableSorting:e.enableSorting??t.enableSorting??!0,filterBy:m,readOnly:e.readOnly??t.readOnly??!1}})}(n),[n]),H=(0,a.useMemo)(()=>D.filter(e=>u.some(t=>c(t)===e)),[D,u,c]),R=Jr(z,e),$=(0,a.useMemo)(()=>(R||[]).some(e=>e.isPrimary||e.isLocked),[R]),[q,G]=(0,a.useState)($);(0,a.useEffect)(()=>{$&&!q&&G(!0)},[$,q]),(0,a.useEffect)(()=>{if(!e.infiniteScrollEnabled||!k.current)return;const t=(0,s.throttle)(e=>{const t=e.target,n=t.scrollTop,i=t.scrollHeight;n+t.clientHeight>=i-100&&V?.()},100),n=k.current;return n.addEventListener("scroll",t),()=>{n.removeEventListener("scroll",t),t.cancel()}},[V,e.infiniteScrollEnabled]);const K=(0,a.useMemo)(()=>Object.fromEntries(Object.entries(h).filter(([e])=>lo.some(t=>t.type===e))),[h]);return K[e.type]?(0,i.jsx)(W.Provider,{value:{view:e,onChangeView:t,fields:z,actions:o,data:u,isLoading:v,paginationInfo:p,selection:H,onChangeSelection:function(e){const t="function"==typeof e?e(D):e;L&&P(t),b&&b(t)},openedFilter:T,setOpenedFilter:B,getItemId:c,getItemLevel:m,isItemClickable:y,onClickItem:x,renderItemLink:w,containerWidth:E,containerRef:k,resizeObserverRef:M,defaultLayouts:K,filters:R,isShowingFilter:q,setIsShowingFilter:G,config:j,empty:S,hasInfiniteScrollHandler:!!V},children:(0,i.jsx)("div",{className:"dataviews-wrapper",ref:k,children:C??(0,i.jsx)(oo,{header:_,search:r,searchLabel:l})})}):null};uo.BulkActionToolbar=_e,uo.Filters=ea,uo.FiltersToggled=ta,uo.FiltersToggle=tt,uo.Layout=na,uo.LayoutSwitcher=ya,uo.Pagination=aa,uo.Search=ca,uo.ViewConfig=Ma,uo.Footer=oa;var co=uo},644:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24",children:(0,i.jsx)(r.Path,{d:"M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z"})})},655:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})})},711:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{d:"M18.5 5.5V8H20V5.5h2.5V4H20V1.5h-1.5V4H16v1.5h2.5zM12 4H6a2 2 0 00-2 2v12a2 2 0 002 2h12a2 2 0 002-2v-6h-1.5v6a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5h6V4z"})})},731:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},n=Object.keys(t).join("|"),i=new RegExp(n,"g"),r=new RegExp(n,"");function a(e){return t[e]}var s=function(e){return e.replace(i,a)};e.exports=s,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=s},864:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{d:"M15.5 9.5a1 1 0 100-2 1 1 0 000 2zm0 1.5a2.5 2.5 0 100-5 2.5 2.5 0 000 5zm-2.25 6v-2a2.75 2.75 0 00-2.75-2.75h-4A2.75 2.75 0 003.75 15v2h1.5v-2c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v2h1.5zm7-2v2h-1.5v-2c0-.69-.56-1.25-1.25-1.25H15v-1.5h2.5A2.75 2.75 0 0120.25 15zM9.5 8.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0z",fillRule:"evenodd"})})},888:(e,t,n)=>{"use strict";e.exports=n(493)},988:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var i=n(790),r=n(573),a=(0,i.jsx)(r.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,i.jsx)(r.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})})}}]); \ No newline at end of file diff --git a/includes/class-post-types.php b/includes/class-post-types.php index 64f7af9d9..745f02399 100644 --- a/includes/class-post-types.php +++ b/includes/class-post-types.php @@ -10,6 +10,7 @@ use Activitypub\Activity\Activity; use Activitypub\Collection\Extra_Fields; use Activitypub\Collection\Followers; +use Activitypub\Collection\Following; use Activitypub\Collection\Inbox; use Activitypub\Collection\Outbox; use Activitypub\Collection\Posts; @@ -61,7 +62,7 @@ public static function register_remote_actors_post_type() { 'query_var' => false, 'delete_with_user' => false, 'can_export' => true, - 'supports' => array(), + 'supports' => array( 'custom-fields' ), ) ); @@ -92,6 +93,7 @@ public static function register_remote_actors_post_type() { array( 'type' => 'string', 'single' => false, + 'show_in_rest' => true, 'sanitize_callback' => 'sanitize_text_field', ) ); @@ -572,6 +574,81 @@ public static function register_ap_actor_rest_field() { ), ) ); + + // Add formatted actor data field. + \register_rest_field( + Remote_Actors::POST_TYPE, + 'actor_info', + array( + 'get_callback' => function ( $response ) { + $actor = Remote_Actors::get_actor( $response['id'] ); + if ( \is_wp_error( $actor ) ) { + return null; + } + return array( + 'username' => $actor->get_preferred_username(), + 'name' => $actor->get_name() ?? $actor->get_preferred_username(), + 'icon' => object_to_uri( $actor->get_icon() ), + 'url' => object_to_uri( $actor->get_url() ?? $actor->get_id() ), + 'webfinger' => Remote_Actors::get_acct( $response['id'] ), + 'identifier' => $actor->get_id(), + ); + }, + 'schema' => array( + 'description' => 'Parsed ActivityPub actor information', + 'type' => 'object', + 'context' => array( 'view', 'edit' ), + ), + ) + ); + + // Add follow status field. + \register_rest_field( + Remote_Actors::POST_TYPE, + 'follow_status', + array( + 'get_callback' => function ( $response ) { + $current_user_id = \get_current_user_id(); + if ( ! $current_user_id ) { + return array( 'follows_back' => false ); + } + return array( + 'follows_back' => Following::check_status( $current_user_id, $response['id'] ), + ); + }, + 'schema' => array( + 'description' => 'Follow relationship status', + 'type' => 'object', + 'context' => array( 'view', 'edit' ), + ), + ) + ); + + // Add custom query parameter for filtering by follower relationships. + \add_filter( 'rest_ap_actor_query', array( self::class, 'filter_ap_actor_query_by_follower' ), 10, 2 ); + } + + /** + * Filter WP_Query args to support follower_of parameter. + * + * @param array $args Array of arguments for WP_Query. + * @param \WP_REST_Request $request The REST API request. + * @return array Modified query arguments. + */ + public static function filter_ap_actor_query_by_follower( $args, $request ) { + if ( ! empty( $request['follower_of'] ) ) { + // Add meta_query to filter by _activitypub_following. + if ( ! isset( $args['meta_query'] ) ) { + $args['meta_query'] = array(); // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + } + + $args['meta_query'][] = array( + 'key' => Followers::FOLLOWER_META_KEY, + 'value' => $request['follower_of'], + ); + } + + return $args; } /** diff --git a/includes/rest/admin/class-actions-controller.php b/includes/rest/admin/class-actions-controller.php new file mode 100644 index 000000000..e5b6ac34f --- /dev/null +++ b/includes/rest/admin/class-actions-controller.php @@ -0,0 +1,250 @@ +namespace, + '/' . $this->rest_base . '/(?P[\d]+)/unfollow', + array( + 'args' => array( + 'id' => array( + 'description' => 'The ID of the actor.', + 'type' => 'integer', + 'required' => true, + 'validate_callback' => array( $this, 'validate_actor_id' ), + ), + ), + array( + 'methods' => \WP_REST_Server::DELETABLE, + 'callback' => array( $this, 'unfollow_actor' ), + 'permission_callback' => array( $this, 'check_permission' ), + ), + ) + ); + + // Block actor. + \register_rest_route( + $this->namespace, + '/' . $this->rest_base . '/(?P[\d]+)/block', + array( + 'args' => array( + 'id' => array( + 'description' => 'The ID of the actor.', + 'type' => 'integer', + 'required' => true, + 'validate_callback' => array( $this, 'validate_actor_id' ), + ), + ), + array( + 'methods' => \WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'block_actor' ), + 'permission_callback' => array( $this, 'check_permission' ), + 'args' => array( + 'site_wide' => array( + 'description' => 'Whether to block site-wide (admin only).', + 'type' => 'boolean', + 'default' => false, + ), + ), + ), + ) + ); + + // Follow actor. + \register_rest_route( + $this->namespace, + '/' . $this->rest_base . '/(?P[\d]+)/follow', + array( + 'args' => array( + 'id' => array( + 'description' => 'The ID of the actor.', + 'type' => 'integer', + 'required' => true, + 'validate_callback' => array( $this, 'validate_actor_id' ), + ), + ), + array( + 'methods' => \WP_REST_Server::CREATABLE, + 'callback' => array( $this, 'follow_actor' ), + 'permission_callback' => array( $this, 'check_permission' ), + ), + ) + ); + } + + /** + * Check if the current user has permission to perform actions. + * + * @return bool|\WP_Error True if the request has permission, WP_Error object otherwise. + */ + public function check_permission() { + if ( ! user_can_activitypub( \get_current_user_id() ) ) { + return new \WP_Error( + 'rest_forbidden', + \__( 'Sorry, you are not allowed to perform this action.', 'activitypub' ), + array( 'status' => 403 ) + ); + } + + return true; + } + + /** + * Validate actor ID. + * + * @param int $value The actor ID. + * @return bool True if valid, false otherwise. + */ + public function validate_actor_id( $value ) { + $actor = \get_post( $value ); + + return $actor instanceof \WP_Post && Remote_Actors::POST_TYPE === $actor->post_type; + } + + /** + * Remove follower relationship. + * + * @param \WP_REST_Request $request Full data about the request. + * @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure. + */ + public function unfollow_actor( $request ) { + $actor_id = $request->get_param( 'id' ); + $user_id = \get_current_user_id(); + + $result = Followers::remove( $actor_id, $user_id ); + + if ( ! $result ) { + return new \WP_Error( + 'rest_follower_removal_failed', + \__( 'Failed to remove follower.', 'activitypub' ), + array( 'status' => 500 ) + ); + } + + return new \WP_REST_Response( + array( + 'success' => true, + 'message' => \__( 'Follower removed successfully.', 'activitypub' ), + ), + 200 + ); + } + + /** + * Block an actor. + * + * @param \WP_REST_Request $request Full data about the request. + * @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure. + */ + public function block_actor( $request ) { + $actor_id = $request->get_param( 'id' ); + $site_wide = $request->get_param( 'site_wide' ); + $user_id = \get_current_user_id(); + + $actor = Remote_Actors::get_actor( $actor_id ); + if ( \is_wp_error( $actor ) ) { + return $actor; + } + + $actor_url = $actor->get_id(); + + // Add user-specific block. + $user_block_success = Moderation::add_user_block( $user_id, 'actor', $actor_url ); + + // Add site-wide block if requested and user has permission. + $site_block_success = true; + if ( $site_wide && \current_user_can( 'manage_options' ) ) { + $site_block_success = Moderation::add_site_block( 'actor', $actor_url ); + } + + if ( ! $user_block_success || ! $site_block_success ) { + return new \WP_Error( + 'rest_actor_block_failed', + \__( 'Failed to block actor.', 'activitypub' ), + array( 'status' => 500 ) + ); + } + + // Remove follower relationship after blocking. + Followers::remove( $actor_id, $user_id ); + + return new \WP_REST_Response( + array( + 'success' => true, + 'message' => \__( 'Actor blocked successfully.', 'activitypub' ), + ), + 200 + ); + } + + /** + * Follow an actor. + * + * @param \WP_REST_Request $request Full data about the request. + * @return \WP_REST_Response|\WP_Error Response object on success, or WP_Error object on failure. + */ + public function follow_actor( $request ) { + // Check if following UI is enabled. + if ( '1' !== \get_option( 'activitypub_following_ui', '0' ) ) { + return new \WP_Error( + 'rest_following_disabled', + \__( 'Following feature is disabled.', 'activitypub' ), + array( 'status' => 403 ) + ); + } + + $actor_id = $request->get_param( 'id' ); + $user_id = \get_current_user_id(); + + $result = Following::follow( $actor_id, $user_id ); + + if ( \is_wp_error( $result ) ) { + return $result; + } + + return new \WP_REST_Response( + array( + 'success' => true, + 'message' => \__( 'Actor followed successfully.', 'activitypub' ), + ), + 200 + ); + } +} diff --git a/includes/wp-admin/class-menu.php b/includes/wp-admin/class-menu.php index dabec07ce..68cf10132 100644 --- a/includes/wp-admin/class-menu.php +++ b/includes/wp-admin/class-menu.php @@ -33,6 +33,19 @@ public static function admin_menu() { // User has to be able to publish posts. if ( user_can_activitypub( \get_current_user_id() ) ) { + $capability = ACTIVITYPUB_BLOG_MODE === \get_option( 'activitypub_actor_mode' ) ? 'manage_options' : 'activitypub'; + + $social_web_hook = \add_dashboard_page( + \__( 'Social Web', 'activitypub' ), + \__( 'Social Web', 'activitypub' ), + $capability, + 'activitypub-social-web', + array( Social_Web::class, 'render_page' ) + ); + + \add_action( 'load-' . $social_web_hook, array( Social_Web::class, 'remove_admin_notices' ) ); + \add_action( 'admin_print_scripts-' . $social_web_hook, array( Social_Web::class, 'enqueue_scripts' ) ); + $followers_list_page = \add_users_page( \__( 'Followers ⁂', 'activitypub' ), \__( 'Followers ⁂', 'activitypub' ), diff --git a/includes/wp-admin/class-social-web.php b/includes/wp-admin/class-social-web.php new file mode 100644 index 000000000..45e5d8109 --- /dev/null +++ b/includes/wp-admin/class-social-web.php @@ -0,0 +1,110 @@ + \site_url(), + 'siteTitle' => \get_bloginfo( 'name' ), + 'adminUrl' => \admin_url(), + 'restUrl' => \rest_url(), + 'nonce' => \wp_create_nonce( 'wp_rest' ), + 'namespace' => ACTIVITYPUB_REST_NAMESPACE, + 'defaultAvatar' => \plugins_url( 'assets/img/mp.jpg', ACTIVITYPUB_PLUGIN_FILE ), + ) + ) + ) + ); + } + + /** + * Render the Social Web admin page. + */ + public static function render_page() { + ?> +
+ =6.9.0" @@ -418,9 +434,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", - "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz", + "integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==", "dev": true, "license": "MIT", "engines": { @@ -467,13 +483,13 @@ } }, "node_modules/@babel/parser": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.4.tgz", - "integrity": "sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.5.tgz", + "integrity": "sha512-KKBU1VGYR7ORr3At5HAtUQ+TV3SzRCXmA/8OdDZiLDBIZxVyzXuztPjfLd3BV1PRAQGCMWWSHYhL0F8d5uHBDQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.28.4" + "@babel/types": "^7.28.5" }, "bin": { "parser": "bin/babel-parser.js" @@ -483,14 +499,14 @@ } }, "node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.27.1.tgz", - "integrity": "sha512-QPG3C9cCVRQLxAVwmefEmwdTanECuUBMQZ/ym5kiw3XKCGA7qkuQLcjWWHcrD/GKbn/WmJwaezfuuAOcyKlRPA==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-firefox-class-in-computed-class-key/-/plugin-bugfix-firefox-class-in-computed-class-key-7.28.5.tgz", + "integrity": "sha512-87GDMS3tsmMSi/3bWOte1UblL+YUTFMV8SZPZ2eSEL17s74Cw/l63rR6NmGVKMYW2GYi85nE+/d6Hw5N0bEk2Q==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", - "@babel/traverse": "^7.27.1" + "@babel/traverse": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -920,9 +936,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.28.4.tgz", - "integrity": "sha512-1yxmvN0MJHOhPVmAsmoW5liWwoILobu/d/ShymZmj867bAdxGbehIrew1DuLpw2Ukv+qDSSPQdYW1dLNE7t11A==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.28.5.tgz", + "integrity": "sha512-45DmULpySVvmq9Pj3X9B+62Xe+DJGov27QravQJU1LLcapR6/10i+gYVAucGGJpHBp5mYxIMK4nDAT/QDLr47g==", "dev": true, "license": "MIT", "dependencies": { @@ -1008,14 +1024,14 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.28.0.tgz", - "integrity": "sha512-v1nrSMBiKcodhsyJ4Gf+Z0U/yawmJDBOTpEB3mcQY52r9RIyPneGyAS/yM6seP/8I+mWI3elOMtT5dB8GJVs+A==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.28.5.tgz", + "integrity": "sha512-Kl9Bc6D0zTUcFUvkNuQh4eGXPKKNDOJQXVyyM4ZAQPMveniJdxi8XMJwLo+xSoW3MIq81bD33lcUe9kZpl0MCw==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", - "@babel/traverse": "^7.28.0" + "@babel/traverse": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -1108,9 +1124,9 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.27.1.tgz", - "integrity": "sha512-uspvXnhHvGKf2r4VVtBpeFnuDWsJLQ6MF6lGJLC89jBR1uoVeqM416AZtTuhTezOfgHicpJQmoD5YUakO/YmXQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.28.5.tgz", + "integrity": "sha512-D4WIMaFtwa2NizOp+dnoFjRez/ClKiC2BqqImwKd1X28nqBtZEyCYJ2ozQrrzlxAFrcrjxo39S6khe9RNDlGzw==", "dev": true, "license": "MIT", "dependencies": { @@ -1207,9 +1223,9 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.27.1.tgz", - "integrity": "sha512-SJvDs5dXxiae4FbSL1aBJlG4wvl594N6YEVVn9e3JGulwioy6z3oPjx/sQBO3Y4NwUu5HNix6KJ3wBZoewcdbw==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.28.5.tgz", + "integrity": "sha512-axUuqnUTBuXyHGcJEVVh9pORaN6wC5bYfE7FGzPiaWa3syib9m7g+/IT/4VgCOe2Upef43PHzeAvcrVek6QuuA==", "dev": true, "license": "MIT", "dependencies": { @@ -1273,16 +1289,16 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.27.1.tgz", - "integrity": "sha512-w5N1XzsRbc0PQStASMksmUeqECuzKuTJer7kFagK8AXgpCMkeDMO5S+aaFb7A51ZYDF7XI34qsTX+fkHiIm5yA==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.28.5.tgz", + "integrity": "sha512-vn5Jma98LCOeBy/KpeQhXcV2WZgaRUtjwQmjoBuLNlOmkg0fB5pdvYVeWRYI69wWKwK2cD1QbMiUQnoujWvrew==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.27.1", + "@babel/helper-module-transforms": "^7.28.3", "@babel/helper-plugin-utils": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1", - "@babel/traverse": "^7.27.1" + "@babel/helper-validator-identifier": "^7.28.5", + "@babel/traverse": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -1427,9 +1443,9 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.27.1.tgz", - "integrity": "sha512-BQmKPPIuc8EkZgNKsv0X4bPmOoayeu4F1YCwx2/CfmDSXDbp7GnzlUH+/ul5VGfRg1AoFPsrIThlEBj2xb4CAg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.28.5.tgz", + "integrity": "sha512-N6fut9IZlPnjPwgiQkXNhb+cT8wQKFlJNqcZkWlcTqkcqx6/kU4ynGmLFoa4LViBSirn05YAwk+sQBbPfxtYzQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1761,14 +1777,14 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.28.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.0.tgz", - "integrity": "sha512-4AEiDEBPIZvLQaWlc9liCavE0xRM0dNca41WtBeM3jgFptfUOSG9z0uteLhq6+3rq+WB6jIvUwKDTpXEHPJ2Vg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.28.5.tgz", + "integrity": "sha512-x2Qa+v/CuEoX7Dr31iAfr0IhInrVOWZU/2vJMJ00FOR/2nM0BcBEclpaf9sWCDc+v5e9dMrhSH8/atq/kX7+bA==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.27.3", - "@babel/helper-create-class-features-plugin": "^7.27.1", + "@babel/helper-create-class-features-plugin": "^7.28.5", "@babel/helper-plugin-utils": "^7.27.1", "@babel/helper-skip-transparent-expression-wrappers": "^7.27.1", "@babel/plugin-syntax-typescript": "^7.27.1" @@ -1848,17 +1864,17 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.28.3", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.28.3.tgz", - "integrity": "sha512-ROiDcM+GbYVPYBOeCR6uBXKkQpBExLl8k9HO1ygXEyds39j+vCCsjmj7S8GOniZQlEs81QlkdJZe76IpLSiqpg==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.28.5.tgz", + "integrity": "sha512-S36mOoi1Sb6Fz98fBfE+UZSpYw5mJm0NUHtIKrOuNcqeFauy1J6dIvXm2KRVKobOSaGq4t/hBXdN4HGU3wL9Wg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.28.0", + "@babel/compat-data": "^7.28.5", "@babel/helper-compilation-targets": "^7.27.2", "@babel/helper-plugin-utils": "^7.27.1", "@babel/helper-validator-option": "^7.27.1", - "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.27.1", + "@babel/plugin-bugfix-firefox-class-in-computed-class-key": "^7.28.5", "@babel/plugin-bugfix-safari-class-field-initializer-scope": "^7.27.1", "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.27.1", "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.27.1", @@ -1871,42 +1887,42 @@ "@babel/plugin-transform-async-generator-functions": "^7.28.0", "@babel/plugin-transform-async-to-generator": "^7.27.1", "@babel/plugin-transform-block-scoped-functions": "^7.27.1", - "@babel/plugin-transform-block-scoping": "^7.28.0", + "@babel/plugin-transform-block-scoping": "^7.28.5", "@babel/plugin-transform-class-properties": "^7.27.1", "@babel/plugin-transform-class-static-block": "^7.28.3", - "@babel/plugin-transform-classes": "^7.28.3", + "@babel/plugin-transform-classes": "^7.28.4", "@babel/plugin-transform-computed-properties": "^7.27.1", - "@babel/plugin-transform-destructuring": "^7.28.0", + "@babel/plugin-transform-destructuring": "^7.28.5", "@babel/plugin-transform-dotall-regex": "^7.27.1", "@babel/plugin-transform-duplicate-keys": "^7.27.1", "@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.27.1", "@babel/plugin-transform-dynamic-import": "^7.27.1", "@babel/plugin-transform-explicit-resource-management": "^7.28.0", - "@babel/plugin-transform-exponentiation-operator": "^7.27.1", + "@babel/plugin-transform-exponentiation-operator": "^7.28.5", "@babel/plugin-transform-export-namespace-from": "^7.27.1", "@babel/plugin-transform-for-of": "^7.27.1", "@babel/plugin-transform-function-name": "^7.27.1", "@babel/plugin-transform-json-strings": "^7.27.1", "@babel/plugin-transform-literals": "^7.27.1", - "@babel/plugin-transform-logical-assignment-operators": "^7.27.1", + "@babel/plugin-transform-logical-assignment-operators": "^7.28.5", "@babel/plugin-transform-member-expression-literals": "^7.27.1", "@babel/plugin-transform-modules-amd": "^7.27.1", "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-modules-systemjs": "^7.27.1", + "@babel/plugin-transform-modules-systemjs": "^7.28.5", "@babel/plugin-transform-modules-umd": "^7.27.1", "@babel/plugin-transform-named-capturing-groups-regex": "^7.27.1", "@babel/plugin-transform-new-target": "^7.27.1", "@babel/plugin-transform-nullish-coalescing-operator": "^7.27.1", "@babel/plugin-transform-numeric-separator": "^7.27.1", - "@babel/plugin-transform-object-rest-spread": "^7.28.0", + "@babel/plugin-transform-object-rest-spread": "^7.28.4", "@babel/plugin-transform-object-super": "^7.27.1", "@babel/plugin-transform-optional-catch-binding": "^7.27.1", - "@babel/plugin-transform-optional-chaining": "^7.27.1", + "@babel/plugin-transform-optional-chaining": "^7.28.5", "@babel/plugin-transform-parameters": "^7.27.7", "@babel/plugin-transform-private-methods": "^7.27.1", "@babel/plugin-transform-private-property-in-object": "^7.27.1", "@babel/plugin-transform-property-literals": "^7.27.1", - "@babel/plugin-transform-regenerator": "^7.28.3", + "@babel/plugin-transform-regenerator": "^7.28.4", "@babel/plugin-transform-regexp-modifiers": "^7.27.1", "@babel/plugin-transform-reserved-words": "^7.27.1", "@babel/plugin-transform-shorthand-properties": "^7.27.1", @@ -1948,15 +1964,15 @@ } }, "node_modules/@babel/preset-react": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.27.1.tgz", - "integrity": "sha512-oJHWh2gLhU9dW9HHr42q0cI0/iHHXTLGe39qvpAZZzagHy0MzYLCnCVV0symeRvzmjHyVU7mw2K06E6u/JwbhA==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.28.5.tgz", + "integrity": "sha512-Z3J8vhRq7CeLjdC58jLv4lnZ5RKFUJWqH5emvxmv9Hv3BD1T9R/Im713R4MTKwvFaV74ejZ3sM01LyEKk4ugNQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-plugin-utils": "^7.27.1", "@babel/helper-validator-option": "^7.27.1", - "@babel/plugin-transform-react-display-name": "^7.27.1", + "@babel/plugin-transform-react-display-name": "^7.28.0", "@babel/plugin-transform-react-jsx": "^7.27.1", "@babel/plugin-transform-react-jsx-development": "^7.27.1", "@babel/plugin-transform-react-pure-annotations": "^7.27.1" @@ -1969,9 +1985,9 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.27.1.tgz", - "integrity": "sha512-l7WfQfX0WK4M0v2RudjuQK4u99BS6yLHYEmdtVPP7lKV013zr9DygFuWNlnbvQ9LR+LS0Egz/XAvGx5U9MX0fQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.28.5.tgz", + "integrity": "sha512-+bQy5WOI2V6LJZpPVxY+yp66XdZ2yifu0Mc1aP5CQKgjn4QM5IN2i5fAZ4xKop47pr8rpVhiAeu+nDQa12C8+g==", "dev": true, "license": "MIT", "dependencies": { @@ -1979,7 +1995,7 @@ "@babel/helper-validator-option": "^7.27.1", "@babel/plugin-syntax-jsx": "^7.27.1", "@babel/plugin-transform-modules-commonjs": "^7.27.1", - "@babel/plugin-transform-typescript": "^7.27.1" + "@babel/plugin-transform-typescript": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -2014,18 +2030,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.4.tgz", - "integrity": "sha512-YEzuboP2qvQavAcjgQNVgsvHIDv6ZpwXvcvjmyySP2DIMuByS/6ioU5G9pYrWHM6T2YDfc7xga9iNzYOs12CFQ==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.5.tgz", + "integrity": "sha512-TCCj4t55U90khlYkVV/0TfkJkAkUg3jZFA3Neb7unZT8CPok7iiRfaX0F+WnqWqt7OxhOn0uBKXCw4lbL8W0aQ==", "dev": true, "license": "MIT", "dependencies": { "@babel/code-frame": "^7.27.1", - "@babel/generator": "^7.28.3", + "@babel/generator": "^7.28.5", "@babel/helper-globals": "^7.28.0", - "@babel/parser": "^7.28.4", + "@babel/parser": "^7.28.5", "@babel/template": "^7.27.2", - "@babel/types": "^7.28.4", + "@babel/types": "^7.28.5", "debug": "^4.3.1" }, "engines": { @@ -2033,14 +2049,14 @@ } }, "node_modules/@babel/types": { - "version": "7.28.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.4.tgz", - "integrity": "sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==", + "version": "7.28.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz", + "integrity": "sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==", "dev": true, "license": "MIT", "dependencies": { "@babel/helper-string-parser": "^7.27.1", - "@babel/helper-validator-identifier": "^7.27.1" + "@babel/helper-validator-identifier": "^7.28.5" }, "engines": { "node": ">=6.9.0" @@ -2443,9 +2459,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", - "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", "dev": true, "license": "MIT", "engines": { @@ -2663,9 +2679,9 @@ "license": "BSD-3-Clause" }, "node_modules/@hapi/tlds": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.3.tgz", - "integrity": "sha512-QIvUMB5VZ8HMLZF9A2oWr3AFM430QC8oGd0L35y2jHpuW6bIIca6x/xL7zUf4J7L9WJ3qjz+iJII8ncaeMbpSg==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@hapi/tlds/-/tlds-1.1.4.tgz", + "integrity": "sha512-Fq+20dxsxLaUn5jSSWrdtSRcIUba2JquuorF9UW1wIJS5cSUwxIsO2GIhaWynPRflvxSzFN+gxKte2HEW1OuoA==", "dev": true, "license": "BSD-3-Clause", "engines": { @@ -6339,16 +6355,16 @@ "license": "MIT" }, "node_modules/@types/express": { - "version": "4.17.23", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.23.tgz", - "integrity": "sha512-Crp6WY9aTYP3qPi2wGDo9iUe/rceX01UMhnF1jmwDcKCFM6cx7YhGP/Mpr3y9AASpfHixIG0E6azCcL5OcDHsQ==", + "version": "4.17.25", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.25.tgz", + "integrity": "sha512-dVd04UKsfpINUnK0yBoYHDF3xu7xVH4BuDotC/xGuycx4CgbP48X/KF/586bcObxT0HENHXEU8Nqtu6NR+eKhw==", "dev": true, "license": "MIT", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", "@types/qs": "*", - "@types/serve-static": "*" + "@types/serve-static": "^1" } }, "node_modules/@types/express-serve-static-core": { @@ -6416,9 +6432,9 @@ "license": "MIT" }, "node_modules/@types/http-proxy": { - "version": "1.17.16", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.16.tgz", - "integrity": "sha512-sdWoUajOB1cd0A8cRRQ1cfyWNbmFKLAqBB89Y8x5iYyG/mkJHc0YUH8pdWBy2omi9qtCpiIgGjuwO0dQST2l5w==", + "version": "1.17.17", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.17.tgz", + "integrity": "sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==", "dev": true, "license": "MIT", "dependencies": { @@ -6579,9 +6595,9 @@ } }, "node_modules/@types/node": { - "version": "24.9.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.1.tgz", - "integrity": "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==", + "version": "24.9.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.2.tgz", + "integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==", "dev": true, "license": "MIT", "dependencies": { @@ -6703,9 +6719,9 @@ "license": "MIT" }, "node_modules/@types/send": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.0.tgz", - "integrity": "sha512-zBF6vZJn1IaMpg3xUF25VK3gd3l8zwE0ZLRX7dsQyQi+jp4E8mMDJNGDYnYse+bQhYwWERTxVwHpi3dMOq7RKQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@types/send/-/send-1.2.1.tgz", + "integrity": "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ==", "dev": true, "license": "MIT", "dependencies": { @@ -6723,9 +6739,9 @@ } }, "node_modules/@types/serve-static": { - "version": "1.15.9", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.9.tgz", - "integrity": "sha512-dOTIuqpWLyl3BBXU3maNQsS4A3zuuoYRNIvYSxxhebPfXg2mzWQEPne/nlJ37yOse6uGgR386uTpdsx4D0QZWA==", + "version": "1.15.10", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.10.tgz", + "integrity": "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==", "dev": true, "license": "MIT", "dependencies": { @@ -6735,9 +6751,9 @@ } }, "node_modules/@types/serve-static/node_modules/@types/send": { - "version": "0.17.5", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.5.tgz", - "integrity": "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w==", + "version": "0.17.6", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.6.tgz", + "integrity": "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og==", "dev": true, "license": "MIT", "dependencies": { @@ -6807,9 +6823,9 @@ } }, "node_modules/@types/yargs": { - "version": "17.0.33", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", - "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", + "version": "17.0.34", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.34.tgz", + "integrity": "sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A==", "dev": true, "license": "MIT", "dependencies": { @@ -7379,9 +7395,9 @@ } }, "node_modules/@wordpress/babel-preset-default": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-8.33.0.tgz", - "integrity": "sha512-zi+TfLm7w8UmC/IE1b6/z+GIRMvv9s6yQ7+2a3XUEFriAiLwVM2cRXTcauaKkcos3BDi35M0V8x0T7980RwTlQ==", + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/babel-preset-default/-/babel-preset-default-8.34.0.tgz", + "integrity": "sha512-AJQesBDb1LcmwlfpIVkuTu0gwkjgfVdbKG6sqmKfKkjYTac6k+ZJscZqYWgjIK2G0F0/TZwbN6u4otRq+yDAGw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -7391,8 +7407,8 @@ "@babel/plugin-transform-runtime": "7.25.7", "@babel/preset-env": "7.25.7", "@babel/preset-typescript": "7.25.7", - "@wordpress/browserslist-config": "^6.33.0", - "@wordpress/warning": "^3.33.0", + "@wordpress/browserslist-config": "^6.34.0", + "@wordpress/warning": "^3.34.0", "browserslist": "^4.21.10", "core-js": "^3.31.0", "react": "^18.3.0" @@ -7801,9 +7817,9 @@ } }, "node_modules/@wordpress/browserslist-config": { - "version": "6.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-6.33.0.tgz", - "integrity": "sha512-4plw8mLKjcd1beuJzmjT4GNBk+R02qu/og6h/BuGMY8dxfqovfGB0Z2w7C85ILmjY2qnvsU7gelDcSXNgwuwxQ==", + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/browserslist-config/-/browserslist-config-6.34.0.tgz", + "integrity": "sha512-pmcCkqG2jW+UUBSkX7rSZS33mcW6M0fKcJPD40TlK2cUZvECS5TDa2BC/b80PfIsT2kSw+Z9Wv+8eyX6I8HGjQ==", "dev": true, "license": "GPL-2.0-or-later", "engines": { @@ -7997,6 +8013,25 @@ "react": "^18.0.0" } }, + "node_modules/@wordpress/data-controls": { + "version": "4.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/data-controls/-/data-controls-4.34.0.tgz", + "integrity": "sha512-h52Ehqt8FS/GGBH2riVOlrQfF3v0KluO+9DsOLpuD0s+yPiFinYhhAoYsYTlo6FmxS5x3V+6f2rAaEHGLzMF7A==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "@wordpress/api-fetch": "^7.34.0", + "@wordpress/data": "^10.34.0", + "@wordpress/deprecated": "^4.34.0" + }, + "engines": { + "node": ">=18.12.0", + "npm": ">=8.19.2" + }, + "peerDependencies": { + "react": "^18.0.0" + } + }, "node_modules/@wordpress/dataviews": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/@wordpress/dataviews/-/dataviews-10.2.0.tgz", @@ -8062,9 +8097,9 @@ } }, "node_modules/@wordpress/dependency-extraction-webpack-plugin": { - "version": "6.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-6.33.0.tgz", - "integrity": "sha512-uGvJrak1wpi6XAfIvSXedXgfxvavpzVlj7ypAedAqQ26eFLHCPzK9S2TRp+jw4BglUE3mR2NXD8/glorbGwq+g==", + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/dependency-extraction-webpack-plugin/-/dependency-extraction-webpack-plugin-6.34.0.tgz", + "integrity": "sha512-lynP46WtxueExZoWzDgM02dSt/11J50Wu2jqRKCIAVsID75cPhjYS59kMAyTppa9R9s9J9ZEdqL0gqXsXr3+bw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -8322,17 +8357,17 @@ } }, "node_modules/@wordpress/eslint-plugin": { - "version": "22.19.0", - "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-22.19.0.tgz", - "integrity": "sha512-J24RZ6U4Ref0ix8uhmc3XJGkJLdi/V+JOQjjRwB0uLpsSHio4+LhAJrBlovkZCf+0HsRKiJHuIdli0EKW5gl3g==", + "version": "22.20.0", + "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-22.20.0.tgz", + "integrity": "sha512-mZuEmBLLAOT6koBsXMrFMHQskKs+p+nu1Z/Y/4u1FldRlShdbKSXZG2p9qV3SVnXdSAEa5Cr32kOvkZGacEO/Q==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@babel/eslint-parser": "7.25.7", "@typescript-eslint/eslint-plugin": "^6.4.1", "@typescript-eslint/parser": "^6.4.1", - "@wordpress/babel-preset-default": "^8.33.0", - "@wordpress/prettier-config": "^4.33.0", + "@wordpress/babel-preset-default": "^8.34.0", + "@wordpress/prettier-config": "^4.34.0", "cosmiconfig": "^7.0.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.2", @@ -8625,9 +8660,9 @@ } }, "node_modules/@wordpress/jest-console": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-8.33.0.tgz", - "integrity": "sha512-G9mJYPpGokk+G5MCM2xMQzHqmZY2DNTFDxtJnmH4ISHm4+2S2OTsHovTNuOM+n8QqaaB2En4uuBfYykpRQfNlw==", + "version": "8.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-8.34.0.tgz", + "integrity": "sha512-CovQ/aJXMjWYrvtWzY+9+fkUXi6boVtp0t679AX3BYLtLiQTzLfrvDOb6H5jWyNzXmnHC6OJqRV+baw4qVyumg==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -8642,13 +8677,13 @@ } }, "node_modules/@wordpress/jest-preset-default": { - "version": "12.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-12.33.0.tgz", - "integrity": "sha512-TI3FHvMyWeC36IBz7lGaADLIHrSow9Yj80jwisWZ1uppWkAh1wwnJuGnMUn6dSydUolCGitLcMBjA/kGx3uPLw==", + "version": "12.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/jest-preset-default/-/jest-preset-default-12.34.0.tgz", + "integrity": "sha512-Pxs4gnjtf6L/gde7rCdG9wjymCKPj8VjBWdVGOtvGC8FfXNPbKioI+AIqfwCquXJs2xCyDrGei3QfLQtvQ42/g==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/jest-console": "^8.33.0", + "@wordpress/jest-console": "^8.34.0", "babel-jest": "29.7.0" }, "engines": { @@ -8748,9 +8783,9 @@ } }, "node_modules/@wordpress/npm-package-json-lint-config": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-5.33.0.tgz", - "integrity": "sha512-XejRL8yPGoBVY44gvfH2A2STzFDUjzT7inxhsqzZWYgpMtDNjgdrRN6fgA1GP1nyQx0iRg28r/vapjFCWCA+5w==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-5.34.0.tgz", + "integrity": "sha512-kLGKSxs/vDo+np++TmIpw8thebL1pCBDMdHOjweS8iwlXq2ZevXXIebG1CUk4td8cMoKW1byobtwsz2MwaEAig==", "dev": true, "license": "GPL-2.0-or-later", "engines": { @@ -8819,13 +8854,13 @@ } }, "node_modules/@wordpress/postcss-plugins-preset": { - "version": "5.33.0", - "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-5.33.0.tgz", - "integrity": "sha512-VBmXyBpjq96L58ox5Fmhc2lMKuLZafqkz8im34gQOthjw8PwkHXDCcC/q5ue5SzYXvX07UTZnGGuc7V6ARrHLg==", + "version": "5.34.0", + "resolved": "https://registry.npmjs.org/@wordpress/postcss-plugins-preset/-/postcss-plugins-preset-5.34.0.tgz", + "integrity": "sha512-TP1hsALuEhNRyCGw0YI8AYB1Lq8gFJ+X7etLpjtKlY+0zyiTb+fMrZuQRnYXzwjGhN9Ni9CB1l5U0YhJ8z3VqQ==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/base-styles": "^6.9.0", + "@wordpress/base-styles": "^6.10.0", "autoprefixer": "^10.4.20", "postcss-import": "^16.1.1" }, @@ -9019,25 +9054,25 @@ } }, "node_modules/@wordpress/scripts": { - "version": "30.26.0", - "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-30.26.0.tgz", - "integrity": "sha512-RpyF41xHtA4ktOP0JBBb6/MkoB7/H/emqQnO3t+dZFs56jCP/8141MicDl7Ne9PY29D4NaB0LgbcmthK5Msk1Q==", + "version": "30.27.0", + "resolved": "https://registry.npmjs.org/@wordpress/scripts/-/scripts-30.27.0.tgz", + "integrity": "sha512-gXGptazCxAaR7g8kcN5joj7B5fCm0VeBHOmnDBs2dbQ4W4F3tfzdg6CTEj8LonF9bWQXlSy3ku8EqWCdkSG9Xw==", "dev": true, "license": "GPL-2.0-or-later", "dependencies": { "@babel/core": "7.25.7", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11", "@svgr/webpack": "^8.0.1", - "@wordpress/babel-preset-default": "^8.33.0", - "@wordpress/browserslist-config": "^6.33.0", - "@wordpress/dependency-extraction-webpack-plugin": "^6.33.0", - "@wordpress/e2e-test-utils-playwright": "^1.33.0", - "@wordpress/eslint-plugin": "^22.19.0", - "@wordpress/jest-preset-default": "^12.33.0", - "@wordpress/npm-package-json-lint-config": "^5.33.0", - "@wordpress/postcss-plugins-preset": "^5.33.0", - "@wordpress/prettier-config": "^4.33.0", - "@wordpress/stylelint-config": "^23.25.0", + "@wordpress/babel-preset-default": "^8.34.0", + "@wordpress/browserslist-config": "^6.34.0", + "@wordpress/dependency-extraction-webpack-plugin": "^6.34.0", + "@wordpress/e2e-test-utils-playwright": "^1.34.0", + "@wordpress/eslint-plugin": "^22.20.0", + "@wordpress/jest-preset-default": "^12.34.0", + "@wordpress/npm-package-json-lint-config": "^5.34.0", + "@wordpress/postcss-plugins-preset": "^5.34.0", + "@wordpress/prettier-config": "^4.34.0", + "@wordpress/stylelint-config": "^23.26.0", "adm-zip": "^0.5.9", "babel-jest": "29.7.0", "babel-loader": "9.2.1", @@ -9093,7 +9128,7 @@ "npm": ">=8.19.2" }, "peerDependencies": { - "@playwright/test": "^1.55.0", + "@playwright/test": "^1.56.1", "@wordpress/env": "^10.0.0", "react": "^18.0.0", "react-dom": "^18.0.0" @@ -9159,9 +9194,9 @@ } }, "node_modules/@wordpress/stylelint-config": { - "version": "23.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-23.25.0.tgz", - "integrity": "sha512-GefqayI9kSohIwYW6xkK8jZTF62k71ALdMSVgktMXru567gUDpb1Ci79CIY4iTK3fq/OpJW3uAM4AfXYNH8+3Q==", + "version": "23.26.0", + "resolved": "https://registry.npmjs.org/@wordpress/stylelint-config/-/stylelint-config-23.26.0.tgz", + "integrity": "sha512-sLuvZjkX7gSeemthpZMHHD0MUuv86hp90eyMhIl2Zv3qARpGM6er8YIDtBbhqfIIWcrrfNQcXuR3G2DvL/CfwQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9286,6 +9321,24 @@ "react": "^18.0.0" } }, + "node_modules/@wordpress/views": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wordpress/views/-/views-1.1.0.tgz", + "integrity": "sha512-OuXz73s8Srj0xiyfRSHN91s/ujd/090GTu7KbYummzOUIO9N4H1w968yglB0aQNSJ+lPuJE5gKM5pBxXL/uP3Q==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "@wordpress/data": "^10.34.0", + "@wordpress/dataviews": "^10.2.0", + "@wordpress/element": "^6.34.0", + "@wordpress/preferences": "^4.34.0", + "dequal": "^2.0.3" + }, + "engines": { + "node": ">=18.12.0", + "npm": ">=8.19.2" + } + }, "node_modules/@wordpress/warning": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/@wordpress/warning/-/warning-3.34.0.tgz", @@ -9951,13 +10004,14 @@ "license": "MIT" }, "node_modules/atomically": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/atomically/-/atomically-2.0.3.tgz", - "integrity": "sha512-kU6FmrwZ3Lx7/7y3hPS5QnbJfaohcIul5fGqf7ok+4KklIEk9tJ0C2IQPdacSbVUWv6zVHXEBWoWd6NrVMT7Cw==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/atomically/-/atomically-2.1.0.tgz", + "integrity": "sha512-+gDffFXRW6sl/HCwbta7zK4uNqbPjv4YJEAdz7Vu+FLQHe77eZ4bvbJGi4hE0QPeJlMYMA3piXEr1UL3dAwx7Q==", "dev": true, + "license": "MIT", "dependencies": { - "stubborn-fs": "^1.2.5", - "when-exit": "^2.1.1" + "stubborn-fs": "^2.0.0", + "when-exit": "^2.1.4" } }, "node_modules/autoprefixer": { @@ -10032,9 +10086,9 @@ } }, "node_modules/axios": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.12.2.tgz", - "integrity": "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.1.tgz", + "integrity": "sha512-hU4EGxxt+j7TQijx1oYdAjw4xuIp1wRQSsbMFwSthCWeBQur1eF+qJ5iQ5sN3Tw8YRzQNKb8jszgBdMDVqwJcw==", "dev": true, "license": "MIT", "dependencies": { @@ -10263,9 +10317,9 @@ "license": "MIT" }, "node_modules/bare-events": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.0.tgz", - "integrity": "sha512-AOhh6Bg5QmFIXdViHbMc2tLDsBIRxdkIaIddPslJF9Z5De3APBScuqGP2uThXnIpqFrgoxMNC6km7uXNIMLHXA==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.1.tgz", + "integrity": "sha512-oxSAxTS1hRfnyit2CL5QpAOS5ixfBjj6ex3yTNvXyY/kE719jQ/IjuESJBK2w5v4wwQRAHGseVJXx9QBYOtFGQ==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -10278,9 +10332,9 @@ } }, "node_modules/bare-fs": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.4.11.tgz", - "integrity": "sha512-Bejmm9zRMvMTRoHS+2adgmXw1ANZnCNx+B5dgZpGwlP1E3x6Yuxea8RToddHUbWtVV0iUMWqsgZr8+jcgUI2SA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.0.tgz", + "integrity": "sha512-GljgCjeupKZJNetTqxKaQArLK10vpmK28or0+RwWjEl5Rk+/xG3wkpmkv+WrcBm3q1BwHKlnhXzR8O37kcvkXQ==", "dev": true, "license": "Apache-2.0", "optional": true, @@ -10381,9 +10435,9 @@ "license": "MIT" }, "node_modules/baseline-browser-mapping": { - "version": "2.8.18", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.18.tgz", - "integrity": "sha512-UYmTpOBwgPScZpS4A+YbapwWuBwasxvO/2IOHArSsAhL/+ZdmATBXTex3t+l2hXwLVYK382ibr/nKoY9GKe86w==", + "version": "2.8.21", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.8.21.tgz", + "integrity": "sha512-JU0h5APyQNsHOlAM7HnQnPToSDQoEBZqzu/YBlqDnEeymPnZDREeXJA3KBMQee+dKteAxZ2AtvQEvVYdZf241Q==", "dev": true, "license": "Apache-2.0", "bin": { @@ -10527,9 +10581,9 @@ } }, "node_modules/browserslist": { - "version": "4.26.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.26.3.tgz", - "integrity": "sha512-lAUU+02RFBuCKQPj/P6NgjlbCnLBMp4UtgTx7vNHd3XSIJF87s9a5rA3aH2yw3GS9DqZAUbOtZdCCiZeVRqt0w==", + "version": "4.27.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.27.0.tgz", + "integrity": "sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==", "dev": true, "funding": [ { @@ -10548,11 +10602,11 @@ "license": "MIT", "peer": true, "dependencies": { - "baseline-browser-mapping": "^2.8.9", - "caniuse-lite": "^1.0.30001746", - "electron-to-chromium": "^1.5.227", - "node-releases": "^2.0.21", - "update-browserslist-db": "^1.1.3" + "baseline-browser-mapping": "^2.8.19", + "caniuse-lite": "^1.0.30001751", + "electron-to-chromium": "^1.5.238", + "node-releases": "^2.0.26", + "update-browserslist-db": "^1.1.4" }, "bin": { "browserslist": "cli.js" @@ -10907,9 +10961,9 @@ } }, "node_modules/chardet": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.0.tgz", - "integrity": "sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-2.1.1.tgz", + "integrity": "sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==", "dev": true, "license": "MIT" }, @@ -11182,7 +11236,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", - "dev": true, "license": "MIT", "engines": { "node": ">=6" @@ -12634,9 +12687,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.237", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.237.tgz", - "integrity": "sha512-icUt1NvfhGLar5lSWH3tHNzablaA5js3HVHacQimfP8ViEBOQv+L7DKEuHdbTZ0SKCO1ogTJTIL1Gwk9S6Qvcg==", + "version": "1.5.244", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.244.tgz", + "integrity": "sha512-OszpBN7xZX4vWMPJwB9illkN/znA8M36GQqQxi6MNy9axWxhOfJyZZJtSLQCpEFLHP2xK33BiWx9aIuIEXVCcw==", "dev": true, "license": "ISC" }, @@ -18301,9 +18354,9 @@ } }, "node_modules/launch-editor": { - "version": "2.11.1", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.11.1.tgz", - "integrity": "sha512-SEET7oNfgSaB6Ym0jufAdCeo3meJVeCaaDyzRygy0xsp2BFKCprcfHljTq4QkzTLUxEKkFK6OK4811YM2oSrRg==", + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.12.0.tgz", + "integrity": "sha512-giOHXoOtifjdHqUamwKq6c49GzBdLjvxrd2D+Q4V6uOHopJv7p9VJxikDsQ/CBXZbEITgUqSVHXLTG3VhPP1Dg==", "dev": true, "license": "MIT", "dependencies": { @@ -18480,18 +18533,18 @@ } }, "node_modules/lighthouse/node_modules/puppeteer-core": { - "version": "24.25.0", - "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.25.0.tgz", - "integrity": "sha512-8Xs6q3Ut+C8y7sAaqjIhzv1QykGWG4gc2mEZ2mYE7siZFuRp4xQVehOf8uQKSQAkeL7jXUs3mknEeiqnRqUKvQ==", + "version": "24.27.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-24.27.0.tgz", + "integrity": "sha512-yubwj2XXmTM3wRIpbhO5nCjbByPgpFHlgrsD4IK+gMPqO7/a5FfnoSXDKjmqi8A2M1Ewusz0rTI/r+IN0GU0MA==", "dev": true, "license": "Apache-2.0", "dependencies": { "@puppeteer/browsers": "2.10.12", - "chromium-bidi": "9.1.0", + "chromium-bidi": "10.5.1", "debug": "^4.4.3", - "devtools-protocol": "0.0.1508733", + "devtools-protocol": "0.0.1521046", "typed-query-selector": "^2.12.0", - "webdriver-bidi-protocol": "0.3.7", + "webdriver-bidi-protocol": "0.3.8", "ws": "^8.18.3" }, "engines": { @@ -18499,9 +18552,9 @@ } }, "node_modules/lighthouse/node_modules/puppeteer-core/node_modules/chromium-bidi": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-9.1.0.tgz", - "integrity": "sha512-rlUzQ4WzIAWdIbY/viPShhZU2n21CxDUgazXVbw4Hu1MwaeUSEksSeM6DqPgpRjCLXRk702AVRxJxoOz0dw4OA==", + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-10.5.1.tgz", + "integrity": "sha512-rlj6OyhKhVTnk4aENcUme3Jl9h+cq4oXu4AzBcvr8RMmT6BR4a3zSNT9dbIfXr9/BS6ibzRyDhowuw4n2GgzsQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -18513,9 +18566,9 @@ } }, "node_modules/lighthouse/node_modules/puppeteer-core/node_modules/devtools-protocol": { - "version": "0.0.1508733", - "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1508733.tgz", - "integrity": "sha512-QJ1R5gtck6nDcdM+nlsaJXcelPEI7ZxSMw1ujHpO1c4+9l+Nue5qlebi9xO1Z2MGr92bFOQTW7/rrheh5hHxDg==", + "version": "0.0.1521046", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1521046.tgz", + "integrity": "sha512-vhE6eymDQSKWUXwwA37NtTTVEzjtGVfDr3pRbsWEQ5onH/Snp2c+2xZHWJJawG/0hCCJLRGt4xVtEVUVILol4w==", "dev": true, "license": "BSD-3-Clause", "peer": true @@ -19603,9 +19656,9 @@ "license": "MIT" }, "node_modules/node-releases": { - "version": "2.0.25", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.25.tgz", - "integrity": "sha512-4auku8B/vw5psvTiiN9j1dAOsXvMoGqJuKJcR+dTdqiXEK20mMTk1UEo3HS16LeGQsVG6+qKTPM9u/qQ2LqATA==", + "version": "2.0.27", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.27.tgz", + "integrity": "sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA==", "dev": true, "license": "MIT" }, @@ -23029,9 +23082,9 @@ } }, "node_modules/sass-loader": { - "version": "16.0.5", - "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.5.tgz", - "integrity": "sha512-oL+CMBXrj6BZ/zOq4os+UECPL+bWqt6OAC6DWS8Ln8GZRcMDjlJ4JC3FBDuHJdYaFWIdKNIBYmtZtK2MaMkNIw==", + "version": "16.0.6", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-16.0.6.tgz", + "integrity": "sha512-sglGzId5gmlfxNs4gK2U3h7HlVRfx278YK6Ono5lwzuvi1jxig80YiuHkaDBVsYIKFhx8wN7XSCI0M2IDS/3qA==", "dev": true, "license": "MIT", "dependencies": { @@ -23851,9 +23904,9 @@ } }, "node_modules/simple-git": { - "version": "3.28.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.28.0.tgz", - "integrity": "sha512-Rs/vQRwsn1ILH1oBUy8NucJlXmnnLeLCfcvbSehkPzbv3wwoFWIdtfd6Ndo6ZPhlPsCZ60CPI4rxurnwAa+a2w==", + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.29.0.tgz", + "integrity": "sha512-PEBgFYc8plTys6/XuxinxAJ+6CbXVh+xxsBTOEXw/uYBd3sYlGGoyB12nX5rRPGsFrdnnZWb81qluSl7a83HtA==", "dev": true, "license": "MIT", "dependencies": { @@ -24610,9 +24663,19 @@ } }, "node_modules/stubborn-fs": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/stubborn-fs/-/stubborn-fs-1.2.5.tgz", - "integrity": "sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stubborn-fs/-/stubborn-fs-2.0.0.tgz", + "integrity": "sha512-Y0AvSwDw8y+nlSNFXMm2g6L51rBGdAQT20J3YSOqxC53Lo3bjWRtr2BKcfYoAf352WYpsZSTURrA0tqhfgudPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "stubborn-utils": "^1.0.1" + } + }, + "node_modules/stubborn-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stubborn-utils/-/stubborn-utils-1.0.1.tgz", + "integrity": "sha512-bwtct4FpoH1eYdSMFc84fxnYynWwsy2u0joj94K+6caiPnjZIpwTLHT2u7CFAS0GumaBZVB5Y2GkJ46mJS76qg==", "dev": true }, "node_modules/style-search": { @@ -26030,9 +26093,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz", - "integrity": "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz", + "integrity": "sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A==", "dev": true, "funding": [ { @@ -26393,9 +26456,9 @@ "license": "Apache-2.0" }, "node_modules/webdriver-bidi-protocol": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.3.7.tgz", - "integrity": "sha512-wIx5Gu/LLTeexxilpk8WxU2cpGAKlfbWRO5h+my6EMD1k5PYqM1qQO1MHUFf4f3KRnhBvpbZU7VkizAgeSEf7g==", + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/webdriver-bidi-protocol/-/webdriver-bidi-protocol-0.3.8.tgz", + "integrity": "sha512-21Yi2GhGntMc671vNBCjiAeEVknXjVRoyu+k+9xOMShu+ZQfpGQwnBqbNz/Sv4GXZ6JmutlPAi2nIJcrymAWuQ==", "dev": true, "license": "Apache-2.0" }, @@ -26880,9 +26943,9 @@ } }, "node_modules/when-exit": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/when-exit/-/when-exit-2.1.4.tgz", - "integrity": "sha512-4rnvd3A1t16PWzrBUcSDZqcAmsUIy4minDXT/CZ8F2mVDgd65i4Aalimgz1aQkRGU0iH5eT5+6Rx2TK8o443Pg==", + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/when-exit/-/when-exit-2.1.5.tgz", + "integrity": "sha512-VGkKJ564kzt6Ms1dbgPP/yuIoQCrsFAnRbptpC5wOEsDaNsbCB2bnfnaA8i/vRs5tjUSEOtIuvl9/MyVsvQZCg==", "dev": true, "license": "MIT" }, diff --git a/package.json b/package.json index 9c108bb4c..b0844d0da 100644 --- a/package.json +++ b/package.json @@ -37,28 +37,44 @@ "@testing-library/react": "^16.3.0", "@testing-library/user-event": "^14.4.3", "@types/jest": "^30.0.0", + "@types/react": "^18.2.0", + "@wordpress/admin-ui": "^1.2.0", "@wordpress/api-fetch": "^7.32.0", "@wordpress/block-editor": "^15.7.0", "@wordpress/blocks": "^15.7.0", + "@wordpress/commands": "^1.34.0", "@wordpress/components": "^30.6.0", "@wordpress/compose": "^7.32.0", "@wordpress/core-data": "^7.33.0", "@wordpress/data": "^10.33.0", + "@wordpress/data-controls": "^4.34.0", + "@wordpress/dataviews": "^10.2.0", + "@wordpress/date": "^5.33.0", "@wordpress/dom-ready": "^4.0.0", "@wordpress/e2e-test-utils-playwright": "^1.34.0", "@wordpress/edit-post": "^8.34.0", "@wordpress/editor": "^14.33.2", "@wordpress/element": "^6.0.0", - "@wordpress/env": "^10.34.0", + "@wordpress/env": "^10.32.0", + "@wordpress/html-entities": "^4.32.0", "@wordpress/i18n": "^6.0.0", "@wordpress/icons": "^11.0.0", "@wordpress/interactivity": "^6.33.0", - "@wordpress/plugins": "^7.34.0", - "@wordpress/prettier-config": "^4.34.0", + "@wordpress/interface": "^9.17.0", + "@wordpress/keycodes": "^4.32.0", + "@wordpress/keyboard-shortcuts": "^5.34.0", + "@wordpress/notices": "^5.33.0", + "@wordpress/plugins": "^7.22.0", + "@wordpress/preferences": "^4.32.0", + "@wordpress/prettier-config": "^4.31.0", "@wordpress/primitives": "^4.31.0", "@wordpress/scripts": "^30.23.0", - "@wordpress/url": "^4.34.0", - "classnames": "^2.3.2", + "@wordpress/url": "^4.22.0", + "@wordpress/viewport": "^6.32.0", + "@wordpress/views": "^1.0.0", "prettier": "npm:wp-prettier@^3.0.3" + }, + "dependencies": { + "clsx": "^2.1.1" } } diff --git a/src/social-web/block.json b/src/social-web/block.json new file mode 100644 index 000000000..9fb22091a --- /dev/null +++ b/src/social-web/block.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "activitypub/social-web", + "title": "Social Web", + "category": "widgets", + "description": "Social Web admin interface", + "textdomain": "activitypub", + "editorScript": "file:./index.tsx" +} diff --git a/src/social-web/components/fields/avatar/avatar.tsx b/src/social-web/components/fields/avatar/avatar.tsx new file mode 100644 index 000000000..09e11a813 --- /dev/null +++ b/src/social-web/components/fields/avatar/avatar.tsx @@ -0,0 +1,26 @@ +/** + * Avatar component that displays an actor's avatar with fallback support. + */ + +import { useSettings } from '../../../contexts/settings-context'; +import type { Actor } from '../../../types'; + +interface AvatarProps { + item: Actor; +} + +export default function Avatar( { item }: AvatarProps ) { + const { defaultAvatar } = useSettings(); + const avatarUrl = item.actor_info?.icon || defaultAvatar; + + return ( + { { + ( e.target as HTMLImageElement ).src = defaultAvatar; + } } + /> + ); +} diff --git a/src/social-web/components/fields/avatar/index.tsx b/src/social-web/components/fields/avatar/index.tsx new file mode 100644 index 000000000..c17692248 --- /dev/null +++ b/src/social-web/components/fields/avatar/index.tsx @@ -0,0 +1,19 @@ +/** + * Avatar field for DataViews. + */ + +import { __ } from '@wordpress/i18n'; +import type { Field } from '@wordpress/dataviews'; +import type { Actor } from '../../../types'; +import Avatar from './avatar'; +import './style.scss'; + +export const avatarField: Field< Actor > = { + id: 'avatar', + label: __( 'Avatar', 'activitypub' ), + type: 'media', + enableHiding: false, + enableSorting: false, + getValue: ( { item }: { item: Actor } ) => item.actor_info?.icon || '', + render: ( { item }: { item: Actor } ) => , +}; diff --git a/src/social-web/components/fields/avatar/style.scss b/src/social-web/components/fields/avatar/style.scss new file mode 100644 index 000000000..0d0324bc5 --- /dev/null +++ b/src/social-web/components/fields/avatar/style.scss @@ -0,0 +1,6 @@ +.dataviews-view-table { // Only in Table views. + .activitypub-avatar-field__image { + height: 32px; + width: 32px; + } +} diff --git a/src/social-web/components/fields/follow-status/index.tsx b/src/social-web/components/fields/follow-status/index.tsx new file mode 100644 index 000000000..2a7494153 --- /dev/null +++ b/src/social-web/components/fields/follow-status/index.tsx @@ -0,0 +1,21 @@ +/** + * Follow Status field for DataViews. + */ + +import { __, _x } from '@wordpress/i18n'; +import type { Field } from '@wordpress/dataviews'; +import type { Actor } from '../../../types'; +import './style.scss'; + +export const followStatusField: Field< Actor > = { + id: 'follow_status', + label: __( 'Following', 'activitypub' ), + enableHiding: true, + getValue: ( { item }: { item: Actor } ) => item.follow_status?.follows_back, + render: ( { item }: { item: Actor } ) => { + if ( item.follow_status?.follows_back ) { + return { _x( 'Mutual', 'Follow status', 'activitypub' ) }; + } + return ; + }, +}; diff --git a/src/social-web/components/fields/follow-status/style.scss b/src/social-web/components/fields/follow-status/style.scss new file mode 100644 index 000000000..adb7ff915 --- /dev/null +++ b/src/social-web/components/fields/follow-status/style.scss @@ -0,0 +1,10 @@ +.activitypub-mutual { + display: inline-block; + padding: 2px 8px; + background: #dcdcde; + border-radius: 3px; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + color: #50575e; +} diff --git a/src/social-web/components/fields/index.ts b/src/social-web/components/fields/index.ts new file mode 100644 index 000000000..75991bcf2 --- /dev/null +++ b/src/social-web/components/fields/index.ts @@ -0,0 +1,5 @@ +export * from './avatar'; +export * from './name'; +export * from './webfinger'; +export * from './modified'; +export * from './follow-status'; diff --git a/src/social-web/components/fields/modified/index.tsx b/src/social-web/components/fields/modified/index.tsx new file mode 100644 index 000000000..6de676e9d --- /dev/null +++ b/src/social-web/components/fields/modified/index.tsx @@ -0,0 +1,26 @@ +/** + * Modified/Last Updated field for DataViews. + */ + +import { __ } from '@wordpress/i18n'; +import { dateI18n } from '@wordpress/date'; +import type { Field } from '@wordpress/dataviews'; +import type { Actor } from '../../../types'; + +export const modifiedField: Field< Actor > = { + id: 'modified', + label: __( 'Last Updated', 'activitypub' ), + enableHiding: true, + enableSorting: true, + getValue: ( { item }: { item: Actor } ) => item.modified_gmt || item.modified, + render: ( { item }: { item: Actor } ) => { + const date = item.modified_gmt || item.modified; + if ( ! date ) { + return ; + } + return ; + }, + filterBy: { + operators: [ 'after', 'before' ], + }, +}; diff --git a/src/social-web/components/fields/name/index.tsx b/src/social-web/components/fields/name/index.tsx new file mode 100644 index 000000000..45a0e4202 --- /dev/null +++ b/src/social-web/components/fields/name/index.tsx @@ -0,0 +1,25 @@ +/** + * Name field for DataViews. + */ + +import { __ } from '@wordpress/i18n'; +import type { Field } from '@wordpress/dataviews'; +import type { Actor } from '../../../types'; + +export const nameField: Field< Actor > = { + id: 'name', + label: __( 'Name', 'activitypub' ), + enableHiding: false, + enableSorting: true, + getValue: ( { item }: { item: Actor } ) => item.actor_info?.name || '', + render: ( { item }: { item: Actor } ) => { + const name = item.actor_info?.name || ''; + const url = item.actor_info?.url || '#'; + + return ( + + { name } + + ); + }, +}; diff --git a/src/social-web/components/fields/webfinger/index.tsx b/src/social-web/components/fields/webfinger/index.tsx new file mode 100644 index 000000000..ecb3e01d6 --- /dev/null +++ b/src/social-web/components/fields/webfinger/index.tsx @@ -0,0 +1,28 @@ +/** + * Webfinger/Profile field for DataViews. + */ + +import { __ } from '@wordpress/i18n'; +import type { Field } from '@wordpress/dataviews'; +import type { Actor } from '../../../types'; + +export const webfingerField: Field< Actor > = { + id: 'webfinger', + label: __( 'Profile', 'activitypub' ), + enableHiding: true, + getValue: ( { item }: { item: Actor } ) => item.actor_info?.webfinger || '', + render: ( { item }: { item: Actor } ) => { + const webfinger = item.actor_info?.webfinger || ''; + const url = item.actor_info?.url || '#'; + + if ( ! webfinger ) { + return ; + } + + return ( + + @{ webfinger } + + ); + }, +}; diff --git a/src/social-web/components/layout/index.tsx b/src/social-web/components/layout/index.tsx new file mode 100644 index 000000000..8b0e0e16e --- /dev/null +++ b/src/social-web/components/layout/index.tsx @@ -0,0 +1,203 @@ +/** + * Layout Component + * + * Three-panel layout system: + * - Sidebar (300px fixed) - Navigation + * - Stage (flexible) - Main content + * - Inspector (380px fixed, optional) - Detail panel + */ + +import { useState, useEffect, lazy, Suspense } from '@wordpress/element'; +import { CommandMenu } from '@wordpress/commands'; +import { SnackbarList, Spinner } from '@wordpress/components'; +import { useSelect, useDispatch } from '@wordpress/data'; +import { store as noticesStore } from '@wordpress/notices'; +import Sidebar from '../sidebar'; +import Panel from '../panel'; +import './style.scss'; + +// Import dashboard directly since it's the default route +import DashboardStage from '../../routes/dashboard/stage'; + +// Lazy load other stage components for code splitting +const FollowersStage = lazy( + () => import( /* webpackChunkName: "social-web/followers" */ '../../routes/followers/stage' ) +); +const FollowingStage = lazy( + () => import( /* webpackChunkName: "social-web/following" */ '../../routes/following/stage' ) +); +const InteractionsStage = lazy( + () => import( /* webpackChunkName: "social-web/interactions" */ '../../routes/interactions/stage' ) +); + +// Lazy load inspector components - using same chunk names to combine with stages +const FollowingInspector = lazy( + () => import( /* webpackChunkName: "social-web/following" */ '../../routes/following/inspector' ) +); +const InteractionInspector = lazy( + () => import( /* webpackChunkName: "social-web/interactions" */ '../../routes/interactions/inspector' ) +); + +/** + * Parse the URL hash to extract section and item ID + * Format: #/section or #/section/itemId + */ +function parseHash(): { section: string; itemId: string | null } { + const hash = window.location.hash.slice( 1 ); // Remove # + if ( ! hash || hash === '/' ) { + return { section: 'dashboard', itemId: null }; + } + + const parts = hash.split( '/' ).filter( Boolean ); + const section = parts[ 0 ] || 'dashboard'; + const itemId = parts[ 1 ] || null; + + return { section, itemId }; +} + +/** + * Update the URL hash without triggering a page reload + */ +function updateHash( section: string, itemId?: string | null ) { + const hash = itemId ? `#/${ section }/${ itemId }` : `#/${ section }`; + window.history.pushState( null, '', hash ); +} + +export function Layout() { + const [ activeSection, setActiveSection ] = useState( 'dashboard' ); + const [ selectedItemId, setSelectedItemId ] = useState< string | null >( null ); + + // Get notices for the snackbar + const notices = useSelect( ( select ) => { + const store = select( noticesStore ) as any; + return store.getNotices().filter( ( notice: any ) => notice.type === 'snackbar' ); + }, [] ); + const { removeNotice } = useDispatch( noticesStore ) as any; + + // Initialize from URL hash on mount + useEffect( () => { + const { section, itemId } = parseHash(); + setActiveSection( section ); + setSelectedItemId( itemId ); + }, [] ); + + // Listen for hash changes (back/forward navigation) + useEffect( () => { + const handleHashChange = () => { + const { section, itemId } = parseHash(); + setActiveSection( section ); + setSelectedItemId( itemId ); + }; + + window.addEventListener( 'hashchange', handleHashChange ); + return () => { + window.removeEventListener( 'hashchange', handleHashChange ); + }; + }, [] ); + + // Add fullscreen mode class to body + useEffect( () => { + document.body.classList.add( 'is-fullscreen-mode' ); + return () => { + document.body.classList.remove( 'is-fullscreen-mode' ); + }; + }, [] ); + + const handleSelectItem = ( id: string ) => { + setSelectedItemId( id ); + updateHash( activeSection, id ); + }; + + const handleCloseInspector = () => { + setSelectedItemId( null ); + updateHash( activeSection ); + }; + + const handleNavigate = ( section: string ) => { + setActiveSection( section ); + setSelectedItemId( null ); + updateHash( section ); + }; + + // Render main content (stage) + const renderStage = () => { + const props = { onSelectItem: handleSelectItem }; + + // Dashboard is not lazy-loaded since it's the default route + if ( activeSection === 'dashboard' ) { + return ; + } + + // Other routes are lazy-loaded + const StageComponent = () => { + switch ( activeSection ) { + case 'followers': + return ; + case 'following': + return ; + case 'interactions': + return ; + default: + return ; + } + }; + + return ( + }> + + + ); + }; + + // Render detail panel (inspector) + const renderInspector = () => { + if ( ! selectedItemId ) return null; + + const props = { id: selectedItemId, onClose: handleCloseInspector }; + + const InspectorComponent = () => { + switch ( activeSection ) { + case 'following': + return ; + case 'interactions': + return ; + default: + return null; + } + }; + + return ( + }> + + + ); + }; + + const showInspector = !! selectedItemId; + + return ( +
+ +
+ { /* Sidebar - 240px fixed width (no Panel wrapper, stays dark) */ } +
+ +
+ + { /* Stage - main content area */ } +
+ { renderStage() } +
+ + { /* Inspector - optional 380px side panel */ } + { showInspector && ( +
+ { renderInspector() } +
+ ) } +
+ + +
+ ); +} diff --git a/src/social-web/components/layout/style.scss b/src/social-web/components/layout/style.scss new file mode 100644 index 000000000..3e861152e --- /dev/null +++ b/src/social-web/components/layout/style.scss @@ -0,0 +1,70 @@ +/* Ensure provider wrappers (SlotFillProvider, ShortcutProvider) fill height */ +#activitypub-social-web-root > div { + height: 100%; +} + +.app-layout { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e); + overflow: hidden; +} + +.app-content { + width: 100%; + height: 100%; + flex-grow: 1; + display: flex; + background-color: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e); + overflow: hidden; +} + +.sidebar-region { + flex-shrink: 0; + width: 300px; + display: flex; + flex-direction: column; +} + +.stage-region { + flex-grow: 1; + min-width: 400px; + display: flex; + flex-direction: column; +} + +.inspector-region { + width: var(--sw-inspector-width); + flex-shrink: 0; + display: flex; + flex-direction: column; +} + +// Position the SnackbarList at the bottom left of the viewport +.components-snackbar-list { + position: fixed; + bottom: 20px; + left: 20px; + z-index: 100000; // High z-index to ensure it appears above other content +} + +// Responsive +@media (max-width: 782px) { + .app-content { + flex-direction: column; + } + + .sidebar-region, + .inspector-region { + width: 100%; + } + + // Adjust snackbar position on mobile + .components-snackbar-list { + left: 10px; + right: 10px; + bottom: 10px; + } +} diff --git a/src/social-web/components/page/index.tsx b/src/social-web/components/page/index.tsx new file mode 100644 index 000000000..b3abc42a0 --- /dev/null +++ b/src/social-web/components/page/index.tsx @@ -0,0 +1,61 @@ +/** + * Page Component + * + * A reusable page wrapper that provides consistent header layout and content structure. + */ + +import { ReactNode } from 'react'; +import clsx from 'clsx'; +import './style.scss'; + +interface PageProps { + title: string; + subTitle?: string; + badges?: ReactNode; + actions?: ReactNode; + breadcrumbs?: ReactNode; + hasPadding?: boolean; + hasBorder?: boolean; + contentWidth?: 'default' | 'full' | 'constrained'; + children: ReactNode; +} + +export function Page( { + title, + subTitle, + badges, + actions, + breadcrumbs, + hasPadding = true, + hasBorder = false, + contentWidth = 'default', + children, +}: PageProps ) { + return ( +
+
+ { breadcrumbs &&
{ breadcrumbs }
} + +
+
+

{ title }

+ { badges &&
{ badges }
} +
+ { actions &&
{ actions }
} +
+ + { subTitle &&

{ subTitle }

} +
+ +
+ { children } +
+
+ ); +} diff --git a/src/social-web/components/page/style.scss b/src/social-web/components/page/style.scss new file mode 100644 index 000000000..3c951929b --- /dev/null +++ b/src/social-web/components/page/style.scss @@ -0,0 +1,62 @@ +.page { + display: flex; + flex-direction: column; + height: 100%; +} + +.header { + padding: var(--wpds-spacing-60, 24px); + flex-shrink: 0; + + &.has-border { + border-bottom: var(--wpds-border-width-focus, 1px) solid var(--wpds-color-stroke-surface-neutral, #ddd); + } +} + +.title-row { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--wpds-spacing-40, 16px); +} + +.title-group { + display: flex; + align-items: center; + gap: var(--wpds-spacing-30, 12px); +} + +.title { + margin: 0; + font-size: var(--wpds-font-size-large, 20px); + font-weight: 500; + color: var(--wpds-color-fg-primary, #1e1e1e); +} + +.sub-title { + margin: var(--wpds-spacing-20, 8px) 0 0; + color: var(--wpds-color-fg-secondary, #757575); + font-size: var(--wpds-font-size-small, 13px); +} + +.content { + flex: 1; + overflow: auto; + display: flex; + flex-direction: column; + gap: var(--wpds-spacing-60, 24px); + + &.padded { + padding: var(--wpds-spacing-60, 24px); + } + + &.constrained { + max-width: 960px; + margin: 0 auto; + width: 100%; + } + + &.full { + padding: 0; + } +} diff --git a/src/social-web/components/panel/index.tsx b/src/social-web/components/panel/index.tsx new file mode 100644 index 000000000..cc4c1d812 --- /dev/null +++ b/src/social-web/components/panel/index.tsx @@ -0,0 +1,24 @@ +/** + * Panel Component + * + * A reusable surface wrapper for themed content areas. + * Uses ThemedSurface component with margin spacing. + */ + +import { ReactNode } from 'react'; +import clsx from 'clsx'; +import ThemedSurface from '../themed-surface'; +import './style.scss'; + +interface PanelProps { + className?: string; + children: ReactNode; +} + +export default function Panel( { className, children }: PanelProps ) { + return ( +
+ { children } +
+ ); +} diff --git a/src/social-web/components/panel/style.scss b/src/social-web/components/panel/style.scss new file mode 100644 index 000000000..e4149ce03 --- /dev/null +++ b/src/social-web/components/panel/style.scss @@ -0,0 +1,7 @@ +.panel { + margin: var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) var(--wpds-spacing-40, 16px) 0; + flex: 1; + min-height: 0; + display: flex; + flex-direction: column; +} diff --git a/src/social-web/components/sidebar/index.tsx b/src/social-web/components/sidebar/index.tsx new file mode 100644 index 000000000..1dc60b5a9 --- /dev/null +++ b/src/social-web/components/sidebar/index.tsx @@ -0,0 +1,78 @@ +/** + * Sidebar Component + * + * Navigation sidebar with menu items for different sections + */ + +import { + Button, + Icon, + MenuGroup, + MenuItem, + NavigableMenu, + __experimentalHStack as HStack, + __experimentalHeading as Heading, +} from '@wordpress/components'; +import { home, people, addCard, comment, chevronRight, chevronLeft } from '@wordpress/icons'; +import SiteHub from '../site-hub'; +import { __, isRTL } from '@wordpress/i18n'; +import './style.scss'; + +const menuItems = [ + { id: 'dashboard', label: __( 'Dashboard' ), icon: home }, + { id: 'followers', label: __( 'Followers' ), icon: people }, + { id: 'following', label: __( 'Following' ), icon: addCard }, + { id: 'interactions', label: __( 'Interactions' ), icon: comment }, +]; + +interface SidebarProps { + activeSection: string; + onNavigate: ( section: string ) => void; +} + +export default function Sidebar( { activeSection, onNavigate }: SidebarProps ) { + return ( +
+ + + { /* Navigation */ } + + + { /* Footer */ } +
+ + window.open( '/docs', '_blank' ) }>Documentation + onNavigate( 'settings' ) }>Settings + +
+
+ ); +} diff --git a/src/social-web/components/sidebar/style.scss b/src/social-web/components/sidebar/style.scss new file mode 100644 index 000000000..4f0a68390 --- /dev/null +++ b/src/social-web/components/sidebar/style.scss @@ -0,0 +1,79 @@ +.sidebar { + display: flex; + flex-direction: column; + flex: 1; + color: var(--wpds-color-fg-inverted-secondary, #cccccc); + + .nav { + flex: 1; + padding: 0 var(--wpds-spacing-30, 12px); + overflow-y: auto; + } + + .sidebar-navigation__icon-title { + position: sticky; + top: 0; + background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e); + padding-top: var(--wpds-spacing-120, 48px); + margin-bottom: var(--wpds-spacing-20, 8px); + padding-bottom: var(--wpds-spacing-20, 8px); + } + + .sidebar-navigation__button { + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + flex-shrink: 0; + + // Focus (resets default button focus and use focus-visible). + &:focus:not(:disabled) { + box-shadow: none; + outline: none; + } + &:focus-visible:not(:disabled) { + box-shadow: + 0 0 0 var(--wpds-border-width-focus, 1.5px) + var(--wp-admin-theme-color); + outline: 3px solid transparent; + } + + &:hover:not(:disabled,[aria-disabled="true"]), + &:focus-visible, + &:focus, + &:not(:disabled,[aria-disabled="true"]):active, + &[aria-expanded="true"] { + color: var(--wpds-color-private-bg-fg-fill, #f0f0f0); + } + } + + .sidebar-navigation__title { + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + flex-grow: 1; + overflow-wrap: break-word; + line-height: var(--wpds-spacing-80, 32px); + } + + .menu-item { + display: flex; + align-items: center; + gap: var(--wpds-spacing-20, 8px); + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + + &:hover { + background-color: var(--wpds-color-bg-interactive-neutral-hover, rgba(255, 255, 255, 0.1)); + color: var(--wpds-color-fg-inverted-primary, #ffffff); + } + + &.is-selected { + background-color: var(--wpds-color-bg-interactive-neutral-active, rgba(255, 255, 255, 0.15)); + color: var(--wpds-color-fg-inverted-primary, #ffffff); + } + + svg { + flex-shrink: 0; + } + } + + .footer { + padding: var(--wpds-spacing-40, 16px); + border-top: 1px solid var(--wpds-color-stroke-inverted, rgba(255, 255, 255, 0.1)); + } +} diff --git a/src/social-web/components/site-hub/index.tsx b/src/social-web/components/site-hub/index.tsx new file mode 100644 index 000000000..f8e1fda81 --- /dev/null +++ b/src/social-web/components/site-hub/index.tsx @@ -0,0 +1,85 @@ +/** + * Site Hub Component + * + * Displays site icon, title, and command palette toggle + */ + +/** + * WordPress dependencies + */ +import { useSelect, useDispatch } from '@wordpress/data'; +import { Button, __experimentalHStack as HStack, VisuallyHidden } from '@wordpress/components'; +import { __ } from '@wordpress/i18n'; +import { store as coreStore } from '@wordpress/core-data'; +import { decodeEntities } from '@wordpress/html-entities'; +import { search } from '@wordpress/icons'; +import { store as commandsStore } from '@wordpress/commands'; +import { displayShortcut } from '@wordpress/keycodes'; +import { filterURLForDisplay } from '@wordpress/url'; +import type { UnstableBase } from '@wordpress/core-data'; + +/** + * Internal dependencies + */ +import SiteIcon from './site-icon'; +import './style.scss'; + +function SiteHub() { + const { homeUrl, siteTitle } = useSelect( ( select ) => { + const { getEntityRecord } = select( coreStore ); + const _base = getEntityRecord< UnstableBase >( 'root', '__unstableBase' ); + return { + homeUrl: _base?.home, + siteTitle: ! _base?.name && !! _base?.url ? filterURLForDisplay( _base?.url ) : _base?.name, + }; + }, [] ); + + const { open: openCommandCenter } = useDispatch( commandsStore ); + + return ( +
+ +
+ +
+ + +
+ +
+ +
+ ); +} + +export default SiteHub; diff --git a/src/social-web/components/site-hub/site-icon.tsx b/src/social-web/components/site-hub/site-icon.tsx new file mode 100644 index 000000000..9f2eccb2d --- /dev/null +++ b/src/social-web/components/site-hub/site-icon.tsx @@ -0,0 +1,24 @@ +/** + * WordPress dependencies + */ +import React from 'react'; +import { Icon } from '@wordpress/components'; +import { wordpress } from '@wordpress/icons'; +import clsx from 'clsx'; + +interface SiteIconProps { + className?: string; + siteIconUrl?: string; +} + +function SiteIcon( { className, siteIconUrl }: SiteIconProps ) { + const icon = siteIconUrl ? ( + Site Icon + ) : ( + + ); + + return
{ icon }
; +} + +export default SiteIcon; diff --git a/src/social-web/components/site-hub/style.scss b/src/social-web/components/site-hub/style.scss new file mode 100644 index 000000000..c35bcaa23 --- /dev/null +++ b/src/social-web/components/site-hub/style.scss @@ -0,0 +1,154 @@ +/** + * Site Hub Component Styles + */ + +.site-hub { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--wpds-spacing-20, 8px); + margin-right: var(--wpds-spacing-30, 12px); + height: var(--wpds-spacing-160, 64px); +} + +.site-hub__actions { + flex-shrink: 0; +} + +.site-hub__icon-container { + height: var(--wpds-spacing-160, 64px); + width: var(--wpds-spacing-160, 64px); + flex-shrink: 0; + + &.has-transparent-background .site-hub__icon-container { + background: transparent; + } +} + +.site-hub__icon-button.components-button { + /* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */ + view-transition-name: toggle; + /* stylelint-enable */ + position: relative; + color: var(--wpds-color-fg-inverted-primary, #ffffff); + height: var(--wpds-spacing-160, 64px); + width: var(--wpds-spacing-160, 64px); + overflow: hidden; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + background: var(--wpds-color-bg-surface-neutral-weak, #1e1e1e); + border-radius: 0; + + &:hover, + &:active { + color: var(--wpds-color-fg-inverted-primary, #ffffff); + } + + &:focus-visible, + &:focus { + box-shadow: 0 0 0 3px #1e1e1e, 0 0 0 6px var(--wp-admin-theme-color); + outline: 4px solid #0000; + outline-offset: 4px; + } + + &::before { + content: ""; + display: block; + position: absolute; + top: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px)); + right: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px)); + bottom: calc(var(--wpds-spacing-20, 8px) + var(--wpds-border-width-focus, 1px)); + left: calc(var(--wpds-spacing-40, 16px) + var(--wpds-border-width-focus, 1px)); + border-radius: var(--wpds-border-radius-large, 8px); + box-shadow: none; + + @media not (prefers-reduced-motion) { + transition: box-shadow 0.1s ease; + } + } + + .site-icon { + display: flex; + height: var(--wpds-spacing-160, 64px); + width: var(--wpds-spacing-160, 64px); + justify-content: center; + align-items: center; + } + + .site-icon__icon { + fill: currentColor; + height: 100%; + width: 100% + } +} + +.site-hub__title .components-button { + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + display: block; + flex-grow: 1; + font-size: var(--wpds-font-size-medium, 15px); + font-weight: var(--wpds-font-weight-medium, 500); + overflow: hidden; + // Add space for the ↗ to render. + padding-right: var(--wpds-spacing-40, 16px); + // Create 12px gap between site icon and site title + margin-left: -4px; + position: relative; + text-decoration: none; + text-overflow: ellipsis; + white-space: nowrap; + + &:hover, + &:focus, + &:active { + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + } + + &:focus { + // Defer to :focus-visible below. + box-shadow: none; + outline: none; + } + + &:focus-visible { + // Push the shadow away from the title. + box-shadow: 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e, + 0 0 0 calc(2 * var(--wp-admin-border-width-focus)) var(--wpds-color-stroke-focus-brand, #0675c4); + + // Windows High Contrast mode will show this outline, but not the box-shadow. + outline: 2px solid transparent; + outline-offset: 2px; + } + + // External link indicator + &::after { + content: "\2197"; + font-weight: 400; + opacity: 0; + position: absolute; + right: 0; + + @media not (prefers-reduced-motion) { + transition: opacity 0.1s linear; + } + } + + &:hover::after, + &:focus::after, + &:active::after { + opacity: 1; + } +} + +.site-hub__command-button { + color: var(--wpds-color-fg-inverted-secondary, #e0e0e0); + + &:hover, + &:active { + svg { + fill: var(--wpds-color-private-bg-fg-fill, #f0f0f0); + } + } +} diff --git a/src/social-web/components/themed-surface/index.tsx b/src/social-web/components/themed-surface/index.tsx new file mode 100644 index 000000000..5c174df32 --- /dev/null +++ b/src/social-web/components/themed-surface/index.tsx @@ -0,0 +1,24 @@ +/** + * ThemedSurface Component + * + * This component wraps content with appropriate theme context for consistent styling. + */ + +import { ReactNode } from 'react'; +import clsx from 'clsx'; +import './style.scss'; + +interface ThemedSurfaceProps { + className?: string; + children: ReactNode; +} + +/** + * ThemedSurface component + * + * Wraps content in a themed surface with light background. + * Uses wpds design tokens that are provided by ThemeProvider context. + */ +export default function ThemedSurface( { className, children }: ThemedSurfaceProps ) { + return
{ children }
; +} diff --git a/src/social-web/components/themed-surface/style.scss b/src/social-web/components/themed-surface/style.scss new file mode 100644 index 000000000..96b78333d --- /dev/null +++ b/src/social-web/components/themed-surface/style.scss @@ -0,0 +1,16 @@ +/** + * ThemedSurface styles + * + * Provides themed container for light content areas. + * Uses wpds tokens directly for consistent theming. + */ + +.themed-surface { + background: var(--wpds-color-bg-surface-neutral-strong, #ffffff); + border-radius: var(--wpds-border-radius-large, 8px); + overflow: hidden; + display: flex; + flex-direction: column; + flex: 1; + min-height: 0; +} diff --git a/src/social-web/contexts/settings-context.tsx b/src/social-web/contexts/settings-context.tsx new file mode 100644 index 000000000..62827a877 --- /dev/null +++ b/src/social-web/contexts/settings-context.tsx @@ -0,0 +1,24 @@ +/** + * WordPress dependencies + */ +import { createContext, useContext } from '@wordpress/element'; +import type { ReactNode } from 'react'; + +/** + * Internal dependencies + */ +import type { SocialWebSettings } from '../types'; + +const SettingsContext = createContext< SocialWebSettings | undefined >( undefined ); + +export function SettingsProvider( { children, settings }: { children: ReactNode; settings: SocialWebSettings } ) { + return { children }; +} + +export function useSettings() { + const settings = useContext( SettingsContext ); + if ( ! settings ) { + throw new Error( 'useSettings must be used within a SettingsProvider' ); + } + return settings; +} diff --git a/src/social-web/hooks/use-followers.ts b/src/social-web/hooks/use-followers.ts new file mode 100644 index 000000000..a70ae93dc --- /dev/null +++ b/src/social-web/hooks/use-followers.ts @@ -0,0 +1,70 @@ +/** + * WordPress dependencies + */ +import { useEntityRecords } from '@wordpress/core-data'; +import { useMemo } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import type { Actor } from '../types'; + +interface UseFollowersParams { + perPage?: number; + page?: number; + orderBy?: string; + order?: 'asc' | 'desc'; + search?: string; + userId?: number; + fields?: string[]; +} + +interface UseFollowersReturn { + followers: Actor[]; + hasResolved: boolean; + isResolving: boolean; + totalItems: number | null; + totalPages: number | null; +} + +export function useFollowers( { + perPage = 20, + page = 1, + orderBy = 'modified', + order = 'desc', + search = '', + userId, + fields = [ 'id', 'date', 'modified', 'slug', 'title', 'meta', 'actor_info', 'follow_status' ], +}: UseFollowersParams = {} ): UseFollowersReturn { + const queryArgs = useMemo( () => { + const args: any = { + per_page: perPage, + page, + orderby: orderBy, + order, + search, + _fields: fields, + }; + + // Only add follower_of if userId is provided + if ( userId ) { + args.follower_of = userId; + } + + return args; + }, [ perPage, page, orderBy, order, search, userId, fields ] ); + + const { records, hasResolved, isResolving, totalItems, totalPages } = useEntityRecords< Actor >( + 'postType', + 'ap_actor', + queryArgs + ); + + return { + followers: records || [], + hasResolved, + isResolving, + totalItems, + totalPages, + }; +} diff --git a/src/social-web/hooks/use-social-web-data.ts b/src/social-web/hooks/use-social-web-data.ts new file mode 100644 index 000000000..13945612e --- /dev/null +++ b/src/social-web/hooks/use-social-web-data.ts @@ -0,0 +1,164 @@ +/** + * WordPress dependencies + */ +import { useSelect, useDispatch } from '@wordpress/data'; +import { useEffect, useMemo } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import { STORE_NAME } from '../store'; +import type { Follower, Following, Interaction } from '../types'; + +interface SocialWebData { + following: Following[]; + interactions: Interaction[]; + stats: { + following: number; + interactions: number; + posts: number; + }; + isLoading: { + following: boolean; + interactions: boolean; + }; +} + +interface SocialWebActions { + fetchFollowing: () => void; + fetchInteractions: () => void; +} + +/** + * Hook to access Social Web data and actions (full version - internal) + */ +function useSocialWebDataFull(): SocialWebData & SocialWebActions { + const following = useSelect( ( select ) => { + const store = select( STORE_NAME ) as any; + return store.getFollowing() as Following[]; + }, [] ); + + const interactions = useSelect( ( select ) => { + const store = select( STORE_NAME ) as any; + return store.getInteractions() as Interaction[]; + }, [] ); + + const stats = useSelect( ( select ) => { + const store = select( STORE_NAME ) as any; + return store.getStats() as { + following: number; + interactions: number; + posts: number; + }; + }, [] ); + + const isLoadingFollowing = useSelect( ( select ) => { + const store = select( STORE_NAME ) as any; + return store.isLoading( 'following' ) as boolean; + }, [] ); + + const isLoadingInteractions = useSelect( ( select ) => { + const store = select( STORE_NAME ) as any; + return store.isLoading( 'interactions' ) as boolean; + }, [] ); + + const { fetchFollowing, fetchInteractions } = useDispatch( STORE_NAME ) as any; + + // Fetch initial data + useEffect( () => { + // fetchFollowing(); + // fetchInteractions(); + }, [] ); + + // Memoize the isLoading object to prevent re-renders + const isLoading = useMemo( + () => ( { + following: isLoadingFollowing, + interactions: isLoadingInteractions, + } ), + [ isLoadingFollowing, isLoadingInteractions ] + ); + + return { + following, + interactions, + stats, + isLoading, + fetchFollowing, + fetchInteractions, + }; +} + +/** + * Hook to access Social Web data with optional resource filtering + */ +export function useSocialWebData( + resource?: 'following' | 'interactions', + id?: string +): { + items: any; + isLoading: boolean; +} { + const allData = useSocialWebDataFull(); + + if ( ! resource ) { + // Return all data if no resource specified + return { + items: allData, + isLoading: false, + }; + } + + if ( id ) { + // Return single item + const item = useSelect( + ( select ) => { + const store = select( STORE_NAME ) as any; + if ( resource === 'following' ) { + return store.getFollowingById( id ) as Following | undefined; + } else if ( resource === 'interactions' ) { + return store.getInteractionById( id ) as Interaction | undefined; + } + return null; + }, + [ resource, id ] + ); + + return { + items: item, + isLoading: allData.isLoading[ resource ], + }; + } + + // Return list of items for the resource + return { + items: allData[ resource ], + isLoading: allData.isLoading[ resource ], + }; +} + +/** + * Hook to get a specific following by ID + */ +export function useFollowing( id: string ): Following | undefined { + return useSelect( + ( select ) => { + const store = select( STORE_NAME ) as any; + return store.getFollowingById( id ) as Following | undefined; + }, + [ id ] + ); +} + +/** + * Hook to get a specific interaction by ID + */ +export function useInteraction( id: string ): Interaction | undefined { + return useSelect( + ( select ) => { + const store = select( STORE_NAME ) as any; + return store.getInteractionById( id ) as Interaction | undefined; + }, + [ id ] + ); +} diff --git a/src/social-web/index.tsx b/src/social-web/index.tsx new file mode 100644 index 000000000..8c3054a57 --- /dev/null +++ b/src/social-web/index.tsx @@ -0,0 +1,57 @@ +/** + * WordPress dependencies + */ +import React from 'react'; +import { createRoot } from '@wordpress/element'; +import { SlotFillProvider } from '@wordpress/components'; +import { ShortcutProvider } from '@wordpress/keyboard-shortcuts'; + +/** + * Internal dependencies + */ +import { Layout } from './components/layout'; +import { SettingsProvider } from './contexts/settings-context'; +import type { SocialWebSettings } from './types'; +import './store'; // Import to register the store +import './style.scss'; // Import all styles + +/** + * Initialize the Social Web application. + * + * @param id The ID of the root element. + * @param settings The editor settings. + */ +export function initialize( id: string, settings: SocialWebSettings ): void { + const target = document.getElementById( id ); + if ( ! target ) { + return; + } + + const root = createRoot( target ); + root.render( + + + + + + + + ); +} + +// Extend Window interface for type safety. +declare global { + interface Window { + wp: { + activitypubSocialWeb?: { + initialize: typeof initialize; + }; + }; + } +} + +// Export to window for inline script access. +window.wp = window.wp || {}; +window.wp.activitypubSocialWeb = { initialize }; + +export type { SocialWebSettings }; diff --git a/src/social-web/routes/dashboard/stage.tsx b/src/social-web/routes/dashboard/stage.tsx new file mode 100644 index 000000000..a713f09c5 --- /dev/null +++ b/src/social-web/routes/dashboard/stage.tsx @@ -0,0 +1,53 @@ +/** + * Dashboard Stage + * + * Main dashboard view showing overview statistics + */ + +import { Card, CardBody } from '@wordpress/components'; +import { Page } from '../../components/page'; +import { useSocialWebData } from '../../hooks/use-social-web-data'; + +export default function DashboardStage() { + const { items: followers } = useSocialWebData( 'followers' ); + const { items: following } = useSocialWebData( 'following' ); + const { items: interactions } = useSocialWebData( 'interactions' ); + + return ( + +
+ + +

Followers

+

{ followers?.length || 0 }

+
+
+ + + +

Following

+

{ following?.length || 0 }

+
+
+ + + +

Interactions

+

{ interactions?.length || 0 }

+
+
+
+
+ ); +} diff --git a/src/social-web/routes/dashboard/types.ts b/src/social-web/routes/dashboard/types.ts new file mode 100644 index 000000000..5e0175194 --- /dev/null +++ b/src/social-web/routes/dashboard/types.ts @@ -0,0 +1,13 @@ +/** + * Type definitions for the Dashboard route + */ + +/** + * Dashboard stats type + */ +export interface DashboardStats { + followers: number; + following: number; + interactions: number; + posts: number; +} diff --git a/src/social-web/routes/followers/FollowerActions.tsx b/src/social-web/routes/followers/FollowerActions.tsx new file mode 100644 index 000000000..61919d288 --- /dev/null +++ b/src/social-web/routes/followers/FollowerActions.tsx @@ -0,0 +1,126 @@ +/** + * Action handlers for follower management. + */ + +import apiFetch from '@wordpress/api-fetch'; +import { dispatch } from '@wordpress/data'; +import { store as noticesStore } from '@wordpress/notices'; +import { __, _n } from '@wordpress/i18n'; +import type { Action } from '@wordpress/dataviews'; +import type { Actor } from '../../types'; + +// Get dispatch functions and namespace once for all action handlers +const { createSuccessNotice, createErrorNotice } = dispatch( noticesStore ); +const coreDispatch = dispatch( 'core' ) as any; +const namespace = 'activitypub/1.0'; // Standard ActivityPub REST API namespace + +/** + * Delete follower action handler. + */ +export async function deleteFollower( items: Actor[] ): Promise< void > { + try { + // Delete each follower relationship. + const deletePromises = items.map( ( item ) => + apiFetch( { + path: `/${ namespace }/admin/actors/${ item.id }/unfollow`, + method: 'DELETE', + } ) + ); + + await Promise.all( deletePromises ); + + // Refresh the entity records. + coreDispatch.invalidateResolutionForStoreSelector( 'getEntityRecords' ); + + await createSuccessNotice( _n( 'Follower removed.', 'Followers removed.', items.length, 'activitypub' ), { + type: 'snackbar', + } ); + } catch ( error ) { + await createErrorNotice( __( 'Failed to remove followers.', 'activitypub' ), { type: 'snackbar' } ); + } +} + +/** + * Block actor action handler. + */ +export async function blockActor( items: Actor[] ): Promise< void > { + try { + const blockPromises = items.map( ( item ) => + apiFetch( { + path: `/${ namespace }/admin/actors/${ item.id }/block`, + method: 'POST', + data: { + site_wide: false, // User-specific block by default + }, + } ) + ); + + await Promise.all( blockPromises ); + + // Refresh the entity records. + coreDispatch.invalidateResolutionForStoreSelector( 'getEntityRecords' ); + + await createSuccessNotice( _n( 'Account blocked.', 'Accounts blocked.', items.length, 'activitypub' ), { + type: 'snackbar', + } ); + } catch ( error ) { + await createErrorNotice( __( 'Failed to block accounts.', 'activitypub' ), { type: 'snackbar' } ); + } +} + +/** + * Follow back action handler. + */ +export async function follow( items: Actor[] ): Promise< void > { + try { + const followPromises = items.map( ( item ) => + apiFetch( { + path: `/${ namespace }/admin/actors/${ item.id }/follow`, + method: 'POST', + } ) + ); + + await Promise.all( followPromises ); + + // Refresh the entity records. + coreDispatch.invalidateResolutionForStoreSelector( 'getEntityRecords' ); + + await createSuccessNotice( _n( 'Account followed.', 'Accounts followed.', items.length, 'activitypub' ), { + type: 'snackbar', + } ); + } catch ( error ) { + await createErrorNotice( __( 'Failed to follow accounts.', 'activitypub' ), { type: 'snackbar' } ); + } +} + +/** + * Get all available actions for the DataViews component. + */ +export function getFollowerActions(): Action< Actor >[] { + const followingEnabled = window.activityPubAdmin?.followingEnabled ?? false; + + const actions: Action< Actor >[] = [ + { + id: 'block', + label: __( 'Block', 'activitypub' ), + callback: blockActor, + }, + { + id: 'delete', + label: __( 'Remove', 'activitypub' ), + callback: deleteFollower, + }, + ]; + + // Add follow back action if following UI is enabled. + if ( followingEnabled ) { + actions.unshift( { + id: 'follow', + label: __( 'Follow Back', 'activitypub' ), + isEligible: ( item: Actor ) => ! item.follow_status?.follows_back, + callback: follow, + } ); + } + + return actions; +} diff --git a/src/social-web/routes/followers/stage.tsx b/src/social-web/routes/followers/stage.tsx new file mode 100644 index 000000000..431860d6a --- /dev/null +++ b/src/social-web/routes/followers/stage.tsx @@ -0,0 +1,117 @@ +/** + * Followers Stage + * + * Main followers list view with DataViews + */ + +/** + * WordPress dependencies + */ +import { useMemo } from '@wordpress/element'; +import { DataViews } from '@wordpress/dataviews'; +import { useView } from '@wordpress/views'; +import type { View, Field } from '@wordpress/dataviews'; +import { __ } from '@wordpress/i18n'; +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; + +/** + * Internal dependencies + */ +import { Page } from '../../components/page'; +import { useFollowers } from '../../hooks/use-followers'; +import { avatarField, nameField, webfingerField, modifiedField, followStatusField } from '../../components/fields'; +import { getFollowerActions } from './FollowerActions'; +import type { Actor } from '../../types'; +import './style.scss'; + +// Default view configuration +const DEFAULT_VIEW: View = { + type: 'table', + perPage: 20, + page: 1, + sort: { + field: 'modified', + direction: 'desc', + }, + search: '', + filters: [], + fields: [ 'webfinger', 'modified', 'follow_status' ], + layout: {}, + titleField: 'name', + mediaField: 'avatar', +}; + +// Default layouts for different view types +const defaultLayouts = { + table: { + fields: [ 'webfinger', 'modified', 'follow_status' ], + }, + grid: { + fields: [ 'webfinger' ], + mediaField: 'avatar', + primaryField: 'name', + }, +}; + +export default function FollowersStage() { + // Use the views hook to persist user preferences. + const { view, updateView } = useView( { + kind: 'postType', + name: 'ap_actor', + slug: 'followers', + defaultView: DEFAULT_VIEW, + } ); + + // Get current user ID from WordPress core + const currentUserId = useSelect( ( select ) => { + const { getCurrentUser } = select( coreStore ); + const currentUser = getCurrentUser(); + return currentUser?.id; + }, [] ); + + // Fetch followers using entity records + const { followers, isResolving, totalItems, totalPages } = useFollowers( { + perPage: view.perPage || 20, + page: view.page || 1, + orderBy: view.sort?.field || 'modified', + order: view.sort?.direction || 'desc', + search: view.search || '', + userId: currentUserId, + } ); + + // Define fields configuration + const fields: Field< Actor >[] = useMemo( + () => [ avatarField, nameField, webfingerField, modifiedField, followStatusField ], + [] + ); + + // Get actions + const actions = useMemo( () => getFollowerActions(), [] ); + + return ( + + item.id.toString() } + empty={ +

+ { view.search + ? __( 'No followers found.', 'activitypub' ) + : __( 'No followers.', 'activitypub' ) } +

+ } + paginationInfo={ { + totalItems, + totalPages, + } } + defaultLayouts={ defaultLayouts } + /> +
+ ); +} diff --git a/src/social-web/routes/followers/style.scss b/src/social-web/routes/followers/style.scss new file mode 100644 index 000000000..bbdd62fd6 --- /dev/null +++ b/src/social-web/routes/followers/style.scss @@ -0,0 +1 @@ +@use "@wordpress/dataviews/build-style/style.css"; diff --git a/src/social-web/routes/followers/types.ts b/src/social-web/routes/followers/types.ts new file mode 100644 index 000000000..ee0157f65 --- /dev/null +++ b/src/social-web/routes/followers/types.ts @@ -0,0 +1,8 @@ +/** + * Type definitions for the Followers route + */ + +/** + * Re-export shared types for convenience + */ +export type { Follower, Actor, ActorInfo, FollowStatus } from '../../types'; diff --git a/src/social-web/routes/following/inspector.tsx b/src/social-web/routes/following/inspector.tsx new file mode 100644 index 000000000..fca979c9a --- /dev/null +++ b/src/social-web/routes/following/inspector.tsx @@ -0,0 +1,29 @@ +/** + * Following Inspector + * + * Detail view for a followed account + */ + +import { Button } from '@wordpress/components'; +import { Page } from '../../components/page'; + +interface FollowingInspectorProps { + id: string; + onClose: () => void; +} + +export default function FollowingInspector( { id, onClose }: FollowingInspectorProps ) { + return ( + + Close + + } + > +

Following details for ID: { id }

+
+ ); +} diff --git a/src/social-web/routes/following/stage.tsx b/src/social-web/routes/following/stage.tsx new file mode 100644 index 000000000..70524f6c4 --- /dev/null +++ b/src/social-web/routes/following/stage.tsx @@ -0,0 +1,19 @@ +/** + * Following Stage + * + * Main following list view + */ + +import { Page } from '../../components/page'; + +interface FollowingStageProps { + onSelectItem: ( id: string ) => void; +} + +export default function FollowingStage( { onSelectItem }: FollowingStageProps ) { + return ( + +

Following list coming soon...

+
+ ); +} diff --git a/src/social-web/routes/following/types.ts b/src/social-web/routes/following/types.ts new file mode 100644 index 000000000..88f3fecc7 --- /dev/null +++ b/src/social-web/routes/following/types.ts @@ -0,0 +1,8 @@ +/** + * Type definitions for the Following route + */ + +/** + * Re-export shared types for convenience + */ +export type { Following } from '../../types'; diff --git a/src/social-web/routes/interactions/inspector.tsx b/src/social-web/routes/interactions/inspector.tsx new file mode 100644 index 000000000..a91e24b98 --- /dev/null +++ b/src/social-web/routes/interactions/inspector.tsx @@ -0,0 +1,29 @@ +/** + * Interaction Inspector + * + * Detail view for a single interaction + */ + +import { Button } from '@wordpress/components'; +import { Page } from '../../components/page'; + +interface InteractionInspectorProps { + id: string; + onClose: () => void; +} + +export default function InteractionInspector( { id, onClose }: InteractionInspectorProps ) { + return ( + + Close + + } + > +

Interaction details for ID: { id }

+
+ ); +} diff --git a/src/social-web/routes/interactions/stage.tsx b/src/social-web/routes/interactions/stage.tsx new file mode 100644 index 000000000..cd489152e --- /dev/null +++ b/src/social-web/routes/interactions/stage.tsx @@ -0,0 +1,24 @@ +/** + * Interactions Stage + * + * Main interactions list view + */ + +import { Page } from '../../components/page'; + +interface InteractionsStageProps { + onSelectItem: ( id: string ) => void; +} + +export default function InteractionsStage( { onSelectItem }: InteractionsStageProps ) { + return ( + +

Interactions list coming soon...

+
+ ); +} diff --git a/src/social-web/routes/interactions/types.ts b/src/social-web/routes/interactions/types.ts new file mode 100644 index 000000000..df8cc70ac --- /dev/null +++ b/src/social-web/routes/interactions/types.ts @@ -0,0 +1,8 @@ +/** + * Type definitions for the Interactions route + */ + +/** + * Re-export shared types for convenience + */ +export type { Interaction } from '../../types'; diff --git a/src/social-web/store/actions.ts b/src/social-web/store/actions.ts new file mode 100644 index 000000000..ec24243ec --- /dev/null +++ b/src/social-web/store/actions.ts @@ -0,0 +1,65 @@ +/** + * WordPress dependencies + */ +import apiFetch from '@wordpress/api-fetch'; + +/** + * Internal dependencies + */ +import type { Follower, Following, Interaction } from '../types'; +import type { SetFollowersAction, SetFollowingAction, SetInteractionsAction, SetLoadingAction, State } from './types'; + +/** + * Store actions + */ +export const actions = { + setFollowing( following: Following[] ): SetFollowingAction { + return { + type: 'SET_FOLLOWING', + following, + }; + }, + + setInteractions( interactions: Interaction[] ): SetInteractionsAction { + return { + type: 'SET_INTERACTIONS', + interactions, + }; + }, + + setLoading( resource: keyof State[ 'isLoading' ], isLoading: boolean ): SetLoadingAction { + return { + type: 'SET_LOADING', + resource, + isLoading, + }; + }, + + *fetchFollowing() { + yield actions.setLoading( 'following', true ); + try { + const following = yield apiFetch( { + path: '/activitypub/v1/following', + } ); + yield actions.setFollowing( following as Following[] ); + } catch ( error ) { + console.error( 'Failed to fetch following:', error ); + } finally { + yield actions.setLoading( 'following', false ); + } + }, + + *fetchInteractions() { + yield actions.setLoading( 'interactions', true ); + try { + const interactions = yield apiFetch( { + path: '/activitypub/v1/interactions', + } ); + yield actions.setInteractions( interactions as Interaction[] ); + } catch ( error ) { + console.error( 'Failed to fetch interactions:', error ); + } finally { + yield actions.setLoading( 'interactions', false ); + } + }, +}; diff --git a/src/social-web/store/index.ts b/src/social-web/store/index.ts new file mode 100644 index 000000000..35733be4c --- /dev/null +++ b/src/social-web/store/index.ts @@ -0,0 +1,34 @@ +/** + * WordPress dependencies + */ +import { createReduxStore, register } from '@wordpress/data'; +import { controls as dataControls } from '@wordpress/data-controls'; + +/** + * Internal dependencies + */ +import { actions } from './actions'; +import { selectors } from './selectors'; +import { reducer } from './reducer'; + +/** + * Store name + */ +export const STORE_NAME = 'activitypub/social-web'; + +/** + * Create and register the store + */ +export const store = createReduxStore( STORE_NAME, { + reducer, + actions, + selectors, + controls: dataControls, +} ); + +register( store ); + +/** + * Re-export types for convenience + */ +export type { State } from './types'; diff --git a/src/social-web/store/reducer.ts b/src/social-web/store/reducer.ts new file mode 100644 index 000000000..cfb88af20 --- /dev/null +++ b/src/social-web/store/reducer.ts @@ -0,0 +1,36 @@ +/** + * Internal dependencies + */ +import type { State, Action } from './types'; +import { DEFAULT_STATE } from './types'; + +/** + * Store reducer + */ +export function reducer( state = DEFAULT_STATE, action: Action ): State { + switch ( action.type ) { + case 'SET_FOLLOWING': + return { + ...state, + following: action.following, + }; + + case 'SET_INTERACTIONS': + return { + ...state, + interactions: action.interactions, + }; + + case 'SET_LOADING': + return { + ...state, + isLoading: { + ...state.isLoading, + [ action.resource ]: action.isLoading, + }, + }; + + default: + return state; + } +} diff --git a/src/social-web/store/selectors.ts b/src/social-web/store/selectors.ts new file mode 100644 index 000000000..89b651239 --- /dev/null +++ b/src/social-web/store/selectors.ts @@ -0,0 +1,38 @@ +/** + * Internal dependencies + */ +import type { Follower, Following, Interaction } from '../types'; +import type { State } from './types'; + +/** + * Store selectors + */ +export const selectors = { + getFollowing( state: State ): Following[] { + return state.following; + }, + + getFollowingById( state: State, id: string ): Following | undefined { + return state.following.find( ( following ) => following.id === id ); + }, + + getInteractions( state: State ): Interaction[] { + return state.interactions; + }, + + getInteractionById( state: State, id: string ): Interaction | undefined { + return state.interactions.find( ( interaction ) => interaction.id === id ); + }, + + isLoading( state: State, resource: keyof State[ 'isLoading' ] ): boolean { + return state.isLoading[ resource ]; + }, + + getStats( state: State ) { + return { + following: state.following.length, + interactions: state.interactions.length, + posts: 0, // This would come from a different endpoint + }; + }, +}; diff --git a/src/social-web/store/types.ts b/src/social-web/store/types.ts new file mode 100644 index 000000000..aaa1273b8 --- /dev/null +++ b/src/social-web/store/types.ts @@ -0,0 +1,49 @@ +/** + * Internal dependencies + */ +import type { Following, Interaction } from '../types'; + +/** + * Store state interface + */ +export interface State { + following: Following[]; + interactions: Interaction[]; + isLoading: { + following: boolean; + interactions: boolean; + }; +} + +/** + * Action Types + */ +export type SetFollowingAction = { + type: 'SET_FOLLOWING'; + following: Following[]; +}; + +export type SetInteractionsAction = { + type: 'SET_INTERACTIONS'; + interactions: Interaction[]; +}; + +export type SetLoadingAction = { + type: 'SET_LOADING'; + resource: keyof State[ 'isLoading' ]; + isLoading: boolean; +}; + +export type Action = SetFollowingAction | SetInteractionsAction | SetLoadingAction; + +/** + * Initial state + */ +export const DEFAULT_STATE: State = { + following: [], + interactions: [], + isLoading: { + following: false, + interactions: false, + }, +}; diff --git a/src/social-web/style.scss b/src/social-web/style.scss new file mode 100644 index 000000000..eafb69b35 --- /dev/null +++ b/src/social-web/style.scss @@ -0,0 +1,20 @@ +/** + * Main stylesheet entry point for Social Web + * This compiles to style-index.css + */ + +// Import global styles (design tokens, body styles, root element) +@use './styles/design-tokens.scss'; + +// Main layout container. +.activitypub-social-web-layout { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +#wpfooter { + display: none; +} diff --git a/src/social-web/styles/design-tokens.scss b/src/social-web/styles/design-tokens.scss new file mode 100644 index 000000000..d5a1f49c7 --- /dev/null +++ b/src/social-web/styles/design-tokens.scss @@ -0,0 +1,12 @@ +/** + * Design Tokens for ActivityPub Social Web + * + * Uses wpds design tokens directly for colors, spacing, typography, etc. + * Only defines app-specific layout dimensions. + */ + +:root { + /* Layout dimensions (app-specific) */ + --sw-sidebar-width: 300px; + --sw-inspector-width: 380px; +} diff --git a/src/social-web/tsconfig.json b/src/social-web/tsconfig.json new file mode 100644 index 000000000..6991cdc12 --- /dev/null +++ b/src/social-web/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "esnext", + "lib": [ "ES2020", "DOM" ], + "jsx": "react-jsx", + "jsxImportSource": "react", + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + "strict": false, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "noEmit": true, + "baseUrl": ".", + "paths": { + "@wordpress/*": [ "../../node_modules/@wordpress/*/src" ] + }, + "typeRoots": [ "../../node_modules/@types", "./types" ] + }, + "include": [ "**/*.ts", "**/*.tsx", "types/**/*.d.ts" ], + "exclude": [ "node_modules", "build" ] +} diff --git a/src/social-web/types.ts b/src/social-web/types.ts new file mode 100644 index 000000000..02e945df6 --- /dev/null +++ b/src/social-web/types.ts @@ -0,0 +1,85 @@ +/** + * Type definitions for Social Web + */ + +export interface SocialWebSettings { + adminUrl: string; + defaultAvatar: string; + nonce: string; + restUrl: string; + siteTitle: string; + siteUrl: string; +} + +export interface Follower { + id: string; + actor: string; + name: string; + username: string; + avatar: string; + url: string; + created: string; + modified: string; + errors?: number; + inbox?: string; + shared_inbox?: string; +} + +// New types for entity records implementation +export interface ActorInfo { + username: string; + name: string; + icon: string; + url: string; + webfinger: string; + identifier: string; +} + +export interface FollowStatus { + follows_back: boolean; +} + +export interface Actor { + id: number; + date: string; + date_gmt: string; + guid: { rendered: string }; + modified: string; + modified_gmt: string; + slug: string; + status: string; + type: string; + link: string; + title: { rendered: string }; + content: { rendered: string; protected: boolean }; + meta: { + _activitypub_following: string[]; + [ key: string ]: any; + }; + actor_info?: ActorInfo; + follow_status?: FollowStatus; + activitypub_json?: string; +} + +export interface Following { + id: string; + actor: string; + name: string; + username: string; + avatar: string; + url: string; + created: string; + modified: string; +} + +export interface Interaction { + id: string; + type: 'mention' | 'reply' | 'like' | 'announce'; + actor: string; + actorName: string; + actorAvatar: string; + content: string; + url: string; + created: string; + object?: string; +} diff --git a/src/social-web/types/store.d.ts b/src/social-web/types/store.d.ts new file mode 100644 index 000000000..d3707f627 --- /dev/null +++ b/src/social-web/types/store.d.ts @@ -0,0 +1,35 @@ +/** + * Type declarations for the social-web store + */ + +import { Follower, Following, Interaction } from '../types'; + +declare module '@wordpress/data' { + function select( key: 'activitypub/social-web' ): { + getFollowers(): Follower[]; + getFollowerById( id: string ): Follower | undefined; + getFollowing(): Following[]; + getFollowingById( id: string ): Following | undefined; + getInteractions(): Interaction[]; + getInteractionById( id: string ): Interaction | undefined; + isLoading( resource: 'followers' | 'following' | 'interactions' ): boolean; + getStats(): { + followers: number; + following: number; + interactions: number; + posts: number; + }; + }; + + function dispatch( key: 'activitypub/social-web' ): { + setFollowers( followers: Follower[] ): void; + setFollowing( following: Following[] ): void; + setInteractions( interactions: Interaction[] ): void; + setLoading( resource: 'followers' | 'following' | 'interactions', isLoading: boolean ): void; + fetchFollowers(): void; + fetchFollowing(): void; + fetchInteractions(): void; + blockFollower( followerId: string ): void; + removeFollower( followerId: string ): void; + }; +} diff --git a/src/social-web/types/wordpress__admin-ui.d.ts b/src/social-web/types/wordpress__admin-ui.d.ts new file mode 100644 index 000000000..ed7837144 --- /dev/null +++ b/src/social-web/types/wordpress__admin-ui.d.ts @@ -0,0 +1,18 @@ +/** + * Type declarations for @wordpress/admin-ui + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/admin-ui' { + import { ComponentType, ReactNode } from 'react'; + + export interface NavigableRegionProps { + children: ReactNode; + className?: string; + ariaLabel?: string; + } + + export const NavigableRegion: ComponentType< NavigableRegionProps >; +} diff --git a/src/social-web/types/wordpress__commands.d.ts b/src/social-web/types/wordpress__commands.d.ts new file mode 100644 index 000000000..a3e5968bb --- /dev/null +++ b/src/social-web/types/wordpress__commands.d.ts @@ -0,0 +1,41 @@ +/** + * Type declarations for @wordpress/commands + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/commands' { + import { ComponentType, ReactNode } from 'react'; + import { StoreDescriptor } from '@wordpress/data'; + + export interface Command { + name: string; + label: string; + icon?: ReactNode; + callback?: ( { close }: { close: () => void } ) => void; + context?: string; + } + + export interface CommandsState { + commands: Command[]; + isOpen: boolean; + } + + export interface CommandsActions { + registerCommand: ( command: Command ) => void; + unregisterCommand: ( commandName: string ) => void; + open: () => void; + close: () => void; + toggle: () => void; + } + + export interface CommandsSelectors { + getCommands: () => Command[]; + isOpen: () => boolean; + } + + export const store: StoreDescriptor< CommandsState, CommandsActions, CommandsSelectors >; + + export const CommandMenu: ComponentType< {} >; +} diff --git a/src/social-web/types/wordpress__core-commands.d.ts b/src/social-web/types/wordpress__core-commands.d.ts new file mode 100644 index 000000000..254c14f96 --- /dev/null +++ b/src/social-web/types/wordpress__core-commands.d.ts @@ -0,0 +1,14 @@ +/** + * Type declarations for @wordpress/core-commands + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/core-commands' { + export interface PrivateApis { + useCommands: () => void; + } + + export const privateApis: PrivateApis; +} diff --git a/src/social-web/types/wordpress__icons.d.ts b/src/social-web/types/wordpress__icons.d.ts new file mode 100644 index 000000000..b039331af --- /dev/null +++ b/src/social-web/types/wordpress__icons.d.ts @@ -0,0 +1,30 @@ +/** + * Type declarations for @wordpress/icons + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/icons' { + import { ReactElement } from 'react'; + + // ReactElements used in the project. + export const addCard: ReactElement; + export const arrowLeft: ReactElement; + export const chartBar: ReactElement; + export const chevronLeft: ReactElement; + export const chevronLeftSmall: ReactElement; + export const chevronRight: ReactElement; + export const chevronRightSmall: ReactElement; + export const close: ReactElement; + export const comment: ReactElement; + export const commentContent: ReactElement; + export const cog: ReactElement; + export const group: ReactElement; + export const home: ReactElement; + export const people: ReactElement; + export const postList: ReactElement; + export const search: ReactElement; + export const trendingUp: ReactElement; + export const wordpress: ReactElement; +} diff --git a/src/social-web/types/wordpress__interface.d.ts b/src/social-web/types/wordpress__interface.d.ts new file mode 100644 index 000000000..a8cbd0d50 --- /dev/null +++ b/src/social-web/types/wordpress__interface.d.ts @@ -0,0 +1,29 @@ +/** + * Type declarations for @wordpress/interface + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/interface' { + import { ComponentType, ReactNode } from 'react'; + + export interface InterfaceSkeletonProps { + content?: ReactNode; + className?: string; + header?: ReactNode; + sidebar?: ReactNode; + secondarySidebar?: ReactNode; + footer?: ReactNode; + actions?: ReactNode; + labels?: { + header?: string; + body?: string; + sidebar?: string; + actions?: string; + footer?: string; + }; + } + + export const InterfaceSkeleton: ComponentType< InterfaceSkeletonProps >; +} diff --git a/src/social-web/types/wordpress__keyboard-shortcuts.d.ts b/src/social-web/types/wordpress__keyboard-shortcuts.d.ts new file mode 100644 index 000000000..6a23fe46e --- /dev/null +++ b/src/social-web/types/wordpress__keyboard-shortcuts.d.ts @@ -0,0 +1,40 @@ +/** + * Type declarations for @wordpress/keyboard-shortcuts + * + * This package doesn't ship with TypeScript definitions, + * so we declare the types we need here. + */ + +declare module '@wordpress/keyboard-shortcuts' { + import { ComponentType, ReactNode } from 'react'; + + export interface ShortcutProviderProps { + children: ReactNode; + } + + export const ShortcutProvider: ComponentType< ShortcutProviderProps >; + + export interface ShortcutConfig { + name: string; + category: string; + description: string; + keyCombination: { + modifier?: string; + character: string; + }; + aliases?: Array< { + modifier?: string; + character: string; + } >; + } + + export function useShortcut( + name: string, + callback: ( event: KeyboardEvent ) => void, + options?: { + bindGlobal?: boolean; + eventName?: 'keydown' | 'keypress' | 'keyup'; + isDisabled?: boolean; + } + ): void; +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 000000000..1061dc793 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,40 @@ +/** + * Custom webpack configuration extending WordPress Scripts + * + * This configuration: + * - Properly names and places vendor chunks in the social-web directory + */ + +const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); + +// WordPress Scripts might return different configs for different commands +// We need to handle both single config and array of configs +const processConfig = ( config ) => { + return { + ...config, + optimization: { + ...config.optimization, + splitChunks: { + ...( config.optimization?.splitChunks || {} ), + cacheGroups: { + ...( config.optimization?.splitChunks?.cacheGroups || {} ), + // Vendor chunk for social-web modules + socialWebVendors: { + test: /[\\/]node_modules[\\/]/, + name: 'social-web/vendors', + chunks( chunk ) { + // Only include in this vendor bundle if the chunk is from social-web + return chunk.name && chunk.name.startsWith( 'social-web/' ); + }, + priority: 20, // Higher priority to override default + reuseExistingChunk: true, + enforce: true, // Force this configuration + }, + }, + }, + }, + }; +}; + +// Handle both single config object and array of configs +module.exports = Array.isArray( defaultConfig ) ? defaultConfig.map( processConfig ) : processConfig( defaultConfig );