/*! For license information please see dll.Revealer.js.LICENSE.txt */
(window.webpackJsonp_name_dll=window.webpackJsonp_name_dll||[]).push([[123],{1024:function(e,t,a){"use strict";e.exports=function(e){return null===e}},1525:function(e,t,a){"use strict";a.r(t),t.default=function(e){e.stopPropagation()}},3020:function(e,t,a){"use strict";a.r(t);var n=a(965),r=a(3021);n.default.addResources("de","revealer",r.DE),n.default.addResources("en","revealer",r.EN),n.default.addResources("es","revealer",r.ES)},3021:function(e){e.exports=JSON.parse('{"DE":{"all-students":"Alle Studenten","contents-of":"Inhalt von ","from":"von","hide":"Ausblenden","message":"Vom Instruktor verborgener Inhalt","reveal":"Aufdecken","to":"zu"},"EN":{"all-students":"All students","contents-of":"contents of ","from":"from","hide":"Hide","message":"Content hidden by instructor","reveal":"Reveal","to":"to"},"ES":{"all-students":"Todos los estudiantes","contents-of":"contenido de ","from":"de","hide":"Esconder","message":"Contenido oculto por el instructor","reveal":"Revelar","to":"a"}}')},3022:function(e,t,a){"use strict";a.r(t);var n=a(22),r=a.n(n),l=a(3023),o={insert:"head",singleton:!1};r()(l.default,o);t.default=l.default.locals||{}},3023:function(e,t,a){"use strict";a.r(t);var n=a(23),r=a.n(n)()(!1);r.push([e.i,".revealer-panel {\n\tmargin-bottom: 10px;\n\twidth: fit-content;\n}\n\n.revealer-button {\n\tmargin-right: 10px;\n}\n\n.revealer-select {\n\twidth: 150px;\n\tbackground: #2e4468;\n\tmargin-left: 10px;\n\tpadding: 2px;\n\tcolor: white;\n}\n",""]),t.default=r},925:function(e,t,a){"use strict";a.r(t);var n=a(202),r=a.n(n),l=a(0),o=a.n(l),s=a(36),c=a.n(s),u=a(1),i=a.n(u),d=a(2309),f=a(77),v=a(997),m=a.n(v),E=a(145),p=a(146),h=a(63),g=a(1525),N=a(37),b=a(200),O=a(109),T=(a(3020),a(3022),c()("isle:revealer")),w=Object(h.default)("revealer"),C=function(e){var t=e.id,a=e.message,n=e.show,s=e.t,c=e.children;t=t||w({id:t,message:a,show:n});var u=Object(l.useContext)(N.default),i=Object(l.useState)(n),d=r()(i,2),v=d[0],h=d[1],C=Object(l.useState)(n),R=r()(C,2),_=R[0],y=R[1],I=Object(l.useState)(null),S=r()(I,2),x=S[0],k=S[1];n!==_&&(h(n),y(n)),Object(l.useEffect)((function(){var e,a=function(){if(u&&u.metadata&&u.metadata.revealer&&u.metadata.revealer[t]){var e=u.metadata.revealer[t][u.cohort||"all"];!0!==e&&!1!==e||h(e)}};return u&&(a(),e=u.subscribe((function(e,n){if(e===O.RETRIEVED_COHORTS)k(null);else if(e===O.RECEIVED_LESSON_INFO)a();else if(e===O.MEMBER_ACTION&&n.id===t){var r=n.value;T("Received action for cohort ".concat(r,": ")),!r||u.cohort&&u.cohort===r?n.type===b.REVEAL_CONTENT?(T("Reveal content for ".concat(t,"...")),h(!0)):n.type===b.HIDE_CONTENT&&(T("Hide content for ".concat(t,"...")),h(!1)):x===r&&(n.type===b.REVEAL_CONTENT?(T("Reveal content of ".concat(t," for cohort ").concat(r,"...")),h(!0)):n.type===b.HIDE_CONTENT&&(T("Hide content of ".concat(t," for cohort ").concat(r,"...")),h(!1)))}}))),function(){e&&e()}}),[t,x,u]);var A=function(e){var t=e.target.value;(t!==x||"all"===t&&m()(x))&&(T("Handle cohort change: "+t),k("all"===t?null:t))},H=u.cohorts||[],j=o.a.createElement("h3",{className:"center"},a||s("message"));return T("showChildren: "+v),o.a.createElement(l.Fragment,null,o.a.createElement(p.default,{owner:!0},o.a.createElement(E.default,{className:"center revealer-panel"},o.a.createElement(f.default,{className:"revealer-button",onClick:function(){var e,a=!v;h(a),e=u&&u.metadata&&u.metadata.revealer&&u.metadata.revealer[t]?u.metadata.revealer[t]:{},a?(u.log({id:t,type:b.REVEAL_CONTENT,value:x},"members"),e[x||"all"]=!0,u.updateMetadata("revealer",t,e)):(u.log({id:t,type:b.HIDE_CONTENT,value:x},"members"),e[x||"all"]=!1,u.updateMetadata("revealer",t,e))}},s(v?"hide":"reveal")),s("contents-of"),o.a.createElement("i",null,t)," ",s(v?"from":"to"),o.a.createElement("select",{className:"revealer-select",onChange:A,onBlur:A,onClick:g.default,value:x||"all"},o.a.createElement("option",{value:"all"},s("all-students")),H.map((function(e,t){return o.a.createElement("option",{key:t,value:e.title},e.title)}))))),v?null:j,o.a.createElement("div",{className:"revealer outer-element",style:{display:v?"inherit":"none"}},c))};C.defaultProps={message:null,show:!1},C.propTypes={message:i.a.oneOfType([i.a.string,i.a.node]),show:i.a.bool},t.default=Object(d.withTranslation)("revealer")(C)},997:function(e,t,a){"use strict";var n=a(1024);e.exports=n}}]);