PageSourceSearch

https://proscenium.com/assets/ContentPagesList-zmpXyx0D.js

js proscenium.com collected 2026-09-25 02:50:07 UTC 17,112 bytes, 22 lines download raw bytes

1import{f as T,Y as ge,u as be,r as v,i as ve,_ as z,g as P,j as t,a0 as Q,e as ae,B as M,b as h,U as ye,I as je,S as _e,K as Ne,M as we,Q as Se,R as F,a1 as Ce,C as ze,V as Me,k as ne,s as y,a2 as ke}from"./index-DqMpV26W.js";import{b as ce,u as De,a as oe,D as Le,S as Ie,v as Pe,c as Ee,C as Ae,s as Fe,K as Te,P as $e}from"./sortable.esm-oED2UgsG.js";import{D as Oe,a as Re,b as Ke,c as j,A as qe,d as Ue,e as Qe}from"./dropdown-menu-BsCB9QJz.js";import{E as Be}from"./external-link-C-5A7byR.js";import{L as Ge}from"./list-ordered-C24EBiqS.js";import{T as Ve}from"./trash-2-u4PMWF1S.js";import{P as He}from"./plus-CGnQ1crT.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const We=T("ArrowDownToLine",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ye=T("ArrowUpToLine",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Ze=T("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ie=T("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),le={blog_post:"blog_posts",podcast_episode:"podcast_episodes",case_study:"case_studies"},Je={blog_post:"insight",podcast_episode:"episode",case_study:"case study"},de=(r,n)=>r==="blog_post"?`/insights/${n}`:r==="podcast_episode"?`/insights/procast/${n}`:`/our-work/${n}`,I=25,Xe={case_study:"All Work",podcast_episode:"the Insights episode list",blog_post:"the Insights article list"},et=(r,n)=>{const i=typeof r.sort_position=="number"&&r.sort_position>0?r.sort_position:1/0,d=typeof n.sort_position=="number"&&n.sort_position>0?n.sort_position:1/0;return i!==d?i-d:n.updated_at.localeCompare(r.updated_at)},tt=(r,n)=>{const i=typeof r.sort_position=="number"&&r.sort_position>0?r.sort_position:1/0,d=typeof n.sort_position=="number"&&n.sort_position>0?n.sort_position:1/0;return i!==d?i-d:(n.episode_number??0)-(r.episode_number??0)},ue=(r,n,i)=>{const d=r.findIndex(k=>k.id===n);if(d<0)return r;const x=Math.min(Math.max(1,Math.round(i)),r.length)-1;return x===d?r:ce(r,d,x)},st="grid grid-cols-[28px_minmax(0,1fr)_116px_104px_88px_32px] items-center gap-4 px-4",rt="grid grid-cols-[20px_28px_minmax(0,1fr)_116px_104px_88px_32px] items-center gap-4 px-4";function at({id:r,disabled:n,className:i,children:d}){const{attributes:x,listeners:k,setNodeRef:f,transform:$,transition:O,isDragging:D}=Ee({id:r,disabled:n});return t.jsxs("div",{ref:f,style:{transform:Ae.Transform.toString($),transition:O},className:P(i,D&&"opacity-60 relative z-10 bg-card"),children:[n?t.jsx("span",{"aria-hidden":!0}):t.jsx("button",{type:"button",title:"Drag to reorder",className:"cursor-grab touch-none justify-self-center rounded p-0.5 text-foreground/35 hover:text-foreground active:cursor-grabbing",...x,...k,children:t.jsx(Me,{className:"size-3.5"})}),d]})}const nt=({row:r})=>{const n=r.status==="live"&&!r.draft&&!r.archived,i=r.archived?"Archived":n?"Live":"Draft",d=r.archived?"bg-amber-500/70":n?"bg-[#5ad17e]":"bg-foreground
21/40";return t.jsxs("span",{className:"flex items-center gap-2 text-[12.5px] text-foreground/75",children:[t.jsx("span",{className:P("size-[7px] rounded-full shrink-0",d,n&&"shadow-[0_0_7px_rgba(90,209,126,0.6)]"),"aria-hidden":!0}),i]})},ot=({kind:r,title:n})=>{const i=ge(),d=be(),[x,k]=v.useState(""),[f,$]=v.useState("all"),[O,D]=v.useState(1),[_,E]=v.useState(new Set),g=le[r],R=Je[r],m=r==="case_study"||r==="podcast_episode"||r==="blog_post",B=m?rt:st,{data:l,isLoading:K}=ve({queryKey:["admin","pages",r],queryFn:async()=>{const e=r==="case_study"?"id, name, permalink, status, draft, archived, updated_at, sort_position":r==="podcast_episode"?"id, name, permalink, status, draft, archived, updated_at, sort_position, episode_number, featured_player, blocks":"id, name, permalink, status, draft, archived, updated_at, sort_position",{data:s,error:a}=await y.from(g).select(e).eq("deleted",!1).order("updated_at",{ascending:!1});if(a)throw a;return s??[]}}),u=v.useMemo(()=>!l||!m?l??[]:[...l].sort(r==="podcast_episode"?tt:et),[l,r,m]),xe=v.useMemo(()=>new Map(u.map((e,s)=>[e.id,s+1])),[u]),b=v.useMemo(()=>u.length?u.filter(e=>{if(f==="live"&&(e.status!=="live"||e.draft||e.archived)||f==="draft"&&(e.archived||e.status==="live"&&!e.draft)||f==="archived"&&!e.archived)return!1;if(x){const s=x.toLowerCase();if(!e.name.toLowerCase().includes(s)&&!e.permalink.toLowerCase().includes(s))return!1}return!0}):[],[u,f,x]),L=Math.max(1,Math.ceil(b.length/I)),N=Math.min(O,L),S=b.slice((N-1)*I,N*I);v.useEffect(()=>{D(1),E(new Set)},[x,f,r]);const G=e=>ne(r,e.id),V=S.length>0&&S.every(e=>_.has(e.id)),H=()=>{E(e=>{const s=new Set(e);return V?S.forEach(a=>s.delete(a.id)):S.forEach(a=>s.add(a.id)),s})},pe=e=>E(s=>{const a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a}),C=()=>i.invalidateQueries({queryKey:["admin","pages",r]}),W=()=>i.invalidateQueries({queryKey:["admin","nav-counts"]}),Y=z({mutationFn:async()=>{const e=Date.now(),{data:s,error:a}=await y.from(g).insert({name:"Untitled",permalink:`untitled-${e}`,status:"draft",draft:!0}).select().single();if(a)throw a;return{id:s.id}},onSuccess:({id:e})=>{C(),W(),d(ne(r,e))},onError:e=>h.error(e.message)}),q=z({mutationFn:async e=>{const{error:s}=await y.from(g).update({status:e.live?"live":"draft",draft:!e.live,published_at:e.live?new Date().toISOString():null}).in("id",e.ids);if(s)throw s},onSuccess:(e,s)=>{C(),h.success(s.live?"Published":"Unpublished")},onError:e=>h.error(e.message)}),Z=z({mutationFn:async e=>{const{error:s}=await y.from(g).update({archived:e.archived}).in("id",e.ids);if(s)throw s},onSuccess:()=>C(),onError:e=>h.error(e.message)}),J=z({mutationFn:async e=>{const{error:s}=await y.from(g).delete().in("id",e);if(s)throw s},onSuccess:(e,s)=>{C(),W(),E(new Set),h.success(`Deleted ${s.length}`)},onError:e=>h.error(e.message)}),he=De(oe($e,{activationConstraint:{distance:4}}),oe(Te,{coordinateGetter:Fe})),X=m&&x===""&&f==="all",ee=z({mutationFn:async e=>{const s=e.map((c,p)=>({id:c.id,position:p+1,changed:c.sort_position!==p+1})).filter(c=>c.changed),o=(await Promise.all(s.map(({id:c,position:p})=>y.from(g).update({sort_position:p}).eq("id",c)))).find(c=>c.error);if(o!=null&&o.error)throw o.error},onMutate:async e=>{await i.cancelQueries({queryKey:["admin","pages",r]});const s=new Map(e.map((a,o)=>[a.id,o+1]));i.setQueryData(["admin","pages",r],a=>a==null?void 0:a.map(o=>s.has(o.id)?{...o,sort_position:s.get(o.id)}:o))},onSettled:()=>{C(),i.invalidateQueries({queryKey:["public","pages"]})},onError:e=>h.error(e.message)}),me=({active:e,over:s})=>{if(!s||e.id===s.id)return;const a=u.findIndex(c=>c.id===e.id),o=u.findIndex(c=>c.id===s.id);a<0||o<0||ee.mutate(ce(u,a,o))},U=(e,s)=>{if(!m)return;const a=ue(u,e,s);a!==u&&ee.mutate(a)},fe=z({mutationFn:async e=>{const{error:s}=await y.from(g).update({featured_player:!1}).eq("featured_player",!0);if(s)throw s;if(e.on){const{error:a}=await y.from(g).update({featured_player:!0}).eq("id",e.id);if(a)throw a}},onSuccess:(e,s)=>{var a,o,c;if(C(),i.invalidateQueries({queryKey:["public","pages"]}),s.on){const p=(o=(a=l==null?void 0:l.find(w=>w.id===s.id))==null?void 0:a.blocks)==null?void 0:o.find(w=>(w==null?void 0:w.type)==="podcast_hero");if(!ke((c=p==null?void 0:p.props)==null?void 0:c.buzzsprout_id)){h.warning("Featured, but not playable yet",{description:"This episode has no Buzzsprout ID, so the Insights player will keep showing the newest playable episode until one is added (Buzzsprout → episode → Share & Embed)."});return}}h.success(s.on?"Featured in the Insights player":"Player back to newest episode")},onError:e=>h.error(e.message)}),A=[..._],te=S.map(e=>{const s=e.status==="live"&&!e.draft&&!e.archived,a=de(r,e.permalink),o=_.has(e.id),c=P(B,"h-[50px] border-b border-border/60 last:border-b-0 group transition-colors",o?"bg-foreground
21/[0.04]":"hover:bg-foreground/[0.025]"),p=t.jsxs(t.Fragment,{children:[t.jsx(Q,{checked:o,onCheckedChange:()=>pe(e.id),className:"rounded-[3px]","aria-label":`Select ${e.name}`}),t.jsxs("div",{className:"min-w-0",children:[t.jsxs(ae,{to:G(e),className:"block truncate text-[13px] text-foreground hover:text-accent transition-colors",children:[e.featured_player&&t.jsx(ie,{className:"mr-1.5 inline size-3 -translate-y-px fill-accent text-accent","aria-label":"Featured in the Insights player"}),e.name]}),t.jsx("span",{className:"block truncate text-[10.5px] font-mono text-foreground/40",children:e.permalink})]}),t.jsx(nt,{row:e}),t.jsx("span",{className:"text-[12px] text-foreground/50",children:new Date(e.updated_at).toLocaleDateString(void 0,{month:"short",day:"numeric"})}),t.jsx(M,{variant:"outline",size:"sm",className:"h-7 w-[84px] rounded-[4px] text-[11.5px] border-border bg-card/40 text-foreground/80",onClick:()=>q.mutate({ids:[e.id],live:!s}),children:s?"Unpublish":"Publish"}),t.jsxs(Oe,{children:[t.jsx(Re,{asChild:!0,children:t.jsx("button",{className:"size-7 inline-flex items-center justify-center rounded-[4px] text-foreground/40 hover:text-foreground hover:bg-foreground
21/[0.06] transition-colors","aria-label":"More actions",children:t.jsx(Ze,{className:"size-4"})})}),t.jsxs(Ke,{align:"end",className:"w-40",children:[t.jsx(j,{asChild:!0,children:t.jsx(ae,{to:G(e),children:"Edit"})}),s&&t.jsx(j,{asChild:!0,children:t.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"flex items-center gap-2",children:[t.jsx(Be,{className:"size-4"})," View live"]})}),m&&t.jsxs(t.Fragment,{children:[t.jsxs(j,{className:"flex items-center gap-2",onClick:()=>U(e.id,1),children:[t.jsx(Ye,{className:"size-4"})," Move to top"]}),t.jsxs(j,{className:"flex items-center gap-2",onClick:()=>U(e.id,u.length),children:[t.jsx(We,{className:"size-4"})," Move to bottom"]}),t.jsxs(j,{className:"flex items-center gap-2",onClick:()=>{const w=xe.get(e.id)??1,se=window.prompt(`Set list position (1–${u.length}). Lower shows earlier on ${r==="case_study"?"All Work":"Insights"}.`,String(w));if(se==null)return;const re=Number(se.trim());if(!Number.isFinite(re))return h.error("Enter a number.");U(e.id,re)},children:[t.jsx(Ge,{className:"size-4"})," Set position…"]})]}),r==="podcast_episode"&&t.jsxs(j,{className:"flex items-center gap-2",onClick:()=>fe.mutate({id:e.id,on:!e.featured_player}),children:[t.jsx(ie,{className:P("size-4",e.featured_player&&"fill-accent text-accent")}),e.featured_player?"Unfeature from player":"Feature in player"]}),t.jsxs(j,{onClick:()=>Z.mutate({ids:[e.id],archived:!e.archived}),className:"flex items-center gap-2",children:[e.archived?t.jsx(qe,{className:"size-4"}):t.jsx(Ue,{className:"size-4"}),e.archived?"Unarchive":"Archive"]}),t.jsx(Qe,{}),t.jsxs(j,{className:"flex items-center gap-2 text-destructive focus:text-destructive",onClick:()=>{confirm(`Permanently delete "${e.name}"? This removes it everywhere and can't be undone.`)&&J.mutate([e.id])},children:[t.jsx(Ve,{className:"size-4"})," Delete"]})]})]})]});return m?t.jsx(at,{id:e.id,disabled:!X,className:c,children:p},e.id):t.jsx("div",{className:c,children:p},e.id)});return t.jsxs("div",{className:"mx-auto flex w-full max-w-5xl flex-col min-h-screen",children:[t.jsxs("div",{className:"px-6 pt-6 pb-4 flex items-center gap-3",children:[t.jsx("h1",{className:"text-[17px] font-semibold text-foreground",children:n}),t.jsxs("span",{className:"text-[12px] text-foreground/40",children:[(l==null?void 0:l.length)??0," items"]}),t.jsx("div",{className:"flex-1"}),t.jsxs(M,{onClick:()=>Y.mutate(),disabled:Y.isPending,className:"cms-grad-btn border-0 text-white rounded-[4px] h-9 gap-1.5 hover:text-white",children:[t.jsx(He,{className:"size-4"}),"New ",R]})]}),m&&t.jsx("p",{className:"px-6 -mt-2 pb-2 text-[12px] text-foreground/45",children:X?`Drag the ⋮⋮ grip to set the public order; ${Xe[r]} follows it. To move an item across pages, open its ⋮ menu (Move to top / Set position…).`:"Drag is paused while a search or filter is active, but a row's ⋮ menu (Move to top / Set position…) still reorders across the full list."}),t.jsxs("div",{className:"px-6 pb-3 flex flex-wrap items-center gap-2.5",children:[t.jsxs("div",{className:"relative w-full max-w-[280px]",children:[t.jsx(ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 size-3.5 text-foreground/40"}),t.jsx(je,{placeholder:"Search name or permalink…",value:x,onChange:e=>k(e.target.value),className:"h-9 pl-9 rounded-[4px] bg-card/40 text-[13px]"})]}),t.jsxs(_e,{value:f,onValueChange:$,children:[t.jsx(Ne,{className:"w-[150px] h-9 rounded-[4px] bg-card/40 text-[13px]",children:t.jsx(we,{})}),t.jsxs(Se,{children:[t.jsx(F,{value:"all",children:"All statuses"}),t.jsx(F,{value:"live",children:"Live"}),t.jsx(F,{value:"draft",children:"Draft"}),t.jsx(F,{value:"archived",children:"Archived"})]})]}),b.length!==((l==null?void 0:l.length)??0)&&t.jsxs("span",{className:"text-[12px] text-foreground/40 ml-1",children:[b.length," match"]})]}),t.jsxs("div",{className:"px-6 pb-6 flex-1",children:[t.jsxs("div",{className:"rounded-[5px] border border-border bg-card/20 overflow-hidden",children:[_.size>0?t.jsxs("div",{className:"flex items-center gap-2 h-[42px] px-4 border-b border-border bg-card/60",children:[t.jsx(Q,{checked:V,onCheckedChange:H,className:"rounded-[3px]"}
21),t.jsxs("span",{className:"text-[12.5px] text-foreground/80 ml-1",children:[_.size," selected"]}),t.jsx("div",{className:"flex-1"}),t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 rounded-[4px] text-[12px]",onClick:()=>q.mutate({ids:A,live:!0}),children:"Publish"}),t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 rounded-[4px] text-[12px]",onClick:()=>q.mutate({ids:A,live:!1}),children:"Unpublish"}),t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 rounded-[4px] text-[12px]",onClick:()=>Z.mutate({ids:A,archived:!0}),children:"Archive"}),t.jsx(M,{variant:"ghost",size:"sm",className:"h-7 rounded-[4px] text-[12px] text-destructive hover:text-destructive",onClick:()=>{confirm(`Permanently delete ${_.size} ${R}${_.size>1?"s":""}? This removes them everywhere and can't be undone.`)&&J.mutate(A)},children:"Delete"})]}):t.jsxs("div",{className:P(B,"h-[42px] border-b border-border bg-card/40 text-[10.5px] uppercase tracking-[0.05em] text-foreground/40"),children:[m&&t.jsx("span",{"aria-hidden":!0}),t.jsx(Q,{checked:!1,onCheckedChange:H,className:"rounded-[3px]","aria-label":"Select all on page"}),t.jsx("span",{children:"Name"}),t.jsx("span",{children:"Status"}),t.jsx("span",{children:"Updated"}),t.jsx("span",{}),t.jsx("span",{})]}),K&&t.jsx("div",{className:"py-12 text-center text-[13px] text-foreground/45",children:"Loading…"}),!K&&b.length===0&&t.jsx("div",{className:"py-12 text-center text-[13px] text-foreground/45",children:l!=null&&l.length?"No items match.":`No ${R}s yet.`}),!K&&(m?t.jsx(Le,{sensors:he,onDragEnd:me,accessibility:{container:document.body},children:t.jsx(Ie,{items:S.map(e=>e.id),strategy:Pe,children:te})}):te)]}),b.length>0&&t.jsxs("div",{className:"flex items-center justify-between pt-3 text-[12px] text-foreground/45",children:[t.jsxs("span",{children:[(N-1)*I+1,"–",Math.min(N*I,b.length)," of"," ",b.length]}),L>1&&t.jsxs("div",{className:"flex items-center gap-1.5",children:[t.jsx("button",{className:"size-7 inline-flex items-center justify-center rounded-[4px] border border-border disabled:opacity-30 hover:bg-foreground
21/[0.06]",disabled:N===1,onClick:()=>D(e=>Math.max(1,e-1)),"aria-label":"Previous page",children:t.jsx(Ce,{className:"size-3.5"})}),t.jsxs("span",{className:"px-2 tabular-nums text-foreground/60",children:[N," / ",L]}),t.jsx("button",{className:"size-7 inline-flex items-center justify-center rounded-[4px] border border-border disabled:opacity-30 hover:bg-foreground/[0.06]",disabled:N===L,onClick:()=>D(e=>Math.min(L,e+1)),"aria-label":"Next page",children:t.jsx(ze,{className:"size-3.5"})})]})]})]})]})},ht=Object.freeze(Object.defineProperty({__proto__:null,KIND_TO_TABLE:le,default:ot,publicHrefFor:de,reorderTo:ue},Symbol.toStringTag,{value:"Module"}));export{ht as C,le as K,ie as S,de as p};
22//# sourceMappingURL=ContentPagesList-zmpXyx0D.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.