text: !function t(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("maka")):"function"==typeof define&&define.amd?define(["maka"],n):"object"==typeof exports?exports["maka-app-option"]=n(require("maka")):e["maka-app-option"]=n(e.maka)}("undefined"!=typeof window&&window||"undefined"!=typeof global&&global,function(n){return i={},o.m=r=[function(t,e,n){t.exports=n(7)},function(t,e){function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.exports=n},function(t,e){function s(t,e,n,r,o,i,a){try{var c=t[i](a),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function n(c){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=c.apply(t,a);function o(t){s(r,e,n,o,i,"next",t)}function i(t){s(r,e,n,o,i,"throw",t)}o(void 0)})}}t.exports=n},function(t,e){t.exports=n},function(t){t.exports={isMakaApp:!0,name:"option",description:"option",version:"1.0.0",license:"MIT",author:"",repository:{type:"git",url:"https://github.com/makajs/option.git"},bugs:{url:"https://github.com/makajs/option/issues"},homepage:"https://github.com/makajs/option#readme",scripts:{start:"maka start",dev:"maka start --dev",build:"maka build",pkg:"maka pkg"},dependencies:{},server:{proxy:null,port:8e3},subAppDir:["./apps","../../../"],devDependencies:{antd:"^3.12.1"}}},function(t,e){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}t.exports=n},function(t,e,n){t.exports=n(13)},function(t,e,n){var r=function(i){"use strict";var t=Object.prototype,l=t.hasOwnProperty,s,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function a(t,e,n,r){var o=e&&e.prototype instanceof c?e:c,i=Object.create(o.prototype),a=new j(r||[]);return i._invoke=S(t,n,a),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}i.wrap=a;var u="suspendedStart",d="suspendedYield",h="executing",m="completed",f={};function c(){}function g(){}function y(){}var v={};v[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==t&&l.call(w,o)&&(v=w);var k=y.prototype=c.prototype=Object.create(v);function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function $(c){function s(t,e,n,r){var o=p(c[t],c,e);if("throw"!==o.type){var i=o.arg,a=i.value;return a&&"object"==typeof a&&l.call(a,"__await")?Promise.resolve(a.__await).then(function(t){s("next",t,n,r)},function(t){s("throw",t,n,r)}):Promise.resolve(a).then(function(t){i.value=t,n(i)},function(t){return s("throw",t,n,r)})}r(o.arg)}var e;function t(n,r){function t(){return new Promise(function(t,e){s(n,r,t,e)})}return e=e?e.then(t,t):t()}this._invoke=t}function S(a,c,s){var l=u;return function t(e,n){if(l===h)throw new Error("Generator is already running");if(l===m){if("throw"===e)throw n;return _()}for(s.method=e,s.arg=n;;){var r=s.delegate;if(r){var o=O(r,s);if(o){if(o===f)continue;return o}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(l===u)throw l=m,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);l=h;var i=p(a,c,s);if("normal"===i.type){if(l=s.done?m:d,i.arg===f)continue;return{value:i.arg,done:s.done}}"throw"===i.type&&(l=m,s.method="throw",s.arg=i.arg)}}}function O(t,e){var n=t.iterator[e.method];if(n===s){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=s,O(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=p(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,f;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=s),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function N(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=s,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:s,done:!0}}return g.prototype=k.constructor=y,y.constructor=g,y[r]=g.displayName="GeneratorFunction",i.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},i.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(k),t},i.awrap=function(t){return{__await:t}},x($.prototype),$.prototype[n]=function(){return this},i.AsyncIterator=$,i.async=function(t,e,n,r){var o=new $(a(t,e,n,r));return i.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},x(k),k[r]="Generator",k[o]=function(){return this},k.toString=function(){return"[object Generator]"},i.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},i.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=s)},stop:function(){this.done=!0;var t,e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=s),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),c=l.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:N(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=s),f}},i}(t.exports);try{regeneratorRuntime=r}catch(t){Function("r","regeneratorRuntime = r")(r)}},function(t,e,n){},function(t,e,n){t.exports=n.p+"theme-style-dark.svg"},function(t,e,n){t.exports=n.p+"theme-style-light.svg"},function(t,e,n){t.exports=n.p+"nav-sidermenu.svg"},function(t,e,n){t.exports=n.p+"nav-topmenu.svg"},function(t,e,n){"use strict";n.r(e);var r=n(0),c=n.n(r),o=n(2),s=n.n(o),i=n(4),l=n(3),a,p,u,d,h={component:"antd.Drawer",visible:"{{data.drawerOpen}}",onClose:"{{$toggleContent}}",onHandleClick:"{{$toggleContent}}",width:300,placement:"right",title:"{{$i18n('app.settings.security.set')}}",style:{zIndex:999},handler:{component:"div",className:"{{$styles('handle')}}",children:[{component:"antd.Icon",type:"{{data.drawerOpen ? 'close': 'setting'}}",style:{color:"#fff",fontSize:20}}]},children:[{component:"div",className:"{{$styles('content')}}",children:[{component:"div",style:{marginBottom:24},children:[{component:"h3",className:"{{$styles('title')}}",children:"{{$i18n('app.setting.pagestyle')}}"},{component:"div",className:"{{$styles('blockChecbox')}}",children:[{_for:"item in data.themes",component:"antd.Tooltip",title:"{{$i18n(item.locale)}}",children:[{component:"div",className:"{{$styles('item')}}",onClick:"{{$styleChange(item.key)}}",children:[{component:"img",src:"{{item.img}}"},{component:"div",className:"{{$styles('selectIcon')}}",style:"{{{\n                            return {display: data.setting.theme === item.key ? 'block' : 'none'}\n                        }}}",children:{component:"antd.Icon",type:"check"}}]}]}]}]},{component:"div",className:"{{$styles('themeColor')}}",children:[{component:"h3",className:"{{$styles('title')}}",children:"{{$i18n('app.setting.themecolor')}}",value:"{{data.setting.activePrimaryColor}}"},{component:"div",className:"{{$styles('content')}}",children:{_for:"item in data.primaryColors",component:"antd.Tooltip",title:"{{$i18n('app.setting.themecolor.' + item.key)}}",children:{component:"div",className:"{{$styles('colorBlock')}}",style:"{{{return {backgroundColor:item.color}}}}",onClick:"{{$primaryColorChange(item)}}",children:{component:"antd.Icon",type:"check",_visible:"{{data.setting.activePrimaryColor === item.key}}"}}}}]},{component:"antd.Divider"},{component:"div",style:{marginBottom:24},children:[{component:"h3",className:"{{$styles('title')}}",children:"{{$i18n('app.setting.navigationmode')}}"},{component:"div",className:"{{$styles('blockChecbox')}}",children:[{_for:"item in data.navModes",component:"antd.Tooltip",title:"{{$i18n(item.locale)}}",children:[{component:"div",className:"{{$styles('item')}}",onClick:"{{ ()=>$changeSetting('layout', item.key)}}",children:[{component:"img",src:"{{item.img}}"},{component:"div",className:"{{$styles('selectIcon')}}",style:"{{{\n                            return {display: data.setting.layout === item.key ? 'block' : 'none'}\n                        }}}",children:{component:"antd.Icon",type:"check"}}]}]}]}]},{component:"antd.List",split:!1,dataSource:[{title:"{{$i18n('app.setting.content-width')}}",action:[{component:"antd.Select",value:"{{data.setting.contentWidth}}",size:"small",onSelect:"{{value=>$changeSetting('contentWidth', value)}}",style:{width:80},children:[{component:"antd.Select.Option",value:"Fixed",children:"{{$i18n('app.setting.content-width.fixed')}}",_visible:"{{data.setting.layout === 'topmenu'}}"},{component:"antd.Select.Option",value:"Fluid",children:"{{$i18n('app.setting.content-width.fluid')}}"}]}]},{title:"{{$i18n('app.setting.fixedheader')}}",action:[{component:"antd.Switch",size:"small",checked:"{{!!data.setting.fixedHeader}}",onChange:"{{(checked)=>$changeSetting('fixedHeader', checked)}}"}]},{title:"{{$i18n('app.setting.fixedsidebar')}}",action:[{component:"antd.Switch",size:"small",checked:"{{!!data.setting.fixedSiderbar}}",onChange:"{{(checked)=>$changeSetting('fixedSiderbar', checked)}}"}]},{title:"{{$i18n('app.setting.horizontalMenu')}}",action:[{component:"antd.Switch",size:"small",checked:"{{!!data.setting.horizontalMenu}}",onChange:"{{(checked)=>$changeSetting('horizontalMenu', checked)}}"}]},{title:"{{$i18n('app.setting.tabStyle')}}",action:[{component:"antd.Switch",size:"small",checked:"{{!!data.setting.tabStyle}}",onChange:"{{(checked)=>$changeSetting('tabStyle', checked)}}"}]}],renderItem:{_function:"(item)",component:"antd.List.Item",actions:"{{item.action}}",children:{component:"span",children:"{{item.title}}"}}},{component:"antd.Divider"},{component:"div",style:{marginBottom:24},children:[{component:"h3",className:"{{$styles('title')}}",children:"{{$i18n('app.setting.othersettings')}}"},{component:"antd.List.Item",actions:[{component:"antd.Switch",siz:"small",checked:"{{!!data.setting.colorWeak}}",onChange:"{{checked => $changeSetting('colorWeak', checked)}}"}],children:"{{$i18n('app.setting.weakmode')}}"}]}]}]},m={data:{drawerOpen:!1,themes:[{key:"dark",img:"theme-style-dark.svg",locale:"app.setting.pagestyle.dark"},{key:"light",img:"theme-style-light.svg",locale:"app.setting.pagestyle.light"}],primaryColors:[{key:"geekblue",color:"rgb(24, 144, 255)",appName:"theme-primary-color-blue"},{key:"green",color:"rgb(19, 194, 194)",appName:"theme-primary-color-green"},{key:"dust",color:"rgb(245, 34, 45)",appName:"theme-primary-color-red"}],navModes:[{key:"sidermenu",img:"nav-sidermenu.svg",locale:"app.setting.sidemenu"},{key:"topmenu",img:"nav-topmenu.svg",locale:"app.setting.topmenu"}],setting:{}}},f=n(5),g=n.n(f),y=n(1),v=n.n(y),b,w,k,x=(b=Object(l.actionMixin)("base","webapi","message","i18n"))(w=k=function t(e){var a=this;g()(this,t),v()(this,"styles",function(t){return"option-".concat(t)}),v()(this,"onInit",function(){}),v()(this,"toggleContent",s()(c.a.mark(function t(){var n,r;return c.a.wrap(function t(e){for(;;)switch(e.prev=e.next){case 0:if(n=a.base.gs("data.drawerOpen")){e.next=8;break}return e.next=4,a.webapi.option.query({});case 4:r=e.sent,a.base.ss({"data.setting":r,"data.drawerOpen":!0}),e.next=9;break;case 8:a.base.ss({"data.drawerOpen":!1});case 9:case"end":return e.stop()}},t)}))),v()(this,"styleChange",function(r){return s()(c.a.mark(function t(){var n;return c.a.wrap(function t(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.webapi.option.update({theme:r});case 2:n=e.sent,a.base.setState("data.setting",n),a.component.props.onPortalReload&&a.component.props.onPortalReload();case 5:case"end":return e.stop()}},t)}))}),v()(this,"primaryColorChange",function(i){return s()(c.a.mark(function t(){var n,r,o;return c.a.wrap(function t(e){for(;;)switch(e.prev=e.next){case 0:return n=a.base.getState(),r=n.primaryColors.find(function(t){return t.key==n.setting.activePrimaryColor}),Object(l.removeApp)(r.appName),e.next=5,a.webapi.option.update({activePrimaryColor:i.key});case 5:return o=e.sent,e.next=8,Object(l.load)(i.appName);case 8:a.base.setState("data.setting",o);case 9:case"end":return e.stop()}},t)}))}),v()(this,"changeSetting",function(){var n=s()(c.a.mark(function t(n,r){var o,i;return c.a.wrap(function t(e){for(;;)switch(e.prev=e.next){case 0:return"colorWeak"==n&&(document.body.className=r?"colorWeak":""),o=v()({},n,r),"layout"==n&&(o.contentWidth="sidermenu"==r?"Fluid":"Fixed"),e.next=5,a.webapi.option.update(o);case 5:i=e.sent,a.base.setState("data.setting",i),a.component.props.onPortalReload&&a.component.props.onPortalReload();case 8:case"end":return e.stop()}},t)}));return function(t,e){return n.apply(this,arguments)}}()),Object.assign(this,e.mixins)})||w,$=n(8),S=n(9),O=n(10),C=n(11),L=n(12);n.d(e,"name",function(){return j}),n.d(e,"beforeRegister",function(){return N}),n.d(e,"state",function(){return m}),n.d(e,"action",function(){return x}),n.d(e,"view",function(){return h});var j=i.name;function N(){return _.apply(this,arguments)}function _(){return(_=s()(c.a.mark(function t(){return c.a.wrap(function t(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(l.load)(["i18n","custom-component","template","webapi"]);case 2:case"end":return e.stop()}},t)}))).apply(this,arguments)}}],o.c=i,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function t(){return e.default}:function t(){return e};return o.d(t,"a",t),t},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p=window['__pub_option__'],o(o.s=6);function o(t){if(i[t])return i[t].exports;var e=i[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}var r,i});