var themeManager=function(){"use strict";function o(o,t){function n(o,t){var n=isNaN(t)?o:o+t;return 0>n?n=0:n>255&&(n=255),n=Math.floor(n),n=n.toString(16),1===n.length?"0"+n:n}var e="";return o&&(e=n(o.red,t)+n(o.green,t)+n(o.blue,t)),e}function t(o,t,n){var e=document.getElementById(o);e&&(e=e.sheet,e.addRule?e.addRule(t,n):e.insertRule&&e.insertRule(t+" { "+n+" }",e.cssRules.length))}function n(n){var e=n.panelBackgroundColor.color,r=o(e),a=o(e,20),s="F0F0F0";e.red>122&&(s="000000");var l=o(e,-100),i="hostStyle";t(i,".hostElt","background-color:#"+r),t(i,".hostElt","font-size:"+n.baseFontSize+"px;"),t(i,".hostElt","font-family:"+n.baseFontFamily),t(i,".hostElt","color:#"+s),t(i,".hostBgd","background-color:#"+r),t(i,".hostBgdDark","background-color: #"+a),t(i,".hostBgdLight","background-color: #"+l),t(i,".hostFontSize","font-size:"+n.baseFontSize+"px;"),t(i,".hostFontFamily","font-family:"+n.baseFontFamily),t(i,".hostFontColor","color:#"+s),t(i,".hostFont","font-size:"+n.baseFontSize+"px;"),t(i,".hostFont","font-family:"+n.baseFontFamily),t(i,".hostFont","color:#"+s),t(i,".hostButton","background-color:#"+a),t(i,".hostButton:hover","background-color:#"+r),t(i,".hostButton:active","background-color:#"+a),t(i,".hostButton","border-color: #"+l)}function e(o){var t=JSON.parse(window.__adobe_cep__.getHostEnvironment()).appSkinInfo;n(t)}function r(){var o=new CSInterface;n(o.hostEnvironment.appSkinInfo),o.addEventListener(CSInterface.THEME_COLOR_CHANGED_EVENT,e)}return{init:r}}();