Bundle embedded web app

This commit is contained in:
Owncast 2023-06-05 10:31:46 +00:00
parent 330f4bf0f2
commit a38acbc523
64 changed files with 73 additions and 73 deletions

2
static/web/404.html vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1398],{41398:function(e,i,s){"use strict";s.r(i),s.d(i,{BrowserNotifyModal:function(){return v}});var t=s(85893),o=s(85818),n=s(71577),r=s(11382),a=s(71230),l=s(67294),c=s(4480),d=s(37068),h=s(44974);async function f(e,i,s){console.log("saveNotificationRegistration");let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,destination:i})};await fetch("".concat("/api/notifications/register","?accessToken=").concat(s),t)}async function w(e){let i=await navigator.serviceWorker.ready,s=await i.pushManager.getSubscription();return s||(s=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let i="=".repeat((4-e.length%4)%4),s=(e+i).replace(/-/g,"+").replace(/_/g,"/"),t=window.atob(s),o=new Uint8Array(t.length);for(let e=0;e<t.length;++e)o[e]=t.charCodeAt(e);return o}(e)})),JSON.stringify(s)}var u=s(67940),p=s.n(u),b=s(34148),m=s(69183);let{Title:x}=o.Z,_=()=>(0,t.jsx)("div",{children:"Browser notifications are not supported in your browser."}),g=()=>(0,t.jsx)("div",{children:"Browser notifications are not supported for local servers."}),y=e=>{let{start:i}=e;return(0,t.jsx)("div",{id:"browser-push-preview-box",className:p().pushPreview,children:(0,t.jsxs)("div",{className:p().inner,children:[(0,t.jsxs)("div",{className:p().title,children:[window.location.toString()," wants to"]}),(0,t.jsxs)("div",{className:p().permissionLine,children:[(0,t.jsx)("svg",{className:p().bell,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M14 12.3333V13H2V12.3333L3.33333 11V7C3.33333 4.93333 4.68667 3.11333 6.66667 2.52667C6.66667 2.46 6.66667 2.4 6.66667 2.33333C6.66667 1.97971 6.80714 1.64057 7.05719 1.39052C7.30724 1.14048 7.64638 1 8 1C8.35362 1 8.69276 1.14048 8.94281 1.39052C9.19286 1.64057 9.33333 1.97971 9.33333 2.33333C9.33333 2.4 9.33333 2.46 9.33333 2.52667C11.3133 3.11333 12.6667 4.93333 12.6667 7V11L14 12.3333ZM9.33333 13.6667C9.33333 14.0203 9.19286 14.3594 8.94281 14.6095C8.69276 14.8595 8.35362 15 8 15C7.64638 15 7.30724 14.8595 7.05719 14.6095C6.80714 14.3594 6.66667 14.0203 6.66667 13.6667",fill:"#676670"})}),(0,t.jsx)("span",{className:p().showNotificationsText,children:"Show notifications"})]}),(0,t.jsxs)("div",{className:p().buttonRow,children:[(0,t.jsx)(n.Z,{type:"primary",onClick:()=>{i()},children:"Allow"}),(0,t.jsx)("button",{type:"button",className:p().disabled,children:"Block"})]})]})})},N=()=>(0,t.jsxs)("div",{children:[(0,t.jsx)(x,{level:2,children:"Notifications are enabled"}),"To disable push notifications from ",window.location.hostname.toString()," access your browser permissions for this site and turn off notifications.",(0,t.jsx)("a",{href:"https://owncast.online/docs/notifications",children:" Learn more."})]}),v=()=>{let[e,i]=(0,l.useState)(null),s=(0,c.sJ)(h.FI),o=(0,c.sJ)(h.g1),[n,u]=(0,l.useState)(!1),x=(0,b.Z)()&&"default"!==Notification.permission,{notifications:v}=o,{browser:j}=v,{publicKey:C}=j,M=j.enabled&&(0,b.Z)();if(x)return(0,t.jsx)(N,{});let B=async()=>{if(!(0,b.Z)()||"default"===Notification.permission){u(!0);try{let e=await w(C);f("BROWSER_PUSH_NOTIFICATION",e,s),i(null)}catch(e){i("Error registering for live notifications: ".concat(e.message,". Make sure you're not inside a private browser environment or have previously disabled notifications for this stream."))}u(!1)}};return"localhost"===window.location.hostname?(0,t.jsx)(g,{}):M?(0,t.jsx)(d.SV,{fallbackRender:e=>{let{error:i,resetErrorBoundary:s}=e;return(0,t.jsx)(m.A,{componentName:"BrowserNotifyModal",message:i.message,retryFunction:s})},children:(0,t.jsxs)(r.Z,{spinning:n,children:[(0,t.jsxs)(a.Z,{className:p().description,children:["Get notified right in the browser each time this stream goes live.",(0,t.jsx)("a",{href:"https://owncast.online/docs/notifications/#browser-notifications",children:"Learn more"}),"\xa0 about Owncast browser notifications."]}),(0,t.jsx)(a.Z,{children:e}),(0,t.jsx)(y,{start:()=>B()})]})}):(0,t.jsx)(_,{})}},67940:function(e){e.exports={description:"BrowserNotifyModal_description__tMKKq",pushPreview:"BrowserNotifyModal_pushPreview__4Og4q",inner:"BrowserNotifyModal_inner__uhFDw",title:"BrowserNotifyModal_title__dd_Lh",permissionLine:"BrowserNotifyModal_permissionLine__K8nyJ",bell:"BrowserNotifyModal_bell__9mIeI",buttonRow:"BrowserNotifyModal_buttonRow__oxJUg",disabled:"BrowserNotifyModal_disabled__v88lb"}}}]);

View file

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1398],{41398:function(e,i,s){"use strict";s.r(i),s.d(i,{BrowserNotifyModal:function(){return v}});var t=s(85893),o=s(85818),n=s(71577),r=s(11382),a=s(71230),l=s(67294),c=s(4480),d=s(4511),h=s(44974);async function f(e,i,s){console.log("saveNotificationRegistration");let t={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({channel:e,destination:i})};await fetch("".concat("/api/notifications/register","?accessToken=").concat(s),t)}async function w(e){let i=await navigator.serviceWorker.ready,s=await i.pushManager.getSubscription();return s||(s=await i.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let i="=".repeat((4-e.length%4)%4),s=(e+i).replace(/-/g,"+").replace(/_/g,"/"),t=window.atob(s),o=new Uint8Array(t.length);for(let e=0;e<t.length;++e)o[e]=t.charCodeAt(e);return o}(e)})),JSON.stringify(s)}var u=s(67940),p=s.n(u),b=s(34148),m=s(69183);let{Title:x}=o.Z,_=()=>(0,t.jsx)("div",{children:"Browser notifications are not supported in your browser."}),g=()=>(0,t.jsx)("div",{children:"Browser notifications are not supported for local servers."}),y=e=>{let{start:i}=e;return(0,t.jsx)("div",{id:"browser-push-preview-box",className:p().pushPreview,children:(0,t.jsxs)("div",{className:p().inner,children:[(0,t.jsxs)("div",{className:p().title,children:[window.location.toString()," wants to"]}),(0,t.jsxs)("div",{className:p().permissionLine,children:[(0,t.jsx)("svg",{className:p().bell,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M14 12.3333V13H2V12.3333L3.33333 11V7C3.33333 4.93333 4.68667 3.11333 6.66667 2.52667C6.66667 2.46 6.66667 2.4 6.66667 2.33333C6.66667 1.97971 6.80714 1.64057 7.05719 1.39052C7.30724 1.14048 7.64638 1 8 1C8.35362 1 8.69276 1.14048 8.94281 1.39052C9.19286 1.64057 9.33333 1.97971 9.33333 2.33333C9.33333 2.4 9.33333 2.46 9.33333 2.52667C11.3133 3.11333 12.6667 4.93333 12.6667 7V11L14 12.3333ZM9.33333 13.6667C9.33333 14.0203 9.19286 14.3594 8.94281 14.6095C8.69276 14.8595 8.35362 15 8 15C7.64638 15 7.30724 14.8595 7.05719 14.6095C6.80714 14.3594 6.66667 14.0203 6.66667 13.6667",fill:"#676670"})}),(0,t.jsx)("span",{className:p().showNotificationsText,children:"Show notifications"})]}),(0,t.jsxs)("div",{className:p().buttonRow,children:[(0,t.jsx)(n.Z,{type:"primary",onClick:()=>{i()},children:"Allow"}),(0,t.jsx)("button",{type:"button",className:p().disabled,children:"Block"})]})]})})},N=()=>(0,t.jsxs)("div",{children:[(0,t.jsx)(x,{level:2,children:"Notifications are enabled"}),"To disable push notifications from ",window.location.hostname.toString()," access your browser permissions for this site and turn off notifications.",(0,t.jsx)("a",{href:"https://owncast.online/docs/notifications",children:" Learn more."})]}),v=()=>{let[e,i]=(0,l.useState)(null),s=(0,c.sJ)(h.FI),o=(0,c.sJ)(h.g1),[n,u]=(0,l.useState)(!1),x=(0,b.Z)()&&"default"!==Notification.permission,{notifications:v}=o,{browser:j}=v,{publicKey:C}=j,M=j.enabled&&(0,b.Z)();if(x)return(0,t.jsx)(N,{});let B=async()=>{if(!(0,b.Z)()||"default"===Notification.permission){u(!0);try{let e=await w(C);f("BROWSER_PUSH_NOTIFICATION",e,s),i(null)}catch(e){i("Error registering for live notifications: ".concat(e.message,". Make sure you're not inside a private browser environment or have previously disabled notifications for this stream."))}u(!1)}};return"localhost"===window.location.hostname?(0,t.jsx)(g,{}):M?(0,t.jsx)(d.SV,{fallbackRender:e=>{let{error:i,resetErrorBoundary:s}=e;return(0,t.jsx)(m.A,{componentName:"BrowserNotifyModal",message:i.message,retryFunction:s})},children:(0,t.jsxs)(r.Z,{spinning:n,children:[(0,t.jsxs)(a.Z,{className:p().description,children:["Get notified right in the browser each time this stream goes live.",(0,t.jsx)("a",{href:"https://owncast.online/docs/notifications/#browser-notifications",children:"Learn more"}),"\xa0 about Owncast browser notifications."]}),(0,t.jsx)(a.Z,{children:e}),(0,t.jsx)(y,{start:()=>B()})]})}):(0,t.jsx)(_,{})}},67940:function(e){e.exports={description:"BrowserNotifyModal_description__tMKKq",pushPreview:"BrowserNotifyModal_pushPreview__4Og4q",inner:"BrowserNotifyModal_inner__uhFDw",title:"BrowserNotifyModal_title__dd_Lh",permissionLine:"BrowserNotifyModal_permissionLine__K8nyJ",bell:"BrowserNotifyModal_bell__9mIeI",buttonRow:"BrowserNotifyModal_buttonRow__oxJUg",disabled:"BrowserNotifyModal_disabled__v88lb"}}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8399],{15746:function(e,n,t){"use strict";var s=t(21584);n.Z=s.Z},71230:function(e,n,t){"use strict";var s=t(92820);n.Z=s.Z},88054:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/embed/chat/readonly",function(){return t(85466)}])},85466:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return d}});var s=t(85893),i=t(4480),r=t(4511),a=t(92093),u=t(44974),c=t(21756),o=t(69183);function d(){let e=(0,i.sJ)(u.db),n=(0,i.sJ)(u.pH),t=(0,i.sJ)(u.di);return(0,s.jsx)("div",{children:(0,s.jsxs)(r.SV,{fallbackRender:e=>{let{error:n}=e;return(0,s.jsx)(o.A,{componentName:"ReadWriteChatEmbed",message:n.message})},children:[(0,s.jsx)(u.me,{}),(0,s.jsx)(c.Q,{}),e&&(0,s.jsx)(a.ChatContainer,{messages:n,usernameToHighlight:e.displayName,chatUserId:e.id,isModerator:!1,showInput:!1,height:"100vh",chatAvailable:t})]})})}}},function(e){e.O(0,[1272,8700,9151,5634,8323,5138,2700,2093,9774,2888,179],function(){return e(e.s=88054)}),_N_E=e.O()}]);

View file

@ -1 +0,0 @@
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8399],{15746:function(e,n,t){"use strict";var s=t(21584);n.Z=s.Z},71230:function(e,n,t){"use strict";var s=t(92820);n.Z=s.Z},88054:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/embed/chat/readonly",function(){return t(85466)}])},85466:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return d}});var s=t(85893),i=t(4480),r=t(37068),a=t(92093),u=t(44974),c=t(21756),o=t(69183);function d(){let e=(0,i.sJ)(u.db),n=(0,i.sJ)(u.pH),t=(0,i.sJ)(u.di);return(0,s.jsx)("div",{children:(0,s.jsxs)(r.SV,{fallbackRender:e=>{let{error:n}=e;return(0,s.jsx)(o.A,{componentName:"ReadWriteChatEmbed",message:n.message})},children:[(0,s.jsx)(u.me,{}),(0,s.jsx)(c.Q,{}),e&&(0,s.jsx)(a.ChatContainer,{messages:n,usernameToHighlight:e.displayName,chatUserId:e.id,isModerator:!1,showInput:!1,height:"100vh",chatAvailable:t})]})})}}},function(e){e.O(0,[1272,8700,9151,5634,2332,5138,2700,2093,9774,2888,179],function(){return e(e.s=88054)}),_N_E=e.O()}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
static/web/sw.js vendored

File diff suppressed because one or more lines are too long