mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-06 07:28:53 -05:00
1 line
6.2 KiB
JavaScript
1 line
6.2 KiB
JavaScript
!function(){"use strict";var e,t={463:function(e,t,n){n.d(t,{c:function(){return a}});var i=n(4571),o=n.n(i);function a(e,t){let n=o()(e,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=o()(t+"/"+e.replace(/^\//g,""),{})),n.toString()}},4665:function(e,t,n){var i=n(2985),o=n(7545);(0,i.C)("page-profile-media",o.R)},6089:function(e,t,n){n.d(t,{$:function(){return s}});var i=n(9471),o=n(6371);let a=[];function r(e){const[t,n]=(0,i.useState)(!1),[o,a]=(0,i.useState)(!0);let r=null,s=null;return(0,i.useEffect)((()=>(r=setTimeout((function(){s=setTimeout((function(){a(!1),s=null}),1e3),r=null,n(!0),e.onHide(e.id)}),5e3),()=>{r&&clearTimeout(r),s&&clearTimeout(s)})),[]),o?i.createElement("div",{className:"notification-item"+(t?" hidden":"")},i.createElement("div",null,i.createElement("span",null,e.children||"No message"))):null}function s(){const[e,t]=(0,i.useState)(a.length);function n(){t(o.default.get("notifications-size")+a.length)}function s(e){const t=[];a.map((n=>{n[0]!==e&&t.push(n)})),a=t}return(0,i.useEffect)((()=>(n(),o.default.on("added_notification",n),()=>o.default.removeListener("added_notification",n))),[]),e?i.createElement("div",{className:"notifications"},i.createElement("div",null,function(){const e=o.default.get("notifications");return[...a.map((e=>i.createElement(r,{key:e[0],id:e[0],onHide:s},e[1]))),...e.map((e=>(a.push(e),i.createElement(r,{key:e[0],id:e[0],onHide:s},e[1]))))]}())," "):null}},6371:function(e,t,n){n.r(t);var i=n(9032),o=n.n(i),a=n(7154),r=n(1838),s=n(3997);function c(){let e=new Uint32Array(3);return window.crypto.getRandomValues(e),(performance.now().toString(36)+Array.from(e).map((e=>e.toString(36))).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())}let l,u=null,d=null;class f extends(o()){constructor(e){super(),d=(0,s.$)(window.MediaCMS),l=new a.BrowserCache(d.site.id,86400),u={mediaAutoPlay:l.get("media-auto-play")},u.mediaAutoPlay=null===u.mediaAutoPlay||u.mediaAutoPlay,this.browserEvents=(0,r.BrowserEvents)(),this.browserEvents.doc(this.onDocumentVisibilityChange.bind(this)),this.browserEvents.win(this.onWindowResize.bind(this),this.onWindowScroll.bind(this)),this.notifications=function(e){let t=[];function n(e){"string"==typeof e&&t.push([c(),e])}return e.map(n),{size:function(){return t.length},push:n,clear:function(){t=[]},messages:function(){return[...t]}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[])}onDocumentVisibilityChange(){this.emit("document_visibility_change")}onWindowScroll(){this.emit("window_scroll")}onWindowResize(){this.emit("window_resize")}initPage(e){u.currentPage=e}get(e){let t;switch(e){case"browser-cache":t=l;break;case"media-auto-play":t=u.mediaAutoPlay;break;case"config-contents":t=d.contents;break;case"config-enabled":t=d.enabled;break;case"config-media-item":t=d.media.item;break;case"config-options":t=d.options;break;case"config-site":t=d.site;break;case"api-playlists":n=e.split("-")[1],t=d.api[n]||null;break;case"notifications-size":t=this.notifications.size();break;case"notifications":t=this.notifications.messages(),this.notifications.clear();break;case"current-page":t=u.currentPage}var n;return t}actions_handler(e){switch(e.type){case"INIT_PAGE":this.initPage(e.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":u.mediaAutoPlay=!u.mediaAutoPlay,l.set("media-auto-play",u.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(e.notification),this.emit("added_notification")}}}t.default=(0,r.exportStore)(new f,"actions_handler")},6568:function(e,t,n){n.d(t,{x:function(){return r}});var i=n(9471),o=n(8713),a=n.n(o);function r(e){let t="spinner-loader";switch(e.size){case"tiny":case"x-small":case"small":case"large":case"x-large":t+=" "+e.size}return i.createElement("div",{className:t},i.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},i.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}r.propTypes={size:a().oneOf(["tiny","x-small","small","medium","large","x-large"])},r.defaultProps={size:"medium"}},7256:function(e,t,n){n.d(t,{P:function(){return s}});var i=n(9471),o=n(8713),a=n.n(o),r=n(2828);function s(e){return e.options.map((t=>i.createElement("div",{key:t.id,className:t.id===e.selected?"active":""},i.createElement("button",{onClick:e.onSelect,filter:e.id,value:t.id},i.createElement("span",null,t.title),t.id===e.selected?i.createElement(r.Z,{type:"close"}):null))))}s.propTypes={id:a().string.isRequired,selected:a().string.isRequired,onSelect:a().func.isRequired}}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,i),a.exports}i.m=t,e=[],i.O=function(t,n,o,a){if(!n){var r=1/0;for(u=0;u<e.length;u++){n=e[u][0],o=e[u][1],a=e[u][2];for(var s=!0,c=0;c<n.length;c++)(!1&a||r>=a)&&Object.keys(i.O).every((function(e){return i.O[e](n[c])}))?n.splice(c--,1):(s=!1,a<r&&(r=a));if(s){e.splice(u--,1);var l=o();void 0!==l&&(t=l)}}return t}a=a||0;for(var u=e.length;u>0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[n,o,a]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.j=301,function(){var e={301:0};i.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,a,r=n[0],s=n[1],c=n[2],l=0;if(r.some((function(t){return 0!==e[t]}))){for(o in s)i.o(s,o)&&(i.m[o]=s[o]);if(c)var u=c(i)}for(t&&t(n);l<r.length;l++)a=r[l],i.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return i.O(u)},n=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var o=i.O(void 0,[276],(function(){return i(4665)}));o=i.O(o)}(); |