mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-25 01:34:51 +01:00
aa6520daac
* Added frontend development files/environment * More items-categories related removals * Improvements in pages templates (inc. static pages) * Improvements in video player * Added empty home page message + cta * Updates in media, playlist and management pages * Improvements in material icons font loading * Replaced media & playlists links in frontend dev-env * frontend package version update * chnaged frontend dev url port * static files update * Changed default position of theme switcher * enabled frontend docker container
1 line
32 KiB
JavaScript
1 line
32 KiB
JavaScript
!function(){"use strict";var e,t={1213:function(e,t,n){var r=n(2541),i=(n(7441),n(2322),n(9006),n(5101),n(3080),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(5466)),a=n(3613),l=n(8578),o=n(4234),s=n(5910),u=n(824),c=(n(288),n(4458),n(3675),n(9751),n(8833),n(815),n(5090),n(9174),n(2546));function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){return i.createElement("div",{className:"media-filter-option"},i.createElement("button",{className:e.selected?"active":"",onClick:function(){e.onSelect(e.id)}},e.label))}function b(e){var t=m((0,i.useState)(e.default),2),n=t[0],r=t[1];function a(t){r(t),"function"==typeof e.onSelect&&e.onSelect(t)}return i.createElement("div",{className:"media-filter-option-list"},function(t){for(var n=[],r=0;r<e.items.length;)e.hideOptionOnSelect?e.items[r].id!==t&&n.push(i.createElement(y,{key:e.items[r].id,id:e.items[r].id,label:e.items[r].label,selected:e.items[r].id===t,onSelect:a})):n.push(i.createElement(y,{key:e.items[r].id,id:e.items[r].id,label:e.items[r].label,selected:e.items[r].id===t,onSelect:a})),r+=1;return n}(n))}function v(e){var t=m((0,c.useMediaFilter)(e.default),6),n=t[0],r=t[1],a=t[2],l=t[3],s=t[4],u=t[5],f=m((0,i.useState)(e.label),2),d=f[0],p=f[1];return(0,i.useEffect)((function(){if(l.current.tryToHide(),e.updateTriggerButtonOnChange)for(var t=0;t<e.options.length;){if(r===e.options[t].id){p(e.options[t].label);break}t+=1}"function"==typeof e.onSelect&&e.onSelect(r)}),[r]),i.createElement("div",{ref:n,className:"media-filter"},i.createElement(u,{contentRef:l},i.createElement("button",{className:"popup-trigger","aria-label":"Filter"},i.createElement("span",{className:"filter-button-label"},i.createElement("span",{className:"filter-button-label-text"},d),i.createElement(o.MaterialIcon,{type:"arrow_drop_down"})))),i.createElement(s,{contentRef:l},i.createElement("div",{className:"main-options"},i.createElement(o.PopupMain,null,i.createElement(b,{items:e.options,default:r,onSelect:a,hideOptionOnSelect:e.hideOptionOnSelect})))))}function g(e){var t=m((0,c.useMediaFilter)(e.default),6),n=t[0],r=t[1],a=t[2],l=t[3],s=t[4],u=t[5];return(0,i.useEffect)((function(){l.current.tryToHide(),"function"==typeof e.onSelect&&e.onSelect(r)}),[r]),i.createElement("div",{ref:n,className:"media-filter"},i.createElement(u,{contentRef:l},i.createElement("button",{className:"popup-trigger","aria-label":"Filter"},i.createElement(o.MaterialIcon,{type:"sort"}),i.createElement("span",{className:"filter-button-label"},i.createElement("span",{className:"filter-button-label-text"},e.label)))),i.createElement(s,{contentRef:l},i.createElement("div",{className:"main-options"},i.createElement(o.PopupMain,null,i.createElement(b,{items:e.options,default:r,onSelect:a})))))}var E=[{id:"all",label:"All media types"},{id:"video",label:"Video"},{id:"audio",label:"Audio"},{id:"image",label:"Images"},{id:"pdf",label:"Pdf"}],O=[{id:"date_added_desc",label:"Upload date (newest)"},{id:"date_added_asc",label:"Upload date (oldest)"},{id:"most_views",label:"View count"},{id:"most_likes",label:"Like count"}];function w(e){var t=m((0,i.useState)("all"),2),n=t[0],r=t[1],a=m((0,i.useState)("date_added_desc"),2),l=a[0],o=a[1],s=m((0,i.useState)({sort_by:null,ordering:null,media_type:null}),2),u=s[0],c=s[1];function f(){var e=d(d({},u),{},{media_type:null,sort_by:null,ordering:null});switch(n){case"video":e.media_type="video";break;case"audio":e.media_type="audio";break;case"image":e.media_type="image";break;case"pdf":e.media_type="pdf"}switch(l){case"most_views":e.sort_by="views",e.ordering=null;break;case"most_likes":e.sort_by="likes",e.ordering=null;break;case"date_added_asc":e.sort_by=null,e.ordering="asc"}c(e)}return(0,i.useEffect)((function(){f()}),[n,l]),(0,i.useEffect)((function(){"function"==typeof e.onFiltersUpdate&&e.onFiltersUpdate(u)}),[u]),(0,i.useEffect)((function(){f()}),[]),i.createElement("div",{className:"media-filters-row"},i.createElement("div",{className:"media-filters-row-inner"},i.createElement("div",{className:"media-type-filters"},i.createElement(v,{label:E[0].label,default:E[0].id,options:E,onSelect:function(e){r(e)},updateTriggerButtonOnChange:!0,hideOptionOnSelect:!0})),i.createElement("div",{className:"media-filters-sort"},i.createElement(g,{label:"SORT BY",default:O[0].id,options:O,onSelect:function(e){o(e)},updateTriggerButtonOnChange:!1,hideOptionOnSelect:!1}))))}var S=n(3074),k=n.n(S);function _(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?j(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var A={media_type:[{id:"all",title:"All"},{id:"video",title:"Video"},{id:"audio",title:"Audio"},{id:"image",title:"Image"},{id:"pdf",title:"Pdf"}],upload_date:[{id:"all",title:"All"},{id:"today",title:"Today"},{id:"this_week",title:"This week"},{id:"this_month",title:"This month"},{id:"this_year",title:"This year"}],sort_by:[{id:"date_added_desc",title:"Upload date (newest)"},{id:"date_added_asc",title:"Upload date (oldest)"},{id:"most_views",title:"View count"},{id:"most_likes",title:"Like count"}]};function N(e){var t=_((0,i.useState)(e.hidden),2),n=t[0],r=t[1],a=_((0,i.useState)("all"),2),s=a[0],u=a[1],c=_((0,i.useState)("all"),2),f=c[0],d=c[1],p=_((0,i.useState)("date_added_desc"),2),m=p[0],h=p[1],y=(0,i.useRef)(null),b=(0,i.useRef)(null);function v(){n||(y.current.style.height=24+b.current.offsetHeight+"px")}function g(t){var n={media_type:s,upload_date:f,sort_by:m};switch(t.currentTarget.getAttribute("filter")){case"media_type":n.media_type=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(n),u(n.media_type);break;case"upload_date":n.upload_date=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(n),d(n.upload_date);break;case"sort_by":n.sort_by=t.currentTarget.getAttribute("value"),e.onFiltersUpdate(n),h(n.sort_by)}}return(0,i.useEffect)((function(){r(e.hidden),v()}),[e.hidden]),(0,i.useEffect)((function(){return l.PageStore.on("window_resize",v),function(){return l.PageStore.removeListener("window_resize",v)}}),[]),i.createElement("div",{ref:y,className:"mi-filters-row"+(n?" hidden":"")},i.createElement("div",{ref:b,className:"mi-filters-row-inner"},i.createElement("div",{className:"mi-filter"},i.createElement("div",{className:"mi-filter-title"},"MEDIA TYPE"),i.createElement("div",{className:"mi-filter-options"},i.createElement(o.FilterOptions,{id:"media_type",options:A.media_type,selected:s,onSelect:g}))),i.createElement("div",{className:"mi-filter"},i.createElement("div",{className:"mi-filter-title"},"UPLOAD DATE"),i.createElement("div",{className:"mi-filter-options"},i.createElement(o.FilterOptions,{id:"upload_date",options:A.upload_date,selected:f,onSelect:g}))),i.createElement("div",{className:"mi-filter"},i.createElement("div",{className:"mi-filter-title"},"SORT BY"),i.createElement("div",{className:"mi-filter-options"},i.createElement(o.FilterOptions,{id:"sort_by",options:A.sort_by,selected:m,onSelect:g})))))}function P(e){return(P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function T(e,t){return(T=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e,t){return!t||"object"!==P(t)&&"function"!=typeof t?x(e):t}function x(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}N.propTypes={hidden:k().bool},N.defaultProps={hidden:!1};var R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&T(e,t)}(d,e);var t,n,r,c,f=(r=d,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=U(r);if(c){var n=U(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return F(this,e)});function d(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),(t=f.call(this,e,"search-results")).state={validQuery:!1,requestUrl:null,filterArgs:"",resultsTitle:null,resultsCount:null,searchQuery:l.SearchFieldStore.get("search-query"),searchCategories:l.SearchFieldStore.get("search-categories"),searchTags:l.SearchFieldStore.get("search-tags"),hiddenFilters:!0},t.getCountFunc=t.getCountFunc.bind(x(t)),t.updateRequestUrl=t.updateRequestUrl.bind(x(t)),t.onFilterArgsUpdate=t.onFilterArgsUpdate.bind(x(t)),t.onToggleFiltersClick=t.onToggleFiltersClick.bind(x(t)),t.onFiltersUpdate=t.onFiltersUpdate.bind(x(t)),t.didMount=!1,t.updateRequestUrl(),t}return t=d,(n=[{key:"componentDidMount",value:function(){this.didMount=!0}},{key:"onToggleFiltersClick",value:function(){this.setState({hiddenFilters:!this.state.hiddenFilters})}},{key:"onFiltersUpdate",value:function(e){var t={media_type:null,upload_date:null,sort_by:null,ordering:null};switch(e.media_type){case"video":case"audio":case"image":case"pdf":t.media_type=e.media_type}switch(e.upload_date){case"today":case"this_week":case"this_month":case"this_year":t.upload_date=e.upload_date}switch(e.sort_by){case"most_views":t.sort_by="views";break;case"most_likes":t.sort_by="likes";break;case"date_added_asc":t.ordering="asc"}var n=[];for(var r in t)null!==t[r]&&n.push(r+"="+t[r]);this.setState({filterArgs:n.length?"&"+n.join("&"):""},(function(){this.updateRequestUrl()}))}},{key:"updateRequestUrl",value:function(){var e=this.state.searchQuery||this.state.searchCategories||this.state.searchTags,t=null;null!==this.state.resultsCount&&(e?this.state.searchCategories?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=' media in category "'+this.state.searchCategories+'"'):this.state.searchTags?(t=null===this.state.resultsCount||0===this.state.resultsCount?"No":this.state.resultsCount,t+=' media in tag "'+this.state.searchTags+'"'):t=null===this.state.resultsCount||0===this.state.resultsCount?'No results for "'+this.state.searchQuery+'"':this.state.resultsCount+" result"+(1<this.state.resultsCount?"s":"")+' for "'+this.state.searchQuery+'"':t='No results for "'+this.state.searchQuery+'"');var n=(this.state.searchQuery||"")+(this.state.searchTags?"&t="+this.state.searchTags:"")+(this.state.searchCategories?"&c="+this.state.searchCategories:""),r=a.ApiUrlContext._currentValue.search.query+n+this.state.filterArgs;this.didMount?this.setState({validQuery:e,requestUrl:r,resultsTitle:t}):(this.state.validQuery=e,this.state.requestUrl=r,this.state.resultsTitle=t)}},{key:"onFilterArgsUpdate",value:function(e){var t=[];for(var n in e)null!==e[n]&&t.push(n+"="+e[n]);this.setState({filterArgs:t.length?"&"+t.join("&"):""},(function(){this.updateRequestUrl()}))}},{key:"getCountFunc",value:function(e){this.setState({resultsCount:e},(function(){this.updateRequestUrl()}))}},{key:"pageContent",value:function(){var e=l.PageStore.get("config-options").pages.search.advancedFilters;return i.createElement(s.MediaListWrapper,{className:"search-results-wrap items-list-hor",title:null===this.state.resultsTitle?null:this.state.resultsTitle},e?i.createElement(o.FiltersToggleButton,{onClick:this.onToggleFiltersClick}):null,e?i.createElement(N,{hidden:this.state.hiddenFilters,onFiltersUpdate:this.onFiltersUpdate}):null,e?null:i.createElement(w,{onFiltersUpdate:this.onFilterArgsUpdate}),this.state.validQuery?i.createElement(u.LazyLoadItemListAsync,{key:this.state.requestUrl,singleLinkContent:!1,horizontalItemsOrientation:!0,itemsCountCallback:this.getCountFunc,requestUrl:this.state.requestUrl,preferSummary:!0,hideViews:!l.PageStore.get("config-media-item").displayViews,hideAuthor:!l.PageStore.get("config-media-item").displayAuthor,hideDate:!l.PageStore.get("config-media-item").displayPublishDate}):null)}}])&&C(t.prototype,n),d}(n(8204).T);(0,r.X)("page-search",R)},7714:function(e,t,n){n.d(t,{M:function(){return o}}),n(4517);var r=n(5466),i=n(3074),a=n.n(i);function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function o(e){var t=r.createElement("span",null,r.createElement("span",null,e.children)),n={tabIndex:e.tabIndex||null,title:e.title||null,className:"circle-icon-button"+(void 0!==e.className?" "+e.className:"")+(e.buttonShadow?" button-shadow":"")};return void 0!==e["data-page-id"]&&(n["data-page-id"]=e["data-page-id"]),void 0!==e["aria-label"]&&(n["aria-label"]=e["aria-label"]),"link"===e.type?r.createElement("a",l({},n,{href:e.href||null,rel:e.rel||null}),t):"span"===e.type?r.createElement("span",l({},n,{onClick:e.onClick||null}),t):r.createElement("button",l({},n,{onClick:e.onClick||null}),t)}o.propTypes={type:a().oneOf(["button","link","span"]),buttonShadow:a().bool,className:a().string},o.defaultProps={type:"button",buttonShadow:!1}},7446:function(e,t,n){n.d(t,{j:function(){return o}}),n(2070);var r=n(5466),i=n(3074),a=n.n(i),l=n(2299);function o(e){return e.options.map((function(t){return r.createElement("div",{key:t.id,className:t.id===e.selected?"active":""},r.createElement("button",{onClick:e.onSelect,filter:e.id,value:t.id},r.createElement("span",null,t.title),t.id===e.selected?r.createElement(l.O,{type:"close"}):null))}))}o.propTypes={id:a().string.isRequired,selected:a().string.isRequired,onSelect:a().func.isRequired}},2915:function(e,t,n){n.d(t,{_:function(){return s}}),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(288),n(4458),n(3675);var r=n(5466),i=n(3074),a=n.n(i),l=n(2299);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t,n,i=(t=(0,r.useState)(e.active),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],s=i[1];return r.createElement("div",{className:"mi-filters-toggle"},r.createElement("button",{className:a?"active":"","aria-label":"Filter",onClick:function(){s(!a),void 0!==e.onClick&&e.onClick()}},r.createElement(l.O,{type:"filter_list"}),r.createElement("span",{className:"filter-button-label"},r.createElement("span",{className:"filter-button-label-text"},"FILTERS"))))}s.propTypes={onClick:a().func,active:a().bool},s.defaultProps={active:!1}},4234:function(e,t,n){n.d(t,{CircleIconButton:function(){return r.M},FilterOptions:function(){return i.j},FiltersToggleButton:function(){return a._},MaterialIcon:function(){return l.O},NavigationContentApp:function(){return o.o},NavigationMenuList:function(){return s.S},Notifications:function(){return u.T},PopupMain:function(){return c.W8},PopupTop:function(){return c.HF},SpinnerLoader:function(){return f.i},UserThumbnail:function(){return d.q}});var r=n(7714),i=n(7446),a=n(2915),l=n(2299),o=n(2917),s=n(5671),u=n(2436),c=(n(5517),n(940)),f=n(6309),d=n(6142)},2299:function(e,t,n){n.d(t,{O:function(){return i}});var r=n(5466),i=function(e){var t=e.type;return t?r.createElement("i",{className:"material-icons","data-icon":t}):null}},2917:function(e,t,n){n.d(t,{o:function(){return s}}),n(3233),n(9751),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(288),n(4458),n(3675);var r=n(5466),i=n(6116),a=n(3074),l=n.n(a);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function s(e){var t,n,a=(0,r.useRef)(null),l=(t=(0,r.useState)(null),n=2,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=l[0],u=l[1],c=[];function f(t,n){var r;n.preventDefault(),n.stopPropagation(),r=c[t].id,void 0!==e.pages[r]&&u(r)}return(0,r.useEffect)((function(){void 0!==e.pages[e.initPage]?u(e.initPage):Object.keys(e.pages).length?u(Object.keys(e.pages)[0]):u(null)}),[e.initPage]),(0,r.useEffect)((function(){!function(){for(var e=0;e<c.length;)c[e].elem.removeEventListener("click",c[e].listener),e+=1;c=[]}(),s&&(function(){var t,n,r=(0,i.findDOMNode)(a.current),l=r.querySelectorAll(e.pageChangeSelector);if(l.length)for(t=0;t<l.length;)(n=(n=l[t].getAttribute(e.pageIdSelectorAttr))?n.trim():n)&&(c[t]={id:n,elem:l[t]},c[t].listener=function(e){return function(t){return f(e,t)}}(t),c[t].elem.addEventListener("click",c[t].listener)),t+=1;e.focusFirstItemOnPageChange&&r.focus()}(),"function"==typeof e.pageChangeCallback&&e.pageChangeCallback(s))}),[s]),s?r.createElement("div",{ref:a},r.cloneElement(e.pages[s])):null}s.propTypes={initPage:l().string,pages:l().object.isRequired,pageChangeSelector:l().string.isRequired,pageIdSelectorAttr:l().string.isRequired,focusFirstItemOnPageChange:l().bool,pageChangeCallback:l().func},s.defaultProps={focusFirstItemOnPageChange:!0}},5671:function(e,t,n){n.d(t,{S:function(){return u}}),n(9808),n(3233),n(2070),n(4517);var r=n(5466),i=n(3074),a=n.n(i),l=n(2299);function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function s(e){var t=[],n=e.itemAttr||{};void 0===n.className?n.className="":n.className&&(n.className+=" ");var i=e.text?e.icon&&"right"!==e.iconPos?1:0:-1,a=e.icon?e.text&&"right"===e.iconPos?1:0:-1;switch(-1<i&&(t[i]=r.createElement("span",{key:"Text"},e.text)),-1<a&&(t[a]=r.createElement("span",{key:"Icon",className:"right"===e.iconPos?"menu-item-icon-right":"menu-item-icon"},r.createElement(l.O,{type:e.icon}))),e.itemType){case"link":t=r.createElement("a",o({},e.linkAttr||{},{href:e.link,title:e.text||null}),t),n.className+="link-item"+(e.active?" active":"");break;case"button":case"open-subpage":t=r.createElement("button",o({},e.buttonAttr||{},{key:"button"}),t);break;case"label":t=r.createElement("button",o({},e.buttonAttr||{},{key:"button"}),r.createElement("span",null,e.text||null)),n.className="label-item";break;case"div":t=r.createElement("div",o({},e.divAttr||{},{key:"div"}),e.text||null)}return""!==n.className&&(n.className=" "+n.className),n.className=n.className.trim(),r.createElement("li",n,t)}function u(e){var t=e.items.map((function(e,t){return r.createElement(s,o({key:t},e))}));return t.length?r.createElement("div",{className:"nav-menu"+(e.removeVerticalPadding?" pv0":"")},r.createElement("nav",null,r.createElement("ul",null,t))):null}s.propTypes={itemType:a().oneOf(["link","open-subpage","button","label","div"]),link:a().string,icon:a().string,iconPos:a().oneOf(["left","right"]),text:a().string,active:a().bool,divAttr:a().object,buttonAttr:a().object,itemAttr:a().object,linkAttr:a().object},s.defaultProps={itemType:"link",iconPos:"left",active:!1},u.propTypes={removeVerticalPadding:a().bool,items:a().arrayOf(a().shape(s.propTypes)).isRequired},u.defaultProps={removeVerticalPadding:!1}},940:function(e,t,n){n.d(t,{HF:function(){return a},W8:function(){return l}});var r=n(5466),i=r.forwardRef((function(e,t){return void 0!==e.children?r.createElement("div",{ref:t,className:"popup"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}));function a(e){return void 0!==e.children?r.createElement("div",{className:"popup-top"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}function l(e){return void 0!==e.children?r.createElement("div",{className:"popup-main"+(void 0!==e.className?" "+e.className:""),style:e.style},e.children):null}t.ZP=i},8982:function(e,t,n){n.d(t,{ItemListAsync:function(){return y}}),n(2070),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(288),n(4458),n(3675),n(4517),n(9751),n(8833),n(815),n(5090),n(9174);var r=n(5466),i=n(3074),a=n.n(i),l=n(2546),o=n(7777),s=n(2832),u=n(3632),c=n(8986);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(){return(m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y(e){var t,n,i=(t=(0,l.useItemListSync)(e),n=11,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,a=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){o=!0,i=e}finally{try{l||null==n.return||n.return()}finally{if(o)throw i}}return a}}(t,n)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=i[0],o=i[1],f=i[2],d=i[3],p=i[4],y=i[5],b=i[6],v=i[7],g=i[8],E=i[9],O=i[10];return(0,r.useEffect)((function(){return d(new c.g(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,v,g)),function(){f&&(f.cancelAll(),d(null))}}),[]),a?o.length?r.createElement("div",{className:p.listOuter},E(),r.createElement("div",{ref:y,className:"items-list-wrap"},r.createElement("div",{ref:b,className:p.list},o.map((function(t,n){return r.createElement(u.H,m({key:n},(0,u.j)(e,t,n)))})))),O()):null:r.createElement(s.K,{className:p.listOuter})}y.propTypes=d(d({},o.s.propTypes),{},{items:a().array,requestUrl:a().string.isRequired,firstItemRequestUrl:a().string}),y.defaultProps=d(d({},o.s.defaultProps),{},{requestUrl:null,firstItemRequestUrl:null,pageItems:24})},1450:function(e,t,n){function r(){var e,t,n,r=null;if(document.cookie&&""!==document.cookie)for(t=document.cookie.split(";"),e=0;e<t.length;){if("csrftoken="===(n=t[e].trim()).substring(0,10)){r=decodeURIComponent(n.substring(10));break}e+=1}return r}n.d(t,{o:function(){return r}}),n(2322),n(9268),n(3233)},1397:function(e,t,n){n.d(t,{U:function(){return a}}),n(2322),n(3296),n(6394),n(4669);var r=n(137),i=n.n(r);function a(e,t){var n=i()(e,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=i()(t+"/"+e.replace(/^\//g,""),{})),n.toString()}},447:function(e,t,n){n.d(t,{A_:function(){return o},j0:function(){return u},GH:function(){return f},Jl:function(){return p}}),n(7588),n(6394),n(5334);var r=n(4559),i=n.n(r);function a(e,t,n,r,i,a,l){try{var o=e[a](l),s=o.value}catch(e){return void n(e)}o.done?t(s):Promise.resolve(s).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var l=e.apply(t,n);function o(e){a(l,r,i,o,s,"next",e)}function s(e){a(l,r,i,o,s,"throw",e)}o(void 0)}))}}function o(e,t,n,r){return s.apply(this,arguments)}function s(){return(s=l(regeneratorRuntime.mark((function e(t,n,i,a){var l,o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=function(e){if(a instanceof Function){var t=e;if(void 0===e.response)t={type:"network",error:e};else if(void 0!==e.response.status)switch(e.response.status){case 401:t={type:"private",error:e,message:"Media is private"};break;case 400:t={type:"unavailable",error:e,message:"Media is unavailable"}}a(t)}},o=function(e){i instanceof Function&&i(e)},l={timeout:null,maxContentLength:null},!n){e.next=8;break}return e.next=6,(0,r.get)(t,l).then(o).catch(s||null);case 6:e.next=9;break;case 8:(0,r.get)(t,l).then(o).catch(s||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function u(e,t,n,r,i,a){return c.apply(this,arguments)}function c(){return(c=l(regeneratorRuntime.mark((function e(t,n,i,a,l,o){var s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=function(e){o instanceof Function&&o(e)},s=function(e){l instanceof Function&&l(e)},n=n||{},!a){e.next=8;break}return e.next=6,(0,r.post)(t,n,i||null).then(s).catch(u||null);case 6:e.next=9;break;case 8:(0,r.post)(t,n,i||null).then(s).catch(u||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function f(e,t,n,r,i,a){return d.apply(this,arguments)}function d(){return(d=l(regeneratorRuntime.mark((function e(t,n,i,a,l,o){var s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=function(e){o instanceof Function&&o(e)},s=function(e){l instanceof Function&&l(e)},n=n||{},!a){e.next=8;break}return e.next=6,(0,r.put)(t,n,i||null).then(s).catch(u||null);case 6:e.next=9;break;case 8:(0,r.put)(t,n,i||null).then(s).catch(u||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e,t,n,r,i){return m.apply(this,arguments)}function m(){return(m=l(regeneratorRuntime.mark((function e(t,n,r,a,l){var o,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=function(e){l instanceof Function&&l(e)},o=function(e){a instanceof Function&&a(e)},n=n||{},!r){e.next=8;break}return e.next=6,i().delete(t,n||null).then(o).catch(s||null);case 6:e.next=9;break;case 8:i().delete(t,n||null).then(o).catch(s||null);case 9:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},5910:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MediaListWrapper=void 0;var i=r(n(5466)),a=n(7180);n(3804),t.MediaListWrapper=function(e){var t=e.title,n=e.viewAllLink,r=e.viewAllText,l=e.className,o=e.style,s=e.children;return i.default.createElement("div",{className:(l?l+" ":"")+"media-list-wrapper",style:o},i.default.createElement(a.MediaListRow,{title:t,viewAllLink:n,viewAllText:r},s||null))}}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,r),a.exports}r.m=t,e=[],r.O=function(t,n,i,a){if(!n){var l=1/0;for(u=0;u<e.length;u++){n=e[u][0],i=e[u][1],a=e[u][2];for(var o=!0,s=0;s<n.length;s++)(!1&a||l>=a)&&Object.keys(r.O).every((function(e){return r.O[e](n[s])}))?n.splice(s--,1):(o=!1,a<l&&(l=a));o&&(e.splice(u--,1),t=i())}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,i,a]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=464,function(){var e={464:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,a,l=n[0],o=n[1],s=n[2],u=0;for(i in o)r.o(o,i)&&(r.m[i]=o[i]);if(s)var c=s(r);for(t&&t(n);u<l.length;u++)a=l[u],r.o(e,a)&&e[a]&&e[a][0](),e[l[u]]=0;return r.O(c)},n=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var i=r.O(void 0,[431],(function(){return r(1213)}));i=r.O(i)}(); |