2 lines
1.2 KiB
JavaScript
2 lines
1.2 KiB
JavaScript
import{aR as m,aA as n}from"./index-BXb0-9-4.js";const i="X-Cast-Ticket",t="/_presentations/api/v1",p={publicDeck:e=>n.request(`${t}/public/${encodeURIComponent(e)}`,{auth:!1}),mine:()=>n.request(`${t}/mine`),speaker:e=>n.request(`${t}/mine/${encodeURIComponent(e)}`),speakerImage:(e,o)=>n.blob(`${t}/mine/${encodeURIComponent(e)}/images/${encodeURIComponent(o)}`),remote:(e,o)=>n.request(`${t}/mine/${encodeURIComponent(e)}/remote`,{method:"POST",body:o}),castMint:e=>n.request(`${t}/mine/${encodeURIComponent(e)}/cast`,{method:"POST"}),castRevoke:(e,o)=>n.request(`${t}/mine/${encodeURIComponent(e)}/cast`,{method:"DELETE",headers:{[i]:o}}),remoteState:(e,o)=>n.request(`${t}/mine/${encodeURIComponent(e)}/remote/state`,{method:"POST",body:o}),remoteStateBeacon(e,o){const s={Accept:"application/json","Content-Type":"application/json"},c=m.get();c&&(s.Authorization=`Bearer ${c}`);try{fetch(`${t}/mine/${encodeURIComponent(e)}/remote/state`,{method:"POST",headers:s,body:JSON.stringify(o),keepalive:!0}).catch(()=>{})}catch{}}};function a(e){return{auth:!1,headers:{[i]:e}}}const d={deck:e=>n.request(`${t}/cast/deck`,a(e)),image:(e,o)=>n.blob(`${t}/cast/images/${encodeURIComponent(o)}`,a(e)),realtime:e=>n.request(`${t}/cast/realtime`,a(e))};export{d as c,p};
|