text: /*!
   * style-select v1.2.6
   * (c) 2017 Jason Zheng
   * Released under the MIT License.
   */
  !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("vue/dist/vue.esm")):"function"==typeof define&&define.amd?define(["vue/dist/vue.esm"],t):"object"==typeof exports?exports.StyleSelect=t(require("vue/dist/vue.esm")):e.StyleSelect=t(e.Vue)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(s){if(r[s])return r[s].exports;var i=r[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,s){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:s})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,r){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=s(r(1)),n=s(r(2)),o=Object({NODE_ENV:"production",VERSION:"1.2.6",NAME:"style-select"});"production"!==o.NODE_ENV&&console.log("==== "+o.NAME+" "+o.NODE_ENV+" v"+o.VERSION+" ===="),t.default={createStyleGroup:function(e){function t(e,t,r){var s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(a(t)||a(r)||!Array.isArray(r))return!1;var n=function(e,t,r){for(var s,i={},n=0;s=e[n];n++)if(!s.disabled&&s.baseUrl===t)for(var o,a=0;o=s.names[a];a++)i[o]=!0;return r.filter(function(e){return!i.hasOwnProperty(e)})}(e,t=u(t),r);if(n.length<1)return!1;var o={baseUrl:t,names:n,supportMinCss:s};return i?e.push(o):e.unshift(o),!0}function r(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:6,t=arguments[1],r="",i=0;i<e;i++)r+="─";s(r,t)}function s(e,t){var r={names:[e],disabled:!0};t.push(r)}function o(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"*",r=arguments[2];if(a(e)||a(r)||!r)return!1;"*"!==t&&(t=u(t));if(e.length<1)return!1;for(var s,i=!1,n=0;s=e[n];n++)if(!(s.disabled||t!==s.baseUrl&&"*"!==t)){for(var o,l=0;o=s.names[l];l++)if(r===o){s.names.splice(l,1),i=!0,l--;var c=p.state.currentStyle,d=p.state.defaultStyle;d&&d.name===r&&(d=p.state.defaultStyle=null),c&&c.name===r&&p.setStyle(d||null)}s.names.length<1&&(e.splice(n,1),n--)}return i}function a(e){return void 0===e}function l(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5,t="",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",s=0;s<e;s++)t+=r.charAt(Math.floor(Math.random()*r.length));return t}function u(e){return""===e||"/"===e.slice(-1)?e:e+"/"}var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"--please choose--",d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"style-select",h=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],f=!1;e||(e=l(),f=!0);var p=new i.default({data:{cookie:{expires:7,path:"/"},state:{groupId:e,isTmpGroup:f,cssPrefix:d,hintText:c,supportNoneStyle:h,stylesList:[],currentStyle:null,defaultStyle:null,hasCookieRecord:!1}},computed:{currentStyleName:function(){return this.state.currentStyle?this.state.currentStyle.name:null},cookieName:function(){return this.state.cssPrefix+"-"+this.state.groupId},targetHref:function(){var e=this.state.currentStyle;return e?e.baseUrl+e.name+(e.supportMinCss?".min":"")+".css":null},linkId:function(){return l(5)+"-"+this.state.groupId}},methods:{setCookieOptions:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/";this.cookie.expires=e,this.cookie.path=t},setStyle:function(e){this.state.currentStyle=e,this.loadStyle(e),this.state.isTmpGroup||this.storeStyleState(this.cookieName,e)},storeStyleState:function(e,t){n.default.set(e,t,{expires:this.cookie.expires,path:this.cookie.path})},addStyles:function(e,r){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t(this.state.stylesList,e,r,s)},removeStyle:function(e,t){return o(this.state.stylesList,e,t)},setDefaultStyle:function(e,r){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!a(e)&&!a(r)){var i={baseUrl:u(e),name:r,supportMinCss:s};this.state.defaultStyle=i,this.state.hasCookieRecord||this.setStyle(i),t(this.state.stylesList,e,[r],s)}},removeCookie:function(){var e=this.cookieName;n.default.remove(e)},addSeparator:function(e){r(e,this.state.stylesList)},addText:function(e){s(e,this.state.stylesList)},createSelect:function(e){return(new y).$mount(e)},createHljsSelect:function(e){var t=new y;return t.addStyles("https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/",["agate","androidstudio","arduino-light","arta","ascetic","atelier-cave-dark","atelier-cave-light","atelier-dune-dark","atelier-dune-light","atelier-estuary-dark","atelier-estuary-light","atelier-forest-dark","atelier-forest-light","atelier-heath-dark","atelier-heath-light","atelier-lakeside-dark","atelier-lakeside-light","atelier-plateau-dark","atelier-plateau-light","atelier-savanna-dark","atelier-savanna-light","atelier-seaside-dark","atelier-seaside-light","atelier-sulphurpool-dark","atelier-sulphurpool-light","atom-one-dark","atom-one-light","brown-paper","codepen-embed","color-brewer","darcula","dark","darkula","default","docco","dracula","far","foundation","github-gist","github","googlecode","grayscale","gruvbox-dark","gruvbox-light","hopscotch","hybrid","idea","ir-black","kimbie.dark","kimbie.light","magula","mono-blue","monokai-sublime","monokai","obsidian","ocean","paraiso-dark","paraiso-light","pojoaque","purebasic","qtcreator_dark","qtcreator_light","railscasts","rainbow","routeros","school-book","solarized-dark","solarized-light","sunburst","tomorrow-night-blue","tomorrow-night-bright","tomorrow-night-eighties","tomorrow-night","tomorrow","vs","vs2015","xcode","xt256","zenburn"],!0),t.$mount(e),t},loadStyle:function(e){var t=this.link(this.linkId);t||((t=document.createElement("link")).rel="stylesheet",t.id=this.linkId,document.querySelector("head").appendChild(t)),e?(t.disabled=!1,t.href=this.targetHref):t.disabled=!0},link:function(e){return document.querySelector("#"+e)}},created:function(){if(!this.state.isTmpGroup){var e=this.cookieName,t=n.default.getJSON(e);a(t)||(this.state.hasCookieRecord=!0,this.setStyle(t))}}}),y=i.default.extend({data:function(){return{privateStylesList:[],compareFunction:null,sharedState:p.state}},computed:{stylesList:function(){for(var e=this.privateStylesList.slice(),r=this.sharedState.stylesList.length-1;r>-1;r--){var s=this.sharedState.stylesList[r];s.disabled?e.unshift(s):t(e,s.baseUrl,s.names,s.supportMinCss,!1)}if(this.compareFunction){return this.toOneDimensionStylesList(e).sort(this.compareFunction)}return e},selected:{get:function(){var e=this.sharedState.currentStyle;if(!e)return"";for(var t=0;t<this.stylesList.length;t++){var r=this.stylesList[t];if(r.baseUrl===e.baseUrl)for(var s=0;s<r.names.length;s++){if(r.names[s]===e.name)return t+"-"+s}}return null},set:function(e){if(e){var t=e.split("-");t.length<2||this.onSelected(t[0],t[1])}else""===e&&this.onNoSelected()}},className:function(){var e=this.sharedState.cssPrefix;return(e?e+"-":"")+this.sharedState.groupId}},template:'\n    <select\n            v-model="selected"\n            :name="className"\n            :class="[className, \'style-select\']"\n    >\n      <option value="" :disabled="!sharedState.supportNoneStyle">{{sharedState.hintText}}</option>\n      <template v-for="(styles, stylesIndex) in stylesList">\n        <option\n          v-for="(name, index) in styles.names"\n          :key="stylesIndex+\'-\'+index" \n          :value="stylesIndex+\'-\'+index"\n          :disabled="styles.disabled">\n              {{name}}\n        </option>\n      </template>\n    </select>'});return y.prototype.onSelected=function(e,t){var r=this.stylesList[e],s={baseUrl:r.baseUrl,name:r.names[t],supportMinCss:r.supportMinCss};p.setStyle(s)},y.prototype.onNoSelected=function(){p.setStyle(null)},y.prototype.addStyles=function(e,r){var s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t(this.privateStylesList,e,r,s)},y.prototype.addSeparator=function(e){r(e,this.privateStylesList)},y.prototype.addText=function(e){s(e,this.privateStylesList)},y.prototype.removeStyle=function(e,t){return o(this.privateStylesList,e,t)},y.prototype.toOneDimensionStylesList=function(e){for(var t,r=[],s=0;t=e[s];s++)if(t.disabled)r.push(t);else for(var i,n=0;i=t.names[n];n++){var o={baseUrl:t.baseUrl,names:[i],supportMinCss:t.supportMinCss};r.push(o)}return r},y.prototype.moveIndex=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.selected;if(null!==t){var r=void 0,s=t?t.split("-"):e?[0,-1]:[this.stylesList.length,0],i=s[0],n=s[1],o=this.stylesList[i];if(e?n++:n--,n<0||n>=o.names.length||this.stylesList[i].disabled)do{e?i++:i--,(o=this.stylesList[i])&&!o.disabled&&o.names&&(n=e?0:o.names.length-1)}while(i>-1&&i<this.stylesList.length&&this.stylesList[i].disabled);r=i>-1&&i<this.stylesList.length?Number(i)+"-"+Number(n):"",this.selected=r}},p}}},function(t,r){t.exports=e},function(e,t,r){var s,i;!function(n){if(void 0===(i="function"==typeof(s=n)?s.call(t,r,t,e):s)||(e.exports=i),!0,e.exports=n(),!!0){var o=window.Cookies,a=window.Cookies=n();a.noConflict=function(){return window.Cookies=o,a}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var r=arguments[e];for(var s in r)t[s]=r[s]}return t}function t(r){function s(t,i,n){var o;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(n=e({path:"/"},s.defaults,n)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*n.expires),n.expires=a}n.expires=n.expires?n.expires.toUTCString():"";try{o=JSON.stringify(i),/^[\{\[]/.test(o)&&(i=o)}catch(e){}i=r.write?r.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var l="";for(var u in n)n[u]&&(l+="; "+u,!0!==n[u]&&(l+="="+n[u]));return document.cookie=t+"="+i+l}t||(o={});for(var c=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,h=0;h<c.length;h++){var f=c[h].split("="),p=f.slice(1).join("=");this.json||'"'!==p.charAt(0)||(p=p.slice(1,-1));try{var y=f[0].replace(d,decodeURIComponent);if(p=r.read?r.read(p,y):r(p,y)||p.replace(d,decodeURIComponent),this.json)try{p=JSON.parse(p)}catch(e){}if(t===y){o=p;break}t||(o[y]=p)}catch(e){}}return o}}return s.set=s,s.get=function(e){return s.call(s,e)},s.getJSON=function(){return s.apply({json:!0},[].slice.call(arguments))},s.defaults={},s.remove=function(t,r){s(t,"",e(r,{expires:-1}))},s.withConverter=t,s}return t(function(){})})}]).default});