diff --git a/js/h5p-hub-registration.js b/js/h5p-hub-registration.js index c77a78e..72c206e 100644 --- a/js/h5p-hub-registration.js +++ b/js/h5p-hub-registration.js @@ -34,4 +34,4 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r,i,o,a,l;if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},i=function(e,t){c=setTimeout(e,t)},o=function(){clearTimeout(c)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout;if("undefined"!=typeof console){var v=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof v&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var g=p.now();t.unstable_now=function(){return p.now()-g}}var y=!1,b=null,w=-1,k=5,x=0;a=function(){return t.unstable_now()>=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0P(a,n))void 0!==u&&0>P(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>P(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var N=[],O=[],R=1,z=null,I=3,D=!1,M=!1,L=!1;function F(e){for(var t=C(O);null!==t;){if(null===t.callback)_(O);else{if(!(t.startTime<=e))break;_(O),t.sortIndex=t.expirationTime,S(N,t)}t=C(O)}}function A(e){if(L=!1,F(e),!M)if(null!==C(N))M=!0,r(j);else{var t=C(O);null!==t&&i(A,t.startTime-e)}}function j(e,n){M=!1,L&&(L=!1,o()),D=!0;var r=I;try{for(F(n),z=C(N);null!==z&&(!(z.expirationTime>n)||e&&!a());){var l=z.callback;if(null!==l){z.callback=null,I=z.priorityLevel;var u=l(z.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?z.callback=u:z===C(N)&&_(N),F(n)}else _(N);z=C(N)}if(null!==z)var c=!0;else{var s=C(O);null!==s&&i(A,s.startTime-n),c=!1}return c}finally{z=null,I=r,D=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){M||D||(M=!0,r(j))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return C(N)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0l?(e.sortIndex=u,S(O,e),null===C(N)&&e===C(O)&&(L?o():L=!0,i(A,u-l))):(e.sortIndex=a,S(N,e),M||D||(M=!0,r(j))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=C(N);return n!==z&&null!==z&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTimee.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(i)&&l.push("path="+i),r.isString(o)&&l.push("domain="+o),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(15);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(16),a=n.n(o),l=i.a.createContext(),u=n(4),c=n.n(u),s=n(3),f=n.n(s),d=n(1),p=n.n(d),m=(n(30),function(e){var t=e.children,n=e.name,r=e.onClick,o=e.variant,a=e.color,l=e.enabled,u=e.id,c=[];return n&&c.push(n),o&&c.push(o),a&&c.push(a),i.a.createElement("button",{id:u,type:"button",className:c.join(" "),onClick:r,disabled:!1===l},t)});m.propTypes={children:p.a.oneOfType([p.a.string,p.a.object]),name:p.a.string,onClick:p.a.func.isRequired,variant:p.a.string,color:p.a.string,enabled:p.a.bool,id:p.a.string};var h=m,v=(n(31),function(e){var t=e.label,n=e.description,r=e.mandatory,o=e.children,a=e.link,l=e.className;return i.a.createElement("div",{className:"form-element ".concat(r?"mandatory":""," ").concat(l||"")},i.a.createElement("label",{htmlFor:o.props.id},t),i.a.createElement("div",{className:"details-row"},n&&i.a.createElement("div",{className:"description"},n),a&&i.a.createElement("button",{className:"link-button",onClick:a.onClick},a.linkText)),o)});v.propTypes={label:p.a.string.isRequired,description:p.a.string,mandatory:p.a.bool,children:p.a.shape(),link:p.a.shape({onClick:p.a.func.isRequired,linkText:p.a.string.isRequired}),className:p.a.string};var g=v,y=n(5),b=n.n(y),w=(p.a.shape({title:p.a.string.isRequired,license:p.a.string.isRequired,licenseVersion:p.a.string.isRequired,disciplines:p.a.array.isRequired,language:p.a.string.isRequired,level:p.a.string}),p.a.shape({keywords:p.a.array,shortDescription:p.a.string,longDescription:p.a.string,icon:p.a.object,screenshots:p.a.array}),n(48),n(49),n(50),n(51),function(e){var t=e.src,n=new Image;n.src=t;var r={backgroundImage:"url('".concat(n.src,"')")};return i.a.createElement("span",{className:"image-preview",style:r})});w.propTypes={src:p.a.string};var k=w,x=(n(52),function(e){var t=e.onFile,n=e.clearImage,r=e.img,o=e.ariaLabel,a=i.a.createRef(),l=function(){t({}),n&&n()};return i.a.createElement("div",{className:"image-upload-container",role:"button",tabIndex:"0",onKeyDown:function(e){"Enter"===e.key?a.current.click():-1!==["Delete","Backspace"].indexOf(e.key)&&l()},"aria-label":o},r.src&&i.a.createElement(i.a.Fragment,null,i.a.createElement(k,{src:r.src}),i.a.createElement("span",{className:"icon-close",onClick:l})),i.a.createElement("div",{className:"image-upload ".concat(r.src?"image-selected":"")},i.a.createElement("input",{tabIndex:"-1",ref:a,type:"file",onChange:function(e){if(0!==e.target.files.length){var n=e.target.files[0];t({src:URL.createObjectURL(n),file:n})}}})))});x.propTypes={onFile:p.a.func.isRequired,clearImage:p.a.func,img:p.a.object.isRequired,ariaLabel:p.a.string.isRequired};var E=x,T=(n(53),function(e){var t=e.title,n=e.description,r=e.mainText;return i.a.createElement("div",{className:"text-field"},i.a.createElement("div",{className:"title"},t),i.a.createElement("div",{className:"description"},n),i.a.createElement("div",{className:"main-text"},r))});T.propTypes={text:p.a.string,description:p.a.string,mainText:p.a.string};n(54);var S=i.a.forwardRef((function(e,t){var n=e.id,r=e.label,o=e.checked,a=e.filter,l=e.onChecked,u=e.focused,c=e.checkboxChildren,s=e.navigateToChildren,f=e.parent,d=e.descendantsChecked,p=e.tabIndex,m=e.children;return i.a.createElement("li",{ref:t,id:n,key:a+n,className:"checkbox ".concat(o?"checked ":""," ").concat(u?"highlighted":""," ").concat(c?"parent":""),role:"checkbox","aria-checked":o,onClick:function(){return c?s(n,c):l(a,n,!o)},tabIndex:p||"0",onKeyDown:function(e){"Enter"!==e.key&&" "!=e.key||(l(a,n,!o),e.preventDefault())}},i.a.createElement("div",{className:"content",key:"label"+n},i.a.createElement("div",{className:"icon",onClick:function(e){return c?function(e,t,n,r){r.stopPropagation(),l(e,t,n,f)}(a,n,!o,e):{}}}),i.a.createElement("div",{className:"label-text"},m||r,d>0&&" (".concat(d,")"))))}));S.propTypes={id:p.a.string.isRequired,label:p.a.string.isRequired,onChecked:p.a.func.isRequired,checked:p.a.bool.isRequired,filter:p.a.string.isRequired,focused:p.a.bool,children:p.a.any,checkboxChildren:p.a.array,navigateToChildren:p.a.func,parent:p.a.string,tabIndex:p.a.string,descendantsChecked:p.a.any};var C=S,_=(n(55),function(e){var t=e.severity,n=e.children;return i.a.createElement("div",{className:"message ".concat(t)},n)});_.propTypes={severity:p.a.string.isRequired,children:p.a.node};var P=_;function N(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 O(e){for(var t=1;t=x},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125>>1,i=e[r];if(!(void 0!==i&&0P(a,n))void 0!==u&&0>P(u,a)?(e[r]=u,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==u&&0>P(u,n)))break e;e[r]=u,e[l]=n,r=l}}}return t}return null}function P(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var N=[],O=[],R=1,z=null,I=3,D=!1,M=!1,L=!1;function F(e){for(var t=C(O);null!==t;){if(null===t.callback)_(O);else{if(!(t.startTime<=e))break;_(O),t.sortIndex=t.expirationTime,S(N,t)}t=C(O)}}function A(e){if(L=!1,F(e),!M)if(null!==C(N))M=!0,r(j);else{var t=C(O);null!==t&&i(A,t.startTime-e)}}function j(e,n){M=!1,L&&(L=!1,o()),D=!0;var r=I;try{for(F(n),z=C(N);null!==z&&(!(z.expirationTime>n)||e&&!a());){var l=z.callback;if(null!==l){z.callback=null,I=z.priorityLevel;var u=l(z.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?z.callback=u:z===C(N)&&_(N),F(n)}else _(N);z=C(N)}if(null!==z)var c=!0;else{var s=C(O);null!==s&&i(A,s.startTime-n),c=!1}return c}finally{z=null,I=r,D=!1}}function U(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var B=l;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){M||D||(M=!0,r(j))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return C(N)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var n=I;I=t;try{return e()}finally{I=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=B,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=I;I=e;try{return t()}finally{I=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var u=a.delay;u="number"==typeof u&&0l?(e.sortIndex=u,S(O,e),null===C(N)&&e===C(O)&&(L?o():L=!0,i(A,u-l))):(e.sortIndex=a,S(N,e),M||D||(M=!0,r(j))),e},t.unstable_shouldYield=function(){var e=t.unstable_now();F(e);var n=C(N);return n!==z&&null!==z&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTimee.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)return;a[t]="set-cookie"===t?(a[t]?a[t]:[]).concat([n]):a[t]?a[t]+", "+n:n}})),a):a}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function i(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=i(window.location.href),function(t){var n=r.isString(t)?i(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,i,o,a){var l=[];l.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&l.push("expires="+new Date(n).toGMTString()),r.isString(i)&&l.push("path="+i),r.isString(o)&&l.push("domain="+o),!0===a&&l.push("secure"),document.cookie=l.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(15);function i(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}i.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},i.source=function(){var e;return{token:new i((function(t){e=t})),cancel:e}},e.exports=i},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(0),i=n.n(r),o=n(16),a=n.n(o),l=i.a.createContext(),u=n(4),c=n.n(u),s=n(3),f=n.n(s),d=n(1),p=n.n(d),m=(n(30),function(e){var t=e.children,n=e.name,r=e.onClick,o=e.variant,a=e.color,l=e.enabled,u=e.id,c=[];return n&&c.push(n),o&&c.push(o),a&&c.push(a),i.a.createElement("button",{id:u,type:"button",className:c.join(" "),onClick:r,disabled:!1===l},t)});m.propTypes={children:p.a.oneOfType([p.a.string,p.a.object]),name:p.a.string,onClick:p.a.func.isRequired,variant:p.a.string,color:p.a.string,enabled:p.a.bool,id:p.a.string};var h=m,v=(n(31),function(e){var t=e.label,n=e.description,r=e.mandatory,o=e.children,a=e.link,l=e.className;return i.a.createElement("div",{className:"form-element ".concat(r?"mandatory":""," ").concat(l||"")},i.a.createElement("label",{htmlFor:o.props.id},t),i.a.createElement("div",{className:"details-row"},n&&i.a.createElement("div",{className:"description"},n),a&&i.a.createElement("button",{className:"link-button",onClick:a.onClick},a.linkText)),o)});v.propTypes={label:p.a.string.isRequired,description:p.a.string,mandatory:p.a.bool,children:p.a.shape(),link:p.a.shape({onClick:p.a.func.isRequired,linkText:p.a.string.isRequired}),className:p.a.string};var g=v,y=n(5),b=n.n(y),w=(p.a.shape({title:p.a.string.isRequired,license:p.a.string.isRequired,licenseVersion:p.a.string.isRequired,disciplines:p.a.array.isRequired,language:p.a.string.isRequired,level:p.a.string}),p.a.shape({keywords:p.a.array,shortDescription:p.a.string,longDescription:p.a.string,icon:p.a.object,screenshots:p.a.array}),n(48),n(49),n(50),n(51),function(e){var t=e.src,n=new Image;n.src=t;var r={backgroundImage:"url('".concat(n.src,"')")};return i.a.createElement("span",{className:"image-preview",style:r})});w.propTypes={src:p.a.string};var k=w,x=(n(52),function(e){var t=e.onFile,n=e.clearImage,r=e.img,o=e.ariaLabel,a=i.a.createRef(),l=function(){t({}),n&&n()};return i.a.createElement("div",{className:"image-upload-container",role:"button",tabIndex:"0",onKeyDown:function(e){"Enter"===e.key?a.current.click():-1!==["Delete","Backspace"].indexOf(e.key)&&l()},"aria-label":o},r&&r.src&&i.a.createElement(i.a.Fragment,null,i.a.createElement(k,{src:r.src}),i.a.createElement("span",{className:"icon-close",onClick:l})),i.a.createElement("div",{className:"image-upload ".concat(r&&r.src?"image-selected":"")},i.a.createElement("input",{tabIndex:"-1",ref:a,type:"file",onChange:function(e){if(0!==e.target.files.length){var n=e.target.files[0];t({src:URL.createObjectURL(n),file:n})}}})))});x.propTypes={onFile:p.a.func.isRequired,clearImage:p.a.func,img:p.a.object,ariaLabel:p.a.string.isRequired};var E=x,T=(n(53),function(e){var t=e.title,n=e.description,r=e.mainText;return i.a.createElement("div",{className:"text-field"},i.a.createElement("div",{className:"title"},t),i.a.createElement("div",{className:"description"},n),i.a.createElement("div",{className:"main-text"},r))});T.propTypes={text:p.a.string,description:p.a.string,mainText:p.a.string};n(54);var S=i.a.forwardRef((function(e,t){var n=e.id,r=e.label,o=e.checked,a=e.filter,l=e.onChecked,u=e.focused,c=e.checkboxChildren,s=e.navigateToChildren,f=e.parent,d=e.descendantsChecked,p=e.tabIndex,m=e.children;return i.a.createElement("li",{ref:t,id:n,key:a+n,className:"checkbox ".concat(o?"checked ":""," ").concat(u?"highlighted":""," ").concat(c?"parent":""),role:"checkbox","aria-checked":o,onClick:function(){return c?s(n,c):l(a,n,!o)},tabIndex:p||"0",onKeyDown:function(e){"Enter"!==e.key&&" "!=e.key||(l(a,n,!o),e.preventDefault())}},i.a.createElement("div",{className:"content",key:"label"+n},i.a.createElement("div",{className:"icon",onClick:function(e){return c?function(e,t,n,r){r.stopPropagation(),l(e,t,n,f)}(a,n,!o,e):{}}}),i.a.createElement("div",{className:"label-text"},m||r,d>0&&" (".concat(d,")"))))}));S.propTypes={id:p.a.string.isRequired,label:p.a.string.isRequired,onChecked:p.a.func.isRequired,checked:p.a.bool.isRequired,filter:p.a.string.isRequired,focused:p.a.bool,children:p.a.any,checkboxChildren:p.a.array,navigateToChildren:p.a.func,parent:p.a.string,tabIndex:p.a.string,descendantsChecked:p.a.any};var C=S,_=(n(55),function(e){var t=e.severity,n=e.children;return i.a.createElement("div",{className:"message ".concat(t)},n)});_.propTypes={severity:p.a.string.isRequired,children:p.a.node};var P=_;function N(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 O(e){for(var t=1;t0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==l&&document.body.appendChild(l)):(i.parentElement&&i.parentElement.removeChild(i),l.parentElement&&l.parentElement.removeChild(l))}))},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l){var u=e.displayName||e.name,s="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return i})),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},function(e,t,n){},function(e,t,n){var r=n(16);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(7),i=n.n(a),l=o.a.createContext(),u=o.a.createContext(),s=n(2),c=n.n(s),f=n(3),d=n.n(f),p=n(1),h=n.n(p),m=(n(43),function(e){var t=e.children,n=e.name,r=e.onClick,a=e.variant,i=e.color,l=e.enabled,u=e.id,s=[];return n&&s.push(n),a&&s.push(a),i&&s.push(i),o.a.createElement("button",{id:u,type:"button",className:s.join(" "),onClick:r,disabled:!1===l},t)});m.propTypes={children:h.a.oneOfType([h.a.string,h.a.object]),name:h.a.string,onClick:h.a.func.isRequired,variant:h.a.string,color:h.a.string,enabled:h.a.bool,id:h.a.string};var v=m;n(44);function y(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 g(e){for(var t=1;tn&&(a.completed=!0),[n>0?o.a.createElement(b,{key:"connector-".concat(n)}):null,o.a.cloneElement(e,g(g({key:"step-".concat(n)},a),e.props))]}));return o.a.createElement("div",{className:"stepper","aria-hidden":!0},a)};w.propTypes={activeStep:h.a.number.isRequired,children:h.a.array.isRequired,completed:h.a.bool};var E=w,k=(n(45),function(e){var t=e.active,n=e.label,r=e.index,a=e.completed,i=["step"];return t&&i.push("active"),a&&i.push("completed"),o.a.createElement("div",{className:i.join(" ")},o.a.createElement("div",{className:"step-icon"},a?o.a.createElement("i",{className:"icon-check"}):r+1),o.a.createElement("div",{className:"step-label"},n))});k.propTypes={active:h.a.bool,label:h.a.string.isRequired,index:h.a.number.isRequired,completed:h.a.bool};var x=k,C=(n(46),function(e){var t=e.label,n=e.description,r=e.mandatory,a=e.children,i=e.link,l=e.className;return o.a.createElement("div",{className:"form-element ".concat(r?"mandatory":""," ").concat(l||"")},o.a.createElement("label",{htmlFor:a.props.id},t),o.a.createElement("div",{className:"details-row"},n&&o.a.createElement("div",{className:"description"},n),i&&o.a.createElement("button",{className:"link-button",onClick:i.onClick},i.linkText)),a)});C.propTypes={label:h.a.string.isRequired,description:h.a.string,mandatory:h.a.bool,children:h.a.shape(),link:h.a.shape({onClick:h.a.func.isRequired,linkText:h.a.string.isRequired}),className:h.a.string};var S=C,T=(n(47),function(e){var t=e.selected,n=e.options,r=e.onChange,a=e.allowNone;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"icon-arrow-down"}),o.a.createElement("select",{value:t,onChange:r,disabled:0===n.length},function(e,t){var n=o.a.createElement("option",{value:"",key:"-"},"-");if(e.length>0){var r=t?[n]:[];return r=r.concat(e.map((function(e){return o.a.createElement("option",{value:e.id,key:e.id},e.name)})))}return n}(n,a)))});T.prototypes={selected:h.a.string,options:h.a.array,onchange:h.a.func.isRequired,allowNone:h.a.bool},T.defaultProps={allowNone:!1};var O=T,_=n(11),P=n.n(_),N=function(e,t){for(var n in t)e=e.replace(n,t[n]);return e},R=h.a.shape({title:h.a.string.isRequired,license:h.a.string.isRequired,licenseVersion:h.a.string.isRequired,disciplines:h.a.array.isRequired,language:h.a.string.isRequired,level:h.a.string}),D=h.a.shape({keywords:h.a.array,shortDescription:h.a.string,longDescription:h.a.string,icon:h.a.object,screenshots:h.a.array}),j=n(28),I=n.n(j),L=(n(73),function(e){var t=e.isOpen,n=e.closeModal,r=e.children,a=e.onAfterOpen;return o.a.createElement("div",null,o.a.createElement(I.a,{isOpen:t,className:"modal-content",onRequestClose:function(){document.querySelector(".h5p-hub-publish").removeAttribute("aria-hidden"),n()},onAfterOpen:a,overlayClassName:"modal-overlay",appElement:document.getElementById("h5p-hub-publish-modal-wrapper"),parentSelector:function(){return document.querySelector(".h5p-hub-publish")}},r))});L.propTypes={isOpen:h.a.bool.isRequired,closeModal:h.a.func.isRequired,children:h.a.shape(),onAfterOpen:h.a.func};var A=L,M=n(6),F=n.n(M),z=(n(77),function(e){var t=e.chips,n=e.setChips,r=o.a.useContext(l),a=o.a.useRef([]);o.a.useEffect((function(){a.current=a.current.slice(0,t.length)}),[t]);var i=function(e){"Backspace"!==e.key&&"Delete"!==e.key||u(function(e){for(var n=0;n1&&a.current[0!==r?r-1:1]&&a.current[0!==r?r-1:1].focus(),n(t.filter((function(t){return t.id!==e.id})).map((function(e){return e.id})))};return t.length>0?o.a.createElement("ul",{className:"chips-list"},t.map((function(e,t){return o.a.createElement("li",{key:e.id},o.a.createElement("span",{className:"sr-only"},e.name),o.a.createElement("button",{ref:function(e){return a.current[t]=e},"aria-label":N(r.removeChip,{":chip":e.name}),onClick:function(){return u(e)},onKeyDown:function(e){return i(e)},id:e.id},e.name,o.a.createElement("div",{className:"icon-close"})))}))):null});z.propTypes={chips:h.a.array.isRequired,setChips:h.a.func.isRequired};var U=z,q=n(8),V=n.n(q),B=n(9),W=n.n(B),H=n(4),$=n.n(H),Q=n(29),K=n.n(Q),Y=n(30),X=n.n(Y),G=n(12),J=n.n(G),Z=(n(80),o.a.forwardRef((function(e,t){var n=e.id,r=e.label,a=e.checked,i=e.filter,l=e.onChecked,u=e.focused,s=e.checkboxChildren,c=e.navigateToChildren,f=e.parent,d=e.descendantsChecked,p=e.tabIndex,h=e.children;return o.a.createElement("li",{ref:t,id:n,key:i+n,className:"checkbox ".concat(a?"checked ":""," ").concat(u?"highlighted":""," ").concat(s?"parent":""),role:"checkbox","aria-checked":a,onClick:function(){return s?c(n,s):l(i,n,!a)},tabIndex:p||"0",onKeyDown:function(e){"Enter"!==e.key&&" "!=e.key||(l(i,n,!a),e.preventDefault())}},o.a.createElement("div",{className:"content",key:"label"+n},o.a.createElement("div",{className:"icon",onClick:function(e){return s?function(e,t,n,r){r.stopPropagation(),l(e,t,n,f)}(i,n,!a,e):{}}}),o.a.createElement("div",{className:"label-text"},h||r,d>0&&" (".concat(d,")"))))})));Z.propTypes={id:h.a.string.isRequired,label:h.a.string.isRequired,onChecked:h.a.func.isRequired,checked:h.a.bool.isRequired,filter:h.a.string.isRequired,focused:h.a.bool,children:h.a.any,checkboxChildren:h.a.array,navigateToChildren:h.a.func,parent:h.a.string,tabIndex:h.a.string,descendantsChecked:h.a.any};var ee=Z,te=function(e,t){return-1!==t.indexOf(e)},ne=function(e,t,n){return e?e.filter((function(e){return te(e.id,t)&&-1===n.indexOf(e.id)})).length:0},re=(n(81),o.a.forwardRef((function(e,t){var n=e.items,r=e.onChecked,a=e.checkedParents,i=e.checked,l=e.filter,u=e.focused,s=e.navigateToChildren,c=e.parent,f=e.listRefId,d=e.getDescendants,p=e.tabIndex,h=e.inSearch;return o.a.createElement("ul",{className:"checkbox-list",id:"checkbox-list",role:"group","aria-labelledby":l.name,ref:t&&t[f]},n.map((function(e){return o.a.createElement(ee,{key:c+e.id,id:e.id,label:e.name,checked:te(e.id,i),filter:l,onChecked:r,focused:u==e.id,checkboxChildren:h?null:e.children,navigateToChildren:s,parent:c,descendantsChecked:e.children&&ne(d(e),i,a),ref:t&&t[e.id],tabIndex:p})})))})));re.propTypes={items:h.a.array,onChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,focused:h.a.string,navigateToChildren:h.a.func,parent:h.a.string,listRefId:h.a.string,tabIndex:h.a.string,inSearch:h.a.bool};var oe=re,ae=(n(82),o.a.forwardRef((function(e,t){var n=e.onChecked,r=e.checkedParents,a=e.checked,i=e.filter,l=e.focused,u=e.parent,s=e.listRefId,c=e.getDescendants,f=e.tabIndex,d=e.categoryList,p=e.searchValue,h=e.categoryRefId,m=e.dictionary,v=function(e){return e.map((function(e){return o.a.createElement("div",{key:u+e.id},o.a.createElement(ee,{key:u+e.id,id:e.id,label:e.name,checked:te(e.id,a),filter:i,onChecked:n,focused:l===e.id,parent:u,descendantsChecked:ne(c(e),a,r),ref:t&&t[e.id],tabIndex:f},p.length>1&&function(e,t){for(var n=[],r=t.length,a=0;a1&&void 0!==arguments[1]?arguments[1]:0;i.push(o.a.createElement("span",{key:"checkbox-span-"+a,className:"non-bold"},e.slice(t,t+r))),n[a+1]?i.push(o.a.createElement("span",{key:"checkbox-span-bold-"+a,className:"bold"},e.slice(t+r,n[a+1]))):i.push(o.a.createElement("span",{key:"checkbox-span-bold-"+a,className:"bold"},e.slice(t+r))),a+=1})),i.map((function(e){return e}))}(e.name,p)))}))};return o.a.createElement("ul",{className:"checkbox-list",id:"checkbox-list",role:"group","aria-labelledby":i.name,ref:t&&t[s]},d.map((function(e){return o.a.createElement("div",{key:"headers-"+e.id,className:e.noLine?"":"bottom-line"},o.a.createElement("div",null,null!==e.catNoParent?v([e.catNoParent]):null),e.children&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{key:e,ref:t[h+e.id],className:"category-header"},m.in," ",e.name),v(e.children)))})))})));ae.propTypes={onChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,focused:h.a.string,parent:h.a.string,listRefId:h.a.string.isRequired,tabIndex:h.a.string,categoryRefId:h.a.string.isRequired,checkedParents:h.a.array,getDescendants:h.a.func.isRequired,categoryList:h.a.array.isRequired,searchValue:h.a.string.isRequired,dictionary:h.a.object.isRequired};var ie=ae,le=(n(83),o.a.forwardRef((function(e,t){var n=e.value,r=e.onSearch,a=e.onNavigateVertical,i=e.onSelect,l=e.placeholder,u=e.onClick,s=e.onNavigateSideway,c=e.onFocus,f=e.inSearch,d=e.dictionary,p=e.closeDropdown;return o.a.createElement("div",{onMouseDown:u,className:"search-button",role:"button","aria-label":d.dropdownButton},o.a.createElement("div",{className:"search-field",role:"search"},o.a.createElement("input",{id:"filter-search-bar",type:"text",value:n,"aria-label":l,placeholder:l,ref:t,onKeyDown:function(e){return function(e){switch(e.key){case"ArrowUp":a(-1),e.preventDefault();break;case"ArrowDown":a(1),e.preventDefault();break;case"ArrowRight":f||(s(1),e.preventDefault());break;case"ArrowLeft":f||(s(-1),e.preventDefault());break;case"Enter":i(),e.preventDefault();break;case"Escape":p(),e.preventDefault()}}(e)},onChange:function(e){var t=e.target;r(t.value)},onFocus:c}),o.a.createElement("div",{className:"icon-arrow"})))})));le.propTypes={value:h.a.string,onSearch:h.a.func.isRequired,onNavigateVertical:h.a.func.isRequired,onNavigateSideway:h.a.func.isRequired,onSelect:h.a.func.isRequired,placeholder:h.a.string.isRequired,onClick:h.a.func.isRequired,onFocus:h.a.func,inSearch:h.a.bool},le.defaultProps={onNavigateVertical:function(){},onNavigateSideway:function(){},onSelect:function(){}};var ue=le;n(84);function se(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,a=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?n.push({id:o.id,name:o.name,children:i,catNoParent:a?o:null}):a&&n.push({id:o.id,name:o.name,catNoParent:o})}for(var l=0;l0){l=t.checkboxRefs[t.categoryRefId+t.state.categoryList[0].id].current.offsetHeight;var s,c=0,f=se(t.state.categoryList);try{for(f.s();!(s=f.n()).done;){var d=s.value;if(d.catNoParent&&(c+=1),c>n)break;d.children&&(c+=d.children.length),u+=1}}catch(e){f.e(e)}finally{f.f()}}var p=i+(n+1)*o+u*l-a;t.checkboxRefs[t.listRefId].current.scrollTop=p}})),c()($()(t),"handleNavigateSideway",(function(e){t.state.dropdownOpen&&-1==e&&t.state.parent?t.navigateToParent():t.state.dropdownOpen&&1==e&&t.state.focused&&t.getCheckboxFromId(t.state.focused,t.parents)&&t.navigateToChildren(t.state.focused,t.getCheckboxFromId(t.state.focused,t.parents).children)})),c()($()(t),"navigateToChildren",(function(e,n){t.setState({checkboxElements:n,parent:[].concat(F()(t.state.parent),[e])}),t.searchRef.current.focus()})),c()($()(t),"navigateToParent",(function(){var e=t.state.parent[t.state.parent.length-2],n=t.getCheckboxFromId(e,t.parents)&&t.getCheckboxFromId(e,t.parents).children,r=t.state.parent,o=r.pop();t.setState({parent:r,checkboxElements:n||t.props.items.sort(t.compare),focused:o}),t.searchRef.current.focus()})),c()($()(t),"compare",(function(e,t){var n=e.name.toUpperCase(),r=t.name.toUpperCase();return nr?1:void 0})),c()($()(t),"getDescendants",(function(e){if(null===e)return[];for(var t=[],n=[e];n.length>0;){var r=n.pop();r&&r.children&&(t.concat(r.children),r.children.forEach((function(e){t.push(e),n.push(e)})))}return t})),c()($()(t),"setParentsAndLeafs",(function(e){for(var n=0;n0:-1!=this.props.checked.indexOf(e)||-1!==this.state.checkedParents.indexOf(e)}},{key:"render",value:function(){var e=this;return o.a.createElement("div",{className:"search-filter",ref:this.selfRef},o.a.createElement(ue,{ref:this.searchRef,value:this.state.searchValue,onSearch:this.handleOnSearch,placeholder:this.props.dictionary.searchPlaceholder,onClick:this.handleSearchClick,onNavigateVertical:this.handleNavigateVertical,onSelect:function(){return e.handleChecked(e.props.filter,e.state.focused,!e.checkedOf(e.state.focused),e.state.parent[e.state.parent.length-1])},onNavigateSideway:this.handleNavigateSideway,onFocus:this.handleSearchFocus,inSearch:this.state.inSearch,dictionary:this.props.dictionary,closeDropdown:this.closeDropdown}),this.state.parent.length>0&&this.state.dropdownOpen&&o.a.createElement("div",{className:"navigate-parent"},o.a.createElement("button",{onClick:this.navigateToParent}),this.getCheckboxFromId(this.state.parent[this.state.parent.length-1],this.parents).name),this.state.searchValue.length>0&&o.a.createElement("button",{onClick:this.handleClearSearch,className:"clear-button"}),this.state.dropdownOpen&&this.props.items&&(!this.props.category||this.state.searchValue.length<2)&&o.a.createElement(oe,{onChecked:this.handleChecked,items:this.state.checkboxElements,checked:this.props.checked.concat(this.state.checkedParents),checkedParents:this.state.checkedParents,filter:this.props.filter,focused:this.state.focused,navigateToChildren:this.navigateToChildren,parent:this.state.parent[this.state.parent.length-1],ref:this.checkboxRefs,listRefId:this.listRefId,getDescendants:this.getDescendants,tabIndex:"-1",inSearch:this.state.inSearch}),this.state.dropdownOpen&&this.props.items&&this.props.category&&(this.state.categoryList.length>0||this.state.categoryList.topCategories)&&this.state.inSearch&&o.a.createElement(ie,{onChecked:this.handleChecked,checked:this.props.checked.concat(this.state.checkedParents),checkedParents:this.state.checkedParents,filter:this.props.filter,focused:this.state.focused,ref:this.checkboxRefs,listRefId:this.listRefId,getDescendants:this.getDescendants,tabIndex:"-1",categoryList:this.state.categoryList,searchValue:this.state.searchValue,categoryRefId:this.categoryRefId,dictionary:this.props.dictionary}))}}]),r}(o.a.Component);he.propTypes={items:h.a.array,handleChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,dictionary:h.a.object.isRequired,category:h.a.bool,dropdownAlwaysOpen:h.a.bool,setFocus:h.a.bool};var me=he,ve=function(e){var t=e.disciplines,n=e.setDisciplines,a=Object(r.useContext)(u),i=Object(r.useContext)(l),s=o.a.useState(!1),c=d()(s,2),f=c[0],p=c[1];return o.a.createElement(o.a.Fragment,null,o.a.createElement(U,{chips:t.map((function(e){return{id:e,name:a.getDiscipline(e).name}})),setChips:function(e){n(e),0===e.length&&p((function(e){return!e}))}}),o.a.createElement(me,{items:a.disciplines,handleChecked:function(e,r,o){if(Array.isArray(r)&&null!==r){var a=o?t.filter((function(e){return-1===r.indexOf(e)})).concat(r):t.filter((function(e){return-1===r.indexOf(e)}));n(a)}else if(null!=r){var i=o?[].concat(F()(t),[r]):t.filter((function(e){return e!==r}));n(i)}},checked:t,filter:"discipline",dictionary:i.discipline,category:!0,dropdownAlwaysOpen:!1,setFocus:f}))};ve.propTypes={disciplines:h.a.array.isRequired,setDisciplines:h.a.func.isRequired};var ye=ve;function ge(){return(ge=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function we(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Ee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var ke=!1,xe=o.a.createContext(null),Ce=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}we(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[i.a.findDOMNode(this),r],a=o[0],l=o[1],u=this.getTimeouts(),s=r?u.appear:u.enter;!e&&!n||ke?this.safeSetState({status:"entered"},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,l),this.safeSetState({status:"entering"},(function(){t.props.onEntering(a,l),t.onTransitionEnd(s,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(a,l)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:i.a.findDOMNode(this);t&&!ke?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:i.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=o[0],l=o[1];this.props.addEndListener(a,l)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,be(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return o.a.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,r):o.a.cloneElement(o.a.Children.only(n),r))},t}(o.a.Component);function Se(){}Ce.contextType=xe,Ce.propTypes={},Ce.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Se,onEntering:Se,onEntered:Se,onExit:Se,onExiting:Se,onExited:Se},Ce.UNMOUNTED="unmounted",Ce.EXITED="exited",Ce.ENTERING="entering",Ce.ENTERED="entered",Ce.EXITING="exiting";var Te=Ce,Oe=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ee(n.className,r):n.setAttribute("class",Ee(n.className&&n.className.baseVal||"",r)));var n,r}))},_e=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o0?c(!0):-1===t.indexOf(o)&&""!==o&&(n([].concat(F()(t),[o])),r.current.value="")}else c(!1)}(e)},ref:r,onFocus:function(){return m(!0)},onBlur:function(){return m(!1)}}),o.a.createElement(je,{text:a.keywordExists,open:s&&h,className:"tip-keywords"}))});We.propTypes={chips:h.a.array.isRequired,setKeywords:h.a.func.isRequired};var He=We,$e=(n(91),function(e){var t=e.src,n=new Image;n.src=t;var r={backgroundImage:"url('".concat(n.src,"')")};return o.a.createElement("span",{className:"image-preview",style:r})});$e.propTypes={src:h.a.string};var Qe=$e,Ke=(n(92),function(e){var t=e.onFile,n=e.clearImage,r=e.img,a=e.ariaLabel,i=o.a.createRef(),l=function(){t({}),n&&n()};return o.a.createElement("div",{className:"image-upload-container",role:"button",tabIndex:"0",onKeyDown:function(e){"Enter"===e.key?i.current.click():-1!==["Delete","Backspace"].indexOf(e.key)&&l()},"aria-label":a},r&&r.src&&o.a.createElement(o.a.Fragment,null,o.a.createElement(Qe,{src:r.src}),o.a.createElement("span",{className:"icon-close",onClick:l})),o.a.createElement("div",{className:"image-upload ".concat(r&&r.src?"image-selected":"")},o.a.createElement("input",{tabIndex:"-1",ref:i,type:"file",onChange:function(e){if(0!==e.target.files.length){var n=e.target.files[0];t({src:URL.createObjectURL(n),file:n})}}})))});Ke.propTypes={onFile:h.a.func.isRequired,clearImage:h.a.func,img:h.a.object,ariaLabel:h.a.string.isRequired};var Ye=Ke;n(93);function Xe(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 Ge(e){for(var t=1;t0?(document.body.firstChild!==i&&document.body.insertBefore(i,document.body.firstChild),document.body.lastChild!==l&&document.body.appendChild(l)):(i.parentElement&&i.parentElement.removeChild(i),l.parentElement&&l.parentElement.removeChild(l))}))},function(e,t,n){"use strict";function r(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function o(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function a(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}function i(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,i=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?i="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(i="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==i||null!==l){var u=e.displayName||e.name,s="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+u+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==i?"\n "+i:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=r,t.componentWillReceiveProps=o),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=a;var c=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var r=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;c.call(this,e,t,r)}}return e}n.r(t),n.d(t,"polyfill",(function(){return i})),r.__suppressDeprecationWarning=!0,o.__suppressDeprecationWarning=!0,a.__suppressDeprecationWarning=!0},function(e,t,n){},function(e,t,n){var r=n(16);e.exports=function(e){if(Array.isArray(e))return r(e)}},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},function(e,t,n){},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r),a=n(7),i=n.n(a),l=o.a.createContext(),u=o.a.createContext(),s=n(2),c=n.n(s),f=n(3),d=n.n(f),p=n(1),h=n.n(p),m=(n(43),function(e){var t=e.children,n=e.name,r=e.onClick,a=e.variant,i=e.color,l=e.enabled,u=e.id,s=[];return n&&s.push(n),a&&s.push(a),i&&s.push(i),o.a.createElement("button",{id:u,type:"button",className:s.join(" "),onClick:r,disabled:!1===l},t)});m.propTypes={children:h.a.oneOfType([h.a.string,h.a.object]),name:h.a.string,onClick:h.a.func.isRequired,variant:h.a.string,color:h.a.string,enabled:h.a.bool,id:h.a.string};var v=m;n(44);function y(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 g(e){for(var t=1;tn&&(a.completed=!0),[n>0?o.a.createElement(b,{key:"connector-".concat(n)}):null,o.a.cloneElement(e,g(g({key:"step-".concat(n)},a),e.props))]}));return o.a.createElement("div",{className:"stepper","aria-hidden":!0},a)};w.propTypes={activeStep:h.a.number.isRequired,children:h.a.array.isRequired,completed:h.a.bool};var E=w,k=(n(45),function(e){var t=e.active,n=e.label,r=e.index,a=e.completed,i=["step"];return t&&i.push("active"),a&&i.push("completed"),o.a.createElement("div",{className:i.join(" ")},o.a.createElement("div",{className:"step-icon"},a?o.a.createElement("i",{className:"icon-check"}):r+1),o.a.createElement("div",{className:"step-label"},n))});k.propTypes={active:h.a.bool,label:h.a.string.isRequired,index:h.a.number.isRequired,completed:h.a.bool};var x=k,C=(n(46),function(e){var t=e.label,n=e.description,r=e.mandatory,a=e.children,i=e.link,l=e.className;return o.a.createElement("div",{className:"form-element ".concat(r?"mandatory":""," ").concat(l||"")},o.a.createElement("label",{htmlFor:a.props.id},t),o.a.createElement("div",{className:"details-row"},n&&o.a.createElement("div",{className:"description"},n),i&&o.a.createElement("button",{className:"link-button",onClick:i.onClick},i.linkText)),a)});C.propTypes={label:h.a.string.isRequired,description:h.a.string,mandatory:h.a.bool,children:h.a.shape(),link:h.a.shape({onClick:h.a.func.isRequired,linkText:h.a.string.isRequired}),className:h.a.string};var S=C,T=(n(47),function(e){var t=e.selected,n=e.options,r=e.onChange,a=e.allowNone;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"icon-arrow-down"}),o.a.createElement("select",{value:t,onChange:r,disabled:0===n.length},function(e,t){var n=o.a.createElement("option",{value:"",key:"-"},"-");if(e.length>0){var r=t?[n]:[];return r=r.concat(e.map((function(e){return o.a.createElement("option",{value:e.id,key:e.id},e.name)})))}return n}(n,a)))});T.prototypes={selected:h.a.string,options:h.a.array,onchange:h.a.func.isRequired,allowNone:h.a.bool},T.defaultProps={allowNone:!1};var O=T,_=n(11),P=n.n(_),N=function(e,t){for(var n in t)e=e.replace(n,t[n]);return e},R=h.a.shape({title:h.a.string.isRequired,license:h.a.string.isRequired,licenseVersion:h.a.string.isRequired,disciplines:h.a.array.isRequired,language:h.a.string.isRequired,level:h.a.string}),D=h.a.shape({keywords:h.a.array,shortDescription:h.a.string,longDescription:h.a.string,icon:h.a.object,screenshots:h.a.array}),j=n(28),I=n.n(j),L=(n(73),function(e){var t=e.isOpen,n=e.closeModal,r=e.children,a=e.onAfterOpen;return o.a.createElement("div",null,o.a.createElement(I.a,{isOpen:t,className:"modal-content",onRequestClose:function(){document.querySelector(".h5p-hub-publish").removeAttribute("aria-hidden"),n()},onAfterOpen:a,overlayClassName:"modal-overlay",appElement:document.getElementById("h5p-hub-publish-modal-wrapper"),parentSelector:function(){return document.querySelector(".h5p-hub-publish")}},r))});L.propTypes={isOpen:h.a.bool.isRequired,closeModal:h.a.func.isRequired,children:h.a.shape(),onAfterOpen:h.a.func};var A=L,M=n(6),F=n.n(M),z=(n(77),function(e){var t=e.chips,n=e.setChips,r=o.a.useContext(l),a=o.a.useRef([]);o.a.useEffect((function(){a.current=a.current.slice(0,t.length)}),[t]);var i=function(e){"Backspace"!==e.key&&"Delete"!==e.key||u(function(e){for(var n=0;n1&&a.current[0!==r?r-1:1]&&a.current[0!==r?r-1:1].focus(),n(t.filter((function(t){return t.id!==e.id})).map((function(e){return e.id})))};return t.length>0?o.a.createElement("ul",{className:"chips-list"},t.map((function(e,t){return o.a.createElement("li",{key:e.id},o.a.createElement("span",{className:"sr-only"},e.name),o.a.createElement("button",{ref:function(e){return a.current[t]=e},"aria-label":N(r.removeChip,{":chip":e.name}),onClick:function(){return u(e)},onKeyDown:function(e){return i(e)},id:e.id},e.name,o.a.createElement("div",{className:"icon-close"})))}))):null});z.propTypes={chips:h.a.array.isRequired,setChips:h.a.func.isRequired};var U=z,q=n(8),V=n.n(q),B=n(9),W=n.n(B),H=n(4),$=n.n(H),Q=n(29),K=n.n(Q),Y=n(30),X=n.n(Y),G=n(12),J=n.n(G),Z=(n(80),o.a.forwardRef((function(e,t){var n=e.id,r=e.label,a=e.checked,i=e.filter,l=e.onChecked,u=e.focused,s=e.checkboxChildren,c=e.navigateToChildren,f=e.parent,d=e.descendantsChecked,p=e.tabIndex,h=e.children;return o.a.createElement("li",{ref:t,id:n,key:i+n,className:"checkbox ".concat(a?"checked ":""," ").concat(u?"highlighted":""," ").concat(s?"parent":""),role:"checkbox","aria-checked":a,onClick:function(){return s?c(n,s):l(i,n,!a)},tabIndex:p||"0",onKeyDown:function(e){"Enter"!==e.key&&" "!=e.key||(l(i,n,!a),e.preventDefault())}},o.a.createElement("div",{className:"content",key:"label"+n},o.a.createElement("div",{className:"icon",onClick:function(e){return s?function(e,t,n,r){r.stopPropagation(),l(e,t,n,f)}(i,n,!a,e):{}}}),o.a.createElement("div",{className:"label-text"},h||r,d>0&&" (".concat(d,")"))))})));Z.propTypes={id:h.a.string.isRequired,label:h.a.string.isRequired,onChecked:h.a.func.isRequired,checked:h.a.bool.isRequired,filter:h.a.string.isRequired,focused:h.a.bool,children:h.a.any,checkboxChildren:h.a.array,navigateToChildren:h.a.func,parent:h.a.string,tabIndex:h.a.string,descendantsChecked:h.a.any};var ee=Z,te=function(e,t){return-1!==t.indexOf(e)},ne=function(e,t,n){return e?e.filter((function(e){return te(e.id,t)&&-1===n.indexOf(e.id)})).length:0},re=(n(81),o.a.forwardRef((function(e,t){var n=e.items,r=e.onChecked,a=e.checkedParents,i=e.checked,l=e.filter,u=e.focused,s=e.navigateToChildren,c=e.parent,f=e.listRefId,d=e.getDescendants,p=e.tabIndex,h=e.inSearch;return o.a.createElement("ul",{className:"checkbox-list",id:"checkbox-list",role:"group","aria-labelledby":l.name,ref:t&&t[f]},n.map((function(e){return o.a.createElement(ee,{key:c+e.id,id:e.id,label:e.name,checked:te(e.id,i),filter:l,onChecked:r,focused:u==e.id,checkboxChildren:h?null:e.children,navigateToChildren:s,parent:c,descendantsChecked:e.children&&ne(d(e),i,a),ref:t&&t[e.id],tabIndex:p})})))})));re.propTypes={items:h.a.array,onChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,focused:h.a.string,navigateToChildren:h.a.func,parent:h.a.string,listRefId:h.a.string,tabIndex:h.a.string,inSearch:h.a.bool};var oe=re,ae=(n(82),o.a.forwardRef((function(e,t){var n=e.onChecked,r=e.checkedParents,a=e.checked,i=e.filter,l=e.focused,u=e.parent,s=e.listRefId,c=e.getDescendants,f=e.tabIndex,d=e.categoryList,p=e.searchValue,h=e.categoryRefId,m=e.dictionary,v=function(e){return e.map((function(e){return o.a.createElement("div",{key:u+e.id},o.a.createElement(ee,{key:u+e.id,id:e.id,label:e.name,checked:te(e.id,a),filter:i,onChecked:n,focused:l===e.id,parent:u,descendantsChecked:ne(c(e),a,r),ref:t&&t[e.id],tabIndex:f},p.length>1&&function(e,t){for(var n=[],r=t.length,a=0;a1&&void 0!==arguments[1]?arguments[1]:0;i.push(o.a.createElement("span",{key:"checkbox-span-"+a,className:"non-bold"},e.slice(t,t+r))),n[a+1]?i.push(o.a.createElement("span",{key:"checkbox-span-bold-"+a,className:"bold"},e.slice(t+r,n[a+1]))):i.push(o.a.createElement("span",{key:"checkbox-span-bold-"+a,className:"bold"},e.slice(t+r))),a+=1})),i.map((function(e){return e}))}(e.name,p)))}))};return o.a.createElement("ul",{className:"checkbox-list",id:"checkbox-list",role:"group","aria-labelledby":i.name,ref:t&&t[s]},d.map((function(e){return o.a.createElement("div",{key:"headers-"+e.id,className:e.noLine?"":"bottom-line"},o.a.createElement("div",null,null!==e.catNoParent?v([e.catNoParent]):null),e.children&&o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{key:e,ref:t[h+e.id],className:"category-header"},m.in," ",e.name),v(e.children)))})))})));ae.propTypes={onChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,focused:h.a.string,parent:h.a.string,listRefId:h.a.string.isRequired,tabIndex:h.a.string,categoryRefId:h.a.string.isRequired,checkedParents:h.a.array,getDescendants:h.a.func.isRequired,categoryList:h.a.array.isRequired,searchValue:h.a.string.isRequired,dictionary:h.a.object.isRequired};var ie=ae,le=(n(83),o.a.forwardRef((function(e,t){var n=e.value,r=e.onSearch,a=e.onNavigateVertical,i=e.onSelect,l=e.placeholder,u=e.onClick,s=e.onNavigateSideway,c=e.onFocus,f=e.inSearch,d=e.dictionary,p=e.closeDropdown;return o.a.createElement("div",{onMouseDown:u,className:"search-button",role:"button","aria-label":d.dropdownButton},o.a.createElement("div",{className:"search-field",role:"search"},o.a.createElement("input",{id:"filter-search-bar",type:"text",value:n,"aria-label":l,placeholder:l,ref:t,onKeyDown:function(e){return function(e){switch(e.key){case"ArrowUp":a(-1),e.preventDefault();break;case"ArrowDown":a(1),e.preventDefault();break;case"ArrowRight":f||(s(1),e.preventDefault());break;case"ArrowLeft":f||(s(-1),e.preventDefault());break;case"Enter":i(),e.preventDefault();break;case"Escape":p(),e.preventDefault()}}(e)},onChange:function(e){var t=e.target;r(t.value)},onFocus:c}),o.a.createElement("div",{className:"icon-arrow"})))})));le.propTypes={value:h.a.string,onSearch:h.a.func.isRequired,onNavigateVertical:h.a.func.isRequired,onNavigateSideway:h.a.func.isRequired,onSelect:h.a.func.isRequired,placeholder:h.a.string.isRequired,onClick:h.a.func.isRequired,onFocus:h.a.func,inSearch:h.a.bool},le.defaultProps={onNavigateVertical:function(){},onNavigateSideway:function(){},onSelect:function(){}};var ue=le;n(84);function se(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return ce(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,a=!0,i=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return a=e.done,e},e:function(e){i=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(i)throw o}}}}function ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?n.push({id:o.id,name:o.name,children:i,catNoParent:a?o:null}):a&&n.push({id:o.id,name:o.name,catNoParent:o})}for(var l=0;l0){l=t.checkboxRefs[t.categoryRefId+t.state.categoryList[0].id].current.offsetHeight;var s,c=0,f=se(t.state.categoryList);try{for(f.s();!(s=f.n()).done;){var d=s.value;if(d.catNoParent&&(c+=1),c>n)break;d.children&&(c+=d.children.length),u+=1}}catch(e){f.e(e)}finally{f.f()}}var p=i+(n+1)*o+u*l-a;t.checkboxRefs[t.listRefId].current.scrollTop=p}})),c()($()(t),"handleNavigateSideway",(function(e){t.state.dropdownOpen&&-1==e&&t.state.parent?t.navigateToParent():t.state.dropdownOpen&&1==e&&t.state.focused&&t.getCheckboxFromId(t.state.focused,t.parents)&&t.navigateToChildren(t.state.focused,t.getCheckboxFromId(t.state.focused,t.parents).children)})),c()($()(t),"navigateToChildren",(function(e,n){t.setState({checkboxElements:n,parent:[].concat(F()(t.state.parent),[e])}),t.searchRef.current.focus()})),c()($()(t),"navigateToParent",(function(){var e=t.state.parent[t.state.parent.length-2],n=t.getCheckboxFromId(e,t.parents)&&t.getCheckboxFromId(e,t.parents).children,r=t.state.parent,o=r.pop();t.setState({parent:r,checkboxElements:n||t.props.items.sort(t.compare),focused:o}),t.searchRef.current.focus()})),c()($()(t),"compare",(function(e,t){var n=e.name.toUpperCase(),r=t.name.toUpperCase();return nr?1:void 0})),c()($()(t),"getDescendants",(function(e){if(null===e)return[];for(var t=[],n=[e];n.length>0;){var r=n.pop();r&&r.children&&(t.concat(r.children),r.children.forEach((function(e){t.push(e),n.push(e)})))}return t})),c()($()(t),"setParentsAndLeafs",(function(e){for(var n=0;n0:-1!=this.props.checked.indexOf(e)||-1!==this.state.checkedParents.indexOf(e)}},{key:"render",value:function(){var e=this;return o.a.createElement("div",{className:"search-filter",ref:this.selfRef},o.a.createElement(ue,{ref:this.searchRef,value:this.state.searchValue,onSearch:this.handleOnSearch,placeholder:this.props.dictionary.searchPlaceholder,onClick:this.handleSearchClick,onNavigateVertical:this.handleNavigateVertical,onSelect:function(){return e.handleChecked(e.props.filter,e.state.focused,!e.checkedOf(e.state.focused),e.state.parent[e.state.parent.length-1])},onNavigateSideway:this.handleNavigateSideway,onFocus:this.handleSearchFocus,inSearch:this.state.inSearch,dictionary:this.props.dictionary,closeDropdown:this.closeDropdown}),this.state.parent.length>0&&this.state.dropdownOpen&&o.a.createElement("div",{className:"navigate-parent"},o.a.createElement("button",{onClick:this.navigateToParent}),this.getCheckboxFromId(this.state.parent[this.state.parent.length-1],this.parents).name),this.state.searchValue.length>0&&o.a.createElement("button",{onClick:this.handleClearSearch,className:"clear-button"}),this.state.dropdownOpen&&this.props.items&&(!this.props.category||this.state.searchValue.length<2)&&o.a.createElement(oe,{onChecked:this.handleChecked,items:this.state.checkboxElements,checked:this.props.checked.concat(this.state.checkedParents),checkedParents:this.state.checkedParents,filter:this.props.filter,focused:this.state.focused,navigateToChildren:this.navigateToChildren,parent:this.state.parent[this.state.parent.length-1],ref:this.checkboxRefs,listRefId:this.listRefId,getDescendants:this.getDescendants,tabIndex:"-1",inSearch:this.state.inSearch}),this.state.dropdownOpen&&this.props.items&&this.props.category&&(this.state.categoryList.length>0||this.state.categoryList.topCategories)&&this.state.inSearch&&o.a.createElement(ie,{onChecked:this.handleChecked,checked:this.props.checked.concat(this.state.checkedParents),checkedParents:this.state.checkedParents,filter:this.props.filter,focused:this.state.focused,ref:this.checkboxRefs,listRefId:this.listRefId,getDescendants:this.getDescendants,tabIndex:"-1",categoryList:this.state.categoryList,searchValue:this.state.searchValue,categoryRefId:this.categoryRefId,dictionary:this.props.dictionary}))}}]),r}(o.a.Component);he.propTypes={items:h.a.array,handleChecked:h.a.func.isRequired,checked:h.a.array,filter:h.a.string.isRequired,dictionary:h.a.object.isRequired,category:h.a.bool,dropdownAlwaysOpen:h.a.bool,setFocus:h.a.bool};var me=he,ve=function(e){var t=e.disciplines,n=e.setDisciplines,a=Object(r.useContext)(u),i=Object(r.useContext)(l),s=o.a.useState(!1),c=d()(s,2),f=c[0],p=c[1];return o.a.createElement(o.a.Fragment,null,o.a.createElement(U,{chips:t.map((function(e){return{id:e,name:a.getDiscipline(e).name}})),setChips:function(e){n(e),0===e.length&&p((function(e){return!e}))}}),o.a.createElement(me,{items:a.disciplines,handleChecked:function(e,r,o){if(Array.isArray(r)&&null!==r){var a=o?t.filter((function(e){return-1===r.indexOf(e)})).concat(r):t.filter((function(e){return-1===r.indexOf(e)}));n(a)}else if(null!=r){var i=o?[].concat(F()(t),[r]):t.filter((function(e){return e!==r}));n(i)}},checked:t,filter:"discipline",dictionary:i.discipline,category:!0,dropdownAlwaysOpen:!1,setFocus:f}))};ve.propTypes={disciplines:h.a.array.isRequired,setDisciplines:h.a.func.isRequired};var ye=ve;function ge(){return(ge=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function we(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}function Ee(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var ke=!1,xe=o.a.createContext(null),Ce=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var o,a=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?a?(o="exited",r.appearStatus="entering"):o="entered":o=t.unmountOnExit||t.mountOnEnter?"unmounted":"exited",r.state={status:o},r.nextCallback=null,r}we(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&"unmounted"===t.status?{status:"exited"}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?"entering"!==n&&"entered"!==n&&(t="entering"):"entering"!==n&&"entered"!==n||(t="exiting")}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){void 0===e&&(e=!1),null!==t?(this.cancelNextCallback(),"entering"===t?this.performEnter(e):this.performExit()):this.props.unmountOnExit&&"exited"===this.state.status&&this.setState({status:"unmounted"})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,o=this.props.nodeRef?[r]:[i.a.findDOMNode(this),r],a=o[0],l=o[1],u=this.getTimeouts(),s=r?u.appear:u.enter;!e&&!n||ke?this.safeSetState({status:"entered"},(function(){t.props.onEntered(a)})):(this.props.onEnter(a,l),this.safeSetState({status:"entering"},(function(){t.props.onEntering(a,l),t.onTransitionEnd(s,(function(){t.safeSetState({status:"entered"},(function(){t.props.onEntered(a,l)}))}))})))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:i.a.findDOMNode(this);t&&!ke?(this.props.onExit(r),this.safeSetState({status:"exiting"},(function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,(function(){e.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))}))}))):this.safeSetState({status:"exited"},(function(){e.props.onExited(r)}))},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:i.a.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var o=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],a=o[0],l=o[1];this.props.addEndListener(a,l)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if("unmounted"===e)return null;var t=this.props,n=t.children,r=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,be(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return o.a.createElement(xe.Provider,{value:null},"function"==typeof n?n(e,r):o.a.cloneElement(o.a.Children.only(n),r))},t}(o.a.Component);function Se(){}Ce.contextType=xe,Ce.propTypes={},Ce.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Se,onEntering:Se,onEntered:Se,onExit:Se,onExiting:Se,onExited:Se},Ce.UNMOUNTED="unmounted",Ce.EXITED="exited",Ce.ENTERING="entering",Ce.ENTERED="entered",Ce.EXITING="exiting";var Te=Ce,Oe=function(e,t){return e&&t&&t.split(" ").forEach((function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ee(n.className,r):n.setAttribute("class",Ee(n.className&&n.className.baseVal||"",r)));var n,r}))},_e=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o0?c(!0):-1===t.indexOf(o)&&""!==o&&(n([].concat(F()(t),[o])),r.current.value="")}else c(!1)}(e)},ref:r,onFocus:function(){return m(!0)},onBlur:function(){return m(!1)}}),o.a.createElement(je,{text:a.keywordExists,open:s&&h,className:"tip-keywords"}))});We.propTypes={chips:h.a.array.isRequired,setKeywords:h.a.func.isRequired};var He=We,$e=(n(91),function(e){var t=e.src,n=new Image;n.src=t;var r={backgroundImage:"url('".concat(n.src,"')")};return o.a.createElement("span",{className:"image-preview",style:r})});$e.propTypes={src:h.a.string};var Qe=$e,Ke=(n(92),function(e){var t=e.onFile,n=e.clearImage,r=e.img,a=e.ariaLabel,i=o.a.createRef(),l=function(){t({}),n&&n()};return o.a.createElement("div",{className:"image-upload-container",role:"button",tabIndex:"0",onKeyDown:function(e){"Enter"===e.key?i.current.click():-1!==["Delete","Backspace"].indexOf(e.key)&&l()},"aria-label":a},r&&r.src&&o.a.createElement(o.a.Fragment,null,o.a.createElement(Qe,{src:r.src}),o.a.createElement("span",{className:"icon-close",onClick:l})),o.a.createElement("div",{className:"image-upload ".concat(r&&r.src?"image-selected":"")},o.a.createElement("input",{tabIndex:"-1",ref:i,type:"file",onChange:function(e){if(0!==e.target.files.length){var n=e.target.files[0];t({src:URL.createObjectURL(n),file:n})}}})))});Ke.propTypes={onFile:h.a.func.isRequired,clearImage:h.a.func,img:h.a.object,ariaLabel:h.a.string.isRequired};var Ye=Ke;n(93);function Xe(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 Ge(e){for(var t=1;t