PageSourceSearch

https://meetborderless.com/build/assets/audio-Bi0dFaJl.js

js meetborderless.com collected 2026-10-09 22:42:31 UTC 5,677 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{H as k,b as c}from"./inertia-BpyZy4w-.js";import{a as j}from"./admin-layout-BhXWbUlP.js";import{a as y}from"./utils-BiuKVCuu.js";import{L as N}from"./loader-circle-C_KBZAGS.js";import{U as b}from"./upload-C1CGckSw.js";import{M as v}from"./music-CsdxzPnB.js";import{C as w}from"./circle-stop-XVmKWSyl.js";import{P as C}from"./play-FaiXzTos.js";import{T}from"./trash-2-CrI9a2Po.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"./x-DQSeRCcH.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 g(){return document.querySelector('meta[name="csrf-token"]')?.content??""}function A({track:r,onDelete:a}){const[d,n]=c.useState(!1),[x,m]=c.useState(!1),i=c.useRef(null);function l(){i.current||(i.current=new Audio(r.stream_url),i.current.onended=()=>n(!1)),d?(i.current.pause(),i.current.currentTime=0,n(!1)):(i.current.play(),n(!0))}function u(p){return p.replace(/[-_]/g," ").replace(/\.[^.]+$/,"")}return e.jsxs("div",{className:"flex items-center gap-3 border-b border-line-2 px-4 py-3 last:border-b-0",children:[e.jsx("button",{type:"button",onClick:l,className:y("flex h-7 w-7 flex-shrink-0 items-center justify-center rounded-full transition-colors",d?"bg-ink text-white":"bg-bg-2 text-ink-3 hover:bg-ink hover:text-white"),children:d?e.jsx(w,{size:14}):e.jsx(C,{size:14})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-sm text-ink capitalize",children:u(r.filename)}),e.jsxs("p",{className:"text-2xs text-ink-3",children:[r.size_kb," KB"]})]}),x?e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-2xs text-ink-3",children:"Remove?"}),e.jsx("button",{onClick:a,className:"text-2xs font-medium text-red hover:underline",children:"Yes"}),e.jsx("button",{onClick:()=>m(!1),className:"text-2xs text-ink-3 hover:underline",children:"No"})]}):e.jsx("button",{type:"button",onClick:()=>m(!0),className:"text-ink-3 hover:text-red transition-colors",children:e.jsx(T,{size:14})})]})}function E({mood:r}){const[a,d]=c.useState(r.tracks),[n,x]=c.useState(!1),[m,i]=c.useState(null),l=c.useRef(null);async function u(t){if(!t||t.length===0)return;x(!0),i(null);const o=new FormData;Array.from(t).forEach(s=>o.append("tracks[]",s)),o.append("_token",g());try{const s=await fetch(`/admin/social/audio/${r.slug}`,{method:"POST",body:o});if(!s.ok){const h=await s.json();throw new Error(h.message??`HTTP ${s.status}`)}const f=await s.json();d(h=>[...h,...f.uploaded])}catch(s){i(s instanceof Error?s.message:"Upload failed")}finally{x(!1),l.current&&(l.current.value="")}}async function p(t){try{const o=await fetch(`/admin/social/audio/${r.slug}/${encodeURIComponent(t)}`,{method:"DELETE",headers:{"X-CSRF-TOKEN":g()}});if(!o.ok)throw new Error(`HTTP ${o.status}`);d(s=>s.filter(f=>f.filename!==t))}catch(o){i(o instanceof Error?o.message:"Delete failed")}}return e.jsxs("div",{className:"rounded-card border border-line bg-white",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-line-2 px-4 py-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-ink",children:r.label}),e.jsx("p",{className:"text-2xs text-ink-3",children:a.length===0?"No tracks — falls back to other moods":`${a.length} track${a.length!==1?"s":""}`})]}),e.jsxs("button",{type:"button",onClick:()=>l.current?.click(),disabled:n,className:"inline-flex items-center gap-1.5 rounded-md border border-line px-2.5 py-1 text-2xs font-medium text-ink-2 hover:bg-bg disabled:opacity-50",children:[n?e.jsx(N,{className:"h-3 w-3 animate-spin"}):e.jsx(b,{className:"h-3 w-3"}),n?"Uploading…":"Upload"]}),e.jsx("input",{ref:l,type:"file",accept:"audio/mpeg,audio/aac,audio/mp4,.mp3,.aac,.m4a",multiple:!0,className:"hidden",onChange:t=>{u(t.target.files)}})]}),m&&e.jsx("div",{className:"border-b border-line-2 bg-red/5 px-4 py-2 text-xs text-red",children:m}),a.length===0?e.jsxs("button",{type:"button",onClick:()=>l.current?.click(),disabled:n,className:"flex w-full flex-col items-center gap-2 px-4 py-8 text-ink-3 hover:bg-bg-2",children:[e.jsx(v,{className:"h-5 w-5"}),e.jsx("span",{className:"text-xs",children:"Click to upload MP3 / AAC tracks"})]}):e.jsxs("div",{children:[a.map(t=>e.jsx(A,{track:t,onDelete:()=>{p(t.filename)}},t.filename)),e.jsxs("button",{type:"button",onClick:()=>l.current?.click(),disabled:n,className:"flex w-full items-center justify-center gap-1.5 border-t border-line-2 px-4 py-2.5 text-xs text-ink-3 hover:bg-bg-2",children:[e.jsx(b,{className:"h-3 w-3"})," Add more"]})]})]})}function te({moods:r}){return e.jsxs(j,{children:[e.jsx(k,{title:"Reel Audio — Admin"}),e.jsxs("div",{className:"border-b border-line px-4 py-4 sm:px-7",children:[e.jsx("h1",{className:"text-base font-semibold text-ink",children:"Reel Audio Tracks"}),e.jsx("p",{className:"mt-0.5 text-sm text-ink-2",children:"Backgroun
1d music for Instagram Reels and TikTok videos. Organised by mood — the renderer picks a track deterministically so the same post always gets the same audio. Accepts MP3, AAC, M4A up to 20 MB."})]}),e.jsx("div",{className:"px-4 py-6 sm:px-7",children:e.jsx("div",{className:"grid gap-5 sm:grid-cols-2 xl:grid-cols-4",children:r.map(a=>e.jsx(E,{mood:a},a.slug))})})]})}export{te 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.