PageSourceSearch

https://meetborderless.com/build/assets/queue-D0o_is1G.js

js meetborderless.com collected 2026-10-09 22:42:33 UTC 14,165 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{b as r,H as R,f as C}from"./inertia-BpyZy4w-.js";import{a as T}from"./admin-layout-BhXWbUlP.js";import{a as x}from"./utils-BiuKVCuu.js";import{C as _}from"./check-0O-UND6N.js";import{L as v}from"./loader-circle-C_KBZAGS.js";import{C as F}from"./chevron-down-B1YaU0K5.js";import{E as P}from"./external-link-avvfS30C.js";import{S}from"./send-COySMMwK.js";import{T as L}from"./trash-2-CrI9a2Po.js";import{S as E}from"./square-check-CTjGeuh-.js";import{I as D}from"./image-vCg-0Xge.js";import{X as z}from"./x-DQSeRCcH.js";import{C as B}from"./calendar-C9IvR7oY.js";import{U as Q}from"./upload-C1CGckSw.js";/* empty css            */import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./createLucideIcon-wqc1LSWg.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-x-Bp6Mbpgt.js";import"./circle-check-BMWvzPMx.js";import"./arrow-left-DCX0fhKH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function w(){return document.querySelector('meta[name="csrf-token"]')?.content??""}async function U(i,a){return(await fetch(i,{method:"PATCH",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":w(),Accept:"application/json"},body:JSON.stringify(a)})).json()}async function N(i,a){const c=a instanceof FormData;return(await fetch(i,{method:"POST",headers:c?{"X-CSRF-TOKEN":w(),Accept:"application/json"}:{"Content-Type":"application/json","X-CSRF-TOKEN":w(),Accept:"application/json"},body:c?a:JSON.stringify(a)})).json()}const I={x:"bg-ink text-white",linkedin:"bg-[#0A66C2] text-white",instagram:"bg-[#E1306C] text-white",facebook:"bg-[#1877F2] text-white"},q={x:"X",linkedin:"in",instagram:"IG",facebook:"fb"},X={strategist:"bg-lime/20 text-lime-ink",policy_update:"bg-amber/12 text-amber-ink",event:"bg-teal/12 text-teal",library:"bg-green/10 text-green-ink",product:"bg-red/14 text-red"},$={draft:"bg-bg-2 text-ink-3",approved:"bg-teal/12 text-teal",queued:"bg-lime/20 text-lime-ink",published:"bg-green/10 text-green-ink",dismissed:"bg-bg-2 text-ink-3 line-through"};function H({filters:i,counts:a}){const c=[{key:"draft",label:"Draft",count:a.draft},{key:"approved",label:"Approved",count:a.approved},{key:"queued",label:"Queued",count:a.queued},{key:"published",label:"Published",count:a.published},{key:"all",label:"All",count:null}],t=["x","linkedin","instagram"],l=["strategist","policy_update","event","library","product"];function o(s){C.get("/admin/social/queue",{...i,...s},{preserveScroll:!0,preserveState:!0})}return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("div",{className:"flex gap-1 border-b border-line pb-3",children:c.map(s=>e.jsxs("button",{onClick:()=>o({status:s.key}),className:x("flex items-center gap-1.5 rounded-tag px-3 py-1.5 text-xs font-medium tracking-pill transition-colors",i.status===s.key?"bg-ink text-white":"text-ink-3 hover:bg-bg-2 hover:text-ink"),children:[s.label,s.count!==null&&s.count>0&&e.jsx("span",{className:x("rounded-full px-1.5 py-0.5 text-2xs font-semibold tabular-nums",i.status===s.key?"bg-white/20 text-white":"bg-bg-2 text-ink-3"),children:s.count})]},s.key))}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("span",{className:"text-2xs font-medium uppercase tracking-eyebrow text-ink-3 self-center",children:"Platform"}),t.map(s=>e.jsx("button",{onClick:()=>o({platform:i.platform===s?null:s}),className:x("rounded-tag px-2.5 py-1 text-xs font-medium tracking-pill transition-colors",i.platform===s?"bg-ink text-white":"bg-bg-2 text-ink-2 hover:bg-bg text-ink"),children:q[s]??s},s)),e.jsx("span",{className:"text-2xs font-medium uppercase tracking-eyebrow text-ink-3 self-center ml-3",children:"Source"}),l.map(s=>e.jsx("button",{onClick:()=>o({source:i.source===s?null:s}),className:x("rounded-tag px-2.5 py-1 text-xs font-medium tracking-pill capitalize transition-colors",i.source===s?"bg-ink text-white":"bg-bg-2 text-ink-2 hover:bg-bg"),children:s.replace("_"," ")},s))]})]})}function K({item:i}){const[a,c]=r.useState(i.card_image_url),[t,l]=r.useState(!1),[o,s]=r.useState(!1);async function n(){if(a){s(!0);return}l(!0);const d=await N(`/admin/social/queue/${i.uuid}/preview-card`,{});l(!1),d.card_image_url&&(c(d.card_image_url),s(!0))}return i.has_card?e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:n,className:"flex h-9 w-9 flex-shrink-0 items-center justify-center rounded-md bg-bg-2 text-ink-3 hover:bg-bg hover:text-ink transition-colors",title:"Preview card",children:t?e.jsx(v,{size:14,className:"animate-spin"}):e.jsx(D,{size:14})}),o&&a&&e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-ink/60 p-6",onClick:()=>s(!1),children:e.jsxs("div",{className:"relative max-h-full max-w-lg",onClick:d=>d.stopPropagation(),children:[e.jsx("img",{src:a,alt:"Social card preview",className:"rounded-card shadow-xl"}),e.jsx("button",{onClick:()=>s(!1),className:"absolute -right-3 -top-3 flex h-7 w-7 items-center justify-center rounded-full bg-white shadow",children:e.jsx(z,{size:14})})]})})]}):null}function M({item:i,onDone:a,onCancel:c}){const[t,l]=r.useState(""),[o,s]=r.useState(null),[n,d]=r.useState(null),[m,f]=r.useState(!1),[h,b]=r.useState(null),j=r.useRef(null);function k(p){const u=p.target.files?.[0]??null;s(u),d(u?URL.createObjectURL(u):null)}async function y(){f(!0),b(null);const p=new FormData;t&&p.append("scheduled_at",t),o&&p.append("background",o);const u=await N(`/admin/social/queue/${i.uuid}/approve`,p);if(f(!1),u.error){b(u.error);return}a(u.item)}return e.jsxs("div",{className:"mt-3 rounded-card border border-line bg-bg-2 p-4 space-y-3",children:[e.jsx("p",{className:"text-xs font-medium text-ink-2",children:"Queue to Buffer"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{size:13,className:"text-ink-3 flex-shrink-0"}),e.jsx("input",{type:"datetime-local",value:t,onChange:p=>l(p.target.value),className:"flex-1 rounded-md border border-line bg-white px-2 py-1.5 text-xs text-ink focus:outline-none focus:ring-1 focus:ring-ink",placeholder:"Schedule (optional)"})]}),i.has_card&&e.jsxs("div",{children:[e.jsx("input",{ref:j,type:"file",accept:"image/jpeg,image/jpg,image/png",className:"hidden",onChange:k}),n?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:n,className:"h-10 w-16 rounded object-cover",alt:"bg"}),e.jsx("span",{className:"text-xs text-ink-2 truncate flex-1",children:o?.name}),e.jsx("button",{onClick:()=>{s(null),d(null)},className:"text-ink-3 hover:text-red",children:e.jsx(z,{size:13})})]}):e.jsxs("button",{onClick:()=>j.current?.click(),className:"flex items-center gap-1.5 text-xs text-ink-3 hover:text-ink transition-colors",children:[e.jsx(Q,{size:12}),"Custom background (optional)"]})]}),h&&e.jsx("p",{className:"text-xs text-red",children:h}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:y,disabled:m,className:"flex items-center gap-1.5 rounded-md bg-ink px-3 py-1.5 text-xs font-medium text-white hover:bg-ink/90 disabled:opacity-50 transition-colors",children:[m?e.jsx(v,{size:12,className:"animate-spin"}):e.jsx(S,{size:12}),t?"Schedule":"Queue now"]}),e.jsx("button",{onClick:c,className:"text-xs text-ink-3 hover:text-ink px-2",children:"Cancel"})]})]})}function G({item:i,selected:a,onSelect:c}
1){const[t,l]=r.useState(i),[o,s]=r.useState(!1),[n,d]=r.useState(!1),[m,f]=r.useState(t.copy),[h,b]=r.useState(!1),[j,k]=r.useState(!1),[y,p]=r.useState(!1);if(y)return null;const u=["queued","published","dismissed"].includes(t.status);async function A(){if(m===t.copy){d(!1);return}b(!0);const g=await U(`/admin/social/queue/${t.uuid}`,{copy:m});b(!1),g.item&&l(g.item),d(!1)}async function O(){(await N(`/admin/social/queue/${t.uuid}/dismiss`,{})).ok&&p(!0)}return e.jsxs("div",{className:x("rounded-card border border-line bg-white transition-shadow",a&&"ring-2 ring-ink/20",t.status==="dismissed"&&"opacity-40"),children:[e.jsxs("div",{className:"flex items-start gap-3 p-4",children:[!u&&e.jsx("button",{onClick:()=>c(t.uuid,!a),className:x("mt-0.5 flex h-4 w-4 flex-shrink-0 items-center justify-center rounded border transition-colors",a?"border-ink bg-ink text-white":"border-line-2 hover:border-ink"),children:a&&e.jsx(_,{size:10,strokeWidth:3})}),e.jsx("span",{className:x("flex-shrink-0 rounded-tag px-1.5 py-0.5 text-2xs font-bold uppercase tracking-eyebrow",I[t.platform]??"bg-bg-2 text-ink"),children:q[t.platform]??t.platform}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-shrink-0",children:[e.jsx("span",{className:x("rounded-tag px-1.5 py-0.5 text-2xs font-medium tracking-pill",X[t.source]??"bg-bg-2 text-ink-3"),children:t.source_label}),e.jsx("span",{className:"text-2xs uppercase tracking-eyebrow text-ink-3",children:t.content_type})]}),e.jsx("div",{className:"flex-1 min-w-0",children:n?e.jsxs("div",{className:"space-y-2",children:[e.jsx("textarea",{autoFocus:!0,value:m,onChange:g=>f(g.target.value),rows:4,className:"w-full rounded-md border border-line-2 bg-bg p-2 text-sm text-ink focus:outline-none focus:ring-1 focus:ring-ink resize-y"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:A,disabled:h,className:"flex items-center gap-1 rounded-md bg-ink px-2.5 py-1 text-xs font-medium text-white hover:bg-ink/90 disabled:opacity-50",children:[h?e.jsx(v,{size:11,className:"animate-spin"}):e.jsx(_,{size:11}),"Save"]}),e.jsx("button",{onClick:()=>{f(t.copy),d(!1)},className:"text-xs text-ink-3 hover:text-ink px-1",children:"Cancel"})]})]}):e.jsx("p",{onClick:()=>!u&&d(!0),className:x("text-sm text-ink leading-relaxed line-clamp-3",!u&&"cursor-text hover:text-ink/80"),title:u?void 0:"Click to edit",children:t.copy})}),e.jsxs("div",{className:"flex flex-shrink-0 items-start gap-2",children:[e.jsx(K,{item:t}),t.suggested_timing&&e.jsx("span",{className:"text-2xs text-ink-3 whitespace-nowrap",children:t.suggested_timing}),e.jsx("span",{className:x("rounded-tag px-1.5 py-0.5 text-2xs font-medium tracking-pill capitalize",$[t.status]??"bg-bg-2 text-ink-3"),children:t.status}),!u&&e.jsx("button",{onClick:()=>s(!o),className:"text-ink-3 hover:text-ink transition-colors",children:e.jsx(F,{size:16,className:x("transition-transform",o&&"rotate-180")})}),t.status==="queued"&&t.buffer_post_id&&e.jsx(P,{size:13,className:"text-ink-3"})]})]}),o&&!u&&e.jsx("div",{className:"border-t border-line px-4 pb-4",children:j?e.jsx(M,{item:t,onDone:g=>{l(g),k(!1),s(!1)},onCancel:()=>k(!1)}):e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsxs("button",{onClick:()=>k(!0),className:"flex items-center gap-1.5 rounded-md bg-ink px-3 py-1.5 text-xs font-medium text-white hover:bg-ink/90 transition-colors",children:[e.jsx(S,{size:12}),"Queue to Buffer"]}),e.jsxs("button",{onClick:O,className:"flex items-center gap-1.5 rounded-md border border-line px-3 py-1.5 text-xs text-ink-3 hover:text-red hover:border-red transition-colors",children:[e.jsx(L,{size:12}),"Dismiss"]})]})})]})}function J({selected:i,onClear:a}){const[c,t]=r.useState(!1),[l,o]=r.useState(null);async function s(){t(!0);const n=await N("/admin/social/queue/bulk-approve",{uuids:i});t(!1),o({queued:n.queued??0,failed:n.failed??0}),setTimeout(()=>{a(),C.reload()},1500)}return i.length===0?null:e.jsxs("div",{className:"sticky bottom-4 z-30 flex items-center justify-between rounded-card border border-line bg-white px-4 py-3 shadow-lg",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(E,{size:15,className:"text-ink-2"}),e.jsxs("span",{className:"text-sm font-medium text-ink",children:[i.length," selected"]})]}),l?e.jsxs("span",{className:"text-sm text-green-ink",children:[l.queued," queued",l.failed>0?`, ${l.failed} failed`:""]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:a,className:"text-xs text-ink-3 hover:text-ink px-2",children:"Clear"}
1),e.jsxs("button",{onClick:s,disabled:c,className:"flex items-center gap-1.5 rounded-md bg-ink px-3 py-1.5 text-xs font-medium text-white hover:bg-ink/90 disabled:opacity-50 transition-colors",children:[c?e.jsx(v,{size:12,className:"animate-spin"}):e.jsx(S,{size:12}),"Queue ",i.length," to Buffer"]})]})]})}function Se({items:i,counts:a,filters:c}){const[t,l]=r.useState([]);function o(n,d){l(m=>d?[...m,n]:m.filter(f=>f!==n))}const s=a.draft+a.approved;return e.jsxs(T,{children:[e.jsx(R,{title:"Social Queue — Admin"}),e.jsxs("div",{className:"mx-auto max-w-4xl space-y-6 px-4 py-8",children:[e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-lg font-semibold text-ink",children:"Social Queue"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-3",children:"Review, edit, and approve posts before they go to Buffer."})]}),e.jsxs("div",{className:"flex gap-2",children:[s>0&&e.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-lime/20 px-3 py-1 text-xs font-medium text-lime-ink",children:[s," waiting"]}),e.jsx("a",{href:"/admin/publish",className:"rounded-md border border-line px-3 py-1.5 text-xs text-ink-2 hover:bg-bg-2 transition-colors",children:"Publish hub"})]})]}),e.jsx(H,{filters:c,counts:a}),i.data.length===0?e.jsxs("div",{className:"rounded-card border border-line bg-bg-2 py-16 text-center",children:[e.jsx("p",{className:"text-sm text-ink-3",children:"Nothing here yet."}),e.jsx("p",{className:"mt-1 text-xs text-ink-3",children:"Run the social strategist or publish a policy update to populate the queue."})]}):e.jsx("div",{className:"space-y-2",children:i.data.map(n=>e.jsx(G,{item:n,selected:t.includes(n.uuid),onSelect:o},n.uuid))}),i.last_page>1&&e.jsx("div",{className:"flex items-center justify-center gap-1",children:i.links.map((n,d)=>e.jsx("button",{disabled:!n.url,onClick:()=>n.url&&C.get(n.url,{},{preserveScroll:!0}),className:x("rounded px-3 py-1.5 text-xs transition-colors",n.active?"bg-ink text-white":"text-ink-2 hover:bg-bg-2",!n.url&&"opacity-30 cursor-not-allowed"),dangerouslySetInnerHTML:{__html:n.label}},d))})]}),e.jsx(J,{selected:t,onClear:()=>l([])})]})}export{Se as default};

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.