text: !function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);throw new Error("Cannot find module '"+a+"'")}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e){(function(){"use strict";function t(e,t){var n=I[e]||r(e).html(),o=Handlebars.compile(n);return!I[e]&&(I[e]=n),o(t)}function n(){var e=function(){var e,t=r(this).val(),n=r(this).attr("name");t="true"===t?!0:"false"===t?!1:t,"number"===this.type&&(t=parseInt(t));try{e=r.parseJSON(C.getValue())}catch(o){console.error("Demo data syntax error!")}if(e){var i=e.options||{};if(i[n]=t,e.options=i,"slider"===u.val()){var s=r.extend({},JSON.parse(e.sliderConfig),i);e.sliderConfig=JSON.stringify(s)}C.setValue(a.jsonFormat(JSON.stringify(e))),C.refresh()}w.trigger("click")};r(document).on("change",".bar-options select",e).on("blur",".bar-options input",e),r.fn.popover&&r(document).on("focus",".bar-options input",function(){var e=r(this).attr("placeholder")||"";r.trim(e)&&r(this).popover({content:e})}).on("blur",".bar-options input",function(){r(this).popover("close")})}var r=window.jQuery||window.Zepto,o=e("store");e("farbtastic");var i=e("editor"),a=e("tools"),s="/api/ui/file/",u=r("#widgets-select"),l=r("#widget-demo-select"),f=r("#demo-viewport"),c=r(".ios-address input"),d=r("#widget-info"),h=r("body"),g=r("#form-getdemo"),m=r("#tpl-color-sets"),p=r('[name="themeVariables"]'),v=r("#demo-selected-theme"),b="_amui_debugger_",w=r("#demo-run");i.initEditor();var y=i.getEditor(),E=y.html,k=y.css,S=y.theme,C=y.data,A=function(){w.on("click",function(){i.synchronizeData(),g.submit()}),r("#demo-run-newwin").click(function(){var e=g.attr("target");i.synchronizeData(),g.attr("target","_blank").submit().attr("target",e)})},M=window.components&&window.components.widgets||{},I={},_=function(){u.change(function(){var e=r(this).val(),n=M[e],i=s+e;r(".bar-options").remove(),d.after(t("#tpl-options",{options:n.options})),d.html(t("#tpl-widget-info",n)),r("#demo-selected-widget").val(e),E.setValue(n.tpl),E.refresh(),r.ajax({type:"GET",url:i+"/theme",dataType:"text",success:function(e){k.setValue(e),k.refresh()},error:function(){console.log("Loading core style error!")}}),r.each(n.themes,function(t,i){r.each(i.demos,function(t,r){var a=r.desc||i.desc,s=b+e+"_"+i.name+"_"+t;!r.data.content&&n.demoContent&&(r.data.content=n.demoContent),r.data.theme=i.name;var u={data:r.data,url:"/widgets/"+e+"/"+i.name+"/"+t,theme:i.name,hook:i.hook,desc:a,variables:i.variables,options:i.options};o.set(s,u)})}),l.html(t("#tpl-demo-list",{themes:n.themes})),l.trigger("change")}),l.change(function(){h.removeClass("app-init");var e=u.val(),t=o.get(b+e+r(this).val()),n=t.data,l=t.theme||"default";v.val(l),C.setValue(a.jsonFormat(JSON.stringify(n))),C.refresh();var d=r.extend({},t.options,n.options);for(var m in d){var p=r('[name="'+m+'"]'),w=d[m];w=w===!0?"true":w,w=w===!1?"false":w,p.val(w)}r.ajax({type:"GET",url:s+e+"/theme?id="+l,dataType:"text",success:function(e){S.setValue(e),S.refresh()},error:function(){console.log("Load theme error!")}});var y=t.variables;x(t.hook,y),r('[name="demoTpl"]').val(E.getValue()),r('[name="demoData"]').val(JSON.stringify(n)),0===r("#demo-area").width()&&g.attr("target","_blank"),i.synchronizeData(),c.val("http://"+window.location.host+t.url),r(f).attr("src",t.url)})},x=function(e,t){r("#demo-color-sets").remove(),p.val(""),p.val(JSON.stringify(t));var n=Handlebars.compile(m.html());h.append(n({hook:e,variables:t}))},B=function(){var e=r("#ios-clock"),t=new Date,n=t.getMinutes().toString();n=1==n.length?"0"+n:n,e.text(t.getHours()+":"+n)},L=function(){r(".editor-full-trigger").on("click",function(e){e.preventDefault();var t=r(this).attr("data-editor"),n=y[t],o=r(this).parent(".editor-item");n.setOption("fullScreen",!n.getOption("fullScreen")),r(".editor-item").not(o).removeClass("full-active"),o.toggleClass("full-active")})},T=function(){_(),A(),u.trigger("change"),setInterval(function(){B()},6e4),L(),n()};r(function(){if(o.disabled&&!o.enabled)return void alert('Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.');T();var e=r("#color-picker"),t=r("#color-picker-wrap"),n=(r("#demo-color-sets"),r.farbtastic(e,r("body")[0]));r(document).on("focus",'input[name*="colorSets"]',function(){n.linkTo(this);var e=r(this).offset();t.show().css({top:e.top-200,left:e.left+r(this).width()-200})}),t.find(".am-icon-times-circle").on("click",function(){t.hide()}),r(document).on("click",function(e){var n=e.target;r(n).parents("#demo-color-sets").length>0||r(n).parents("#color-picker-wrap").length>0||r(n).is("#demo-color-sets")||r(n).is("#color-picker-wrap")||t.hide()});var i=r("#notification");r("#color-sets-trigger").on("click",function(){var e=r("#demo-color-sets");r("body").removeClass("doc-active"),e.length?e.toggleClass("am-active"):i.is(".am-active")||(i.addClass("am-active msg-error").empty().text("当前主题没有颜色设置"),setTimeout(function(){i.removeClass()},3e3))}),r("#demo-qrcode-wrap").on("click",function(){r("#demo-wrap").toggleClass("qr-active")});var a=r("#demo-qrcode-trigger"),s=r("#demo-qrcode"),u=window.$&&window.$.AMUI.qrcode||window.jQuery.AMUI.qrcode;u&&a.on("click",function(e){if(e.preventDefault(),u){var t=new u({text:r(".ios-address input").val(),width:200,height:200});s.empty().append(t),r("#demo-wrap").toggleClass("qr-active")}})})}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_ba280f5c.js","/")},{buffer:2,editor:7,farbtastic:8,oMfpAn:5,store:6,tools:9}],2:[function(e,t,n){(function(t,r,o){function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r=typeof e;if("base64"===t&&"string"===r)for(e=x(e);e.length%4!==0;)e+="=";var i;if("number"===r)i=L(e);else if("string"===r)i=o.byteLength(e,t);else{if("object"!==r)throw new Error("First argument needs to be a number, array or string.");i=L(e.length)}var a;o._useTypedArrays?a=o._augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(o._useTypedArrays&&"number"==typeof e.byteLength)a._set(e);else if(O(e))for(s=0;i>s;s++)a[s]=o.isBuffer(e)?e.readUInt8(s):e[s];else if("string"===r)a.write(e,0,t);else if("number"===r&&!o._useTypedArrays&&!n)for(s=0;i>s;s++)a[s]=0;return a}function i(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var a=t.length;P(a%2===0,"Invalid hex string"),r>a/2&&(r=a/2);for(var s=0;r>s;s++){var u=parseInt(t.substr(2*s,2),16);P(!isNaN(u),"Invalid hex string"),e[n+s]=u}return o._charsWritten=2*s,s}function a(e,t,n,r){var i=o._charsWritten=q(D(t),e,n,r);return i}function s(e,t,n,r){var i=o._charsWritten=q(j(t),e,n,r);return i}function u(e,t,n,r){return s(e,t,n,r)}function l(e,t,n,r){var i=o._charsWritten=q(F(t),e,n,r);return i}function f(e,t,n,r){var i=o._charsWritten=q(N(t),e,n,r);return i}function c(e,t,n){return R.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function d(e,t,n){var r="",o="";n=Math.min(e.length,n);for(var i=t;n>i;i++)e[i]<=127?(r+=V(o)+String.fromCharCode(e[i]),o=""):o+="%"+e[i].toString(16);return r+V(o)}function h(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)r+=String.fromCharCode(e[o]);return r}function g(e,t,n){return h(e,t,n)}function m(e,t,n){var r=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=t;n>i;i++)o+=U(e[i]);return o}function p(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function v(e,t,n,r){r||(P("boolean"==typeof n,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+1<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(i=e[t],o>t+1&&(i|=e[t+1]<<8)):(i=e[t]<<8,o>t+1&&(i|=e[t+1])),i}}function b(e,t,n,r){r||(P("boolean"==typeof n,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+3<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i;return n?(o>t+2&&(i=e[t+2]<<16),o>t+1&&(i|=e[t+1]<<8),i|=e[t],o>t+3&&(i+=e[t+3]<<24>>>0)):(o>t+1&&(i=e[t+1]<<16),o>t+2&&(i|=e[t+2]<<8),o>t+3&&(i|=e[t+3]),i+=e[t]<<24>>>0),i}}function w(e,t,n,r){r||(P("boolean"==typeof n,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+1<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=v(e,t,n,!0),a=32768&i;return a?-1*(65535-i+1):i}}function y(e,t,n,r){r||(P("boolean"==typeof n,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+3<e.length,"Trying to read beyond buffer length"));var o=e.length;if(!(t>=o)){var i=b(e,t,n,!0),a=2147483648&i;return a?-1*(4294967295-i+1):i}}function E(e,t,n,r){return r||(P("boolean"==typeof n,"missing or invalid endian"),P(t+3<e.length,"Trying to read beyond buffer length")),J.read(e,t,n,23,4)}function k(e,t,n,r){return r||(P("boolean"==typeof n,"missing or invalid endian"),P(t+7<e.length,"Trying to read beyond buffer length")),J.read(e,t,n,52,8)}function S(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+1<e.length,"trying to write beyond buffer length"),z(t,65535));var i=e.length;if(!(n>=i))for(var a=0,s=Math.min(i-n,2);s>a;a++)e[n+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a)}function C(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+3<e.length,"trying to write beyond buffer length"),z(t,4294967295));var i=e.length;if(!(n>=i))for(var a=0,s=Math.min(i-n,4);s>a;a++)e[n+a]=t>>>8*(r?a:3-a)&255}function A(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+1<e.length,"Trying to write beyond buffer length"),W(t,32767,-32768));var i=e.length;n>=i||(t>=0?S(e,t,n,r,o):S(e,65535+t+1,n,r,o))}function M(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+3<e.length,"Trying to write beyond buffer length"),W(t,2147483647,-2147483648));var i=e.length;n>=i||(t>=0?C(e,t,n,r,o):C(e,4294967295+t+1,n,r,o))}function I(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+3<e.length,"Trying to write beyond buffer length"),G(t,3.4028234663852886e38,-3.4028234663852886e38));var i=e.length;n>=i||J.write(e,t,n,r,23,4)}function _(e,t,n,r,o){o||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+7<e.length,"Trying to write beyond buffer length"),G(t,1.7976931348623157e308,-1.7976931348623157e308));var i=e.length;n>=i||J.write(e,t,n,r,52,8)}function x(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function B(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function L(e){return e=~~Math.ceil(+e),0>e?0:e}function T(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function O(e){return T(e)||o.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function U(e){return 16>e?"0"+e.toString(16):e.toString(16)}function D(e){for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(127>=r)t.push(e.charCodeAt(n));else{var o=n;r>=55296&&57343>=r&&n++;for(var i=encodeURIComponent(e.slice(o,n+1)).substr(1).split("%"),a=0;a<i.length;a++)t.push(parseInt(i[a],16))}}return t}function j(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t}function N(e){for(var t,n,r,o=[],i=0;i<e.length;i++)t=e.charCodeAt(i),n=t>>8,r=t%256,o.push(r),o.push(n);return o}function F(e){return R.toByteArray(e)}function q(e,t,n,r){for(var o=0;r>o&&!(o+n>=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function V(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function z(e,t){P("number"==typeof e,"cannot write a non-number as a number"),P(e>=0,"specified a negative value for writing an unsigned value"),P(t>=e,"value is larger than maximum value for type"),P(Math.floor(e)===e,"value has a fractional component")}function W(e,t,n){P("number"==typeof e,"cannot write a non-number as a number"),P(t>=e,"value larger than maximum allowed value"),P(e>=n,"value smaller than minimum allowed value"),P(Math.floor(e)===e,"value has a fractional component")}function G(e,t,n){P("number"==typeof e,"cannot write a non-number as a number"),P(t>=e,"value larger than maximum allowed value"),P(e>=n,"value smaller than minimum allowed value")}function P(e,t){if(!e)throw new Error(t||"Failed assertion")}var R=e("base64-js"),J=e("ieee754");n.Buffer=o,n.SlowBuffer=o,n.INSPECT_MAX_BYTES=50,o.poolSize=8192,o._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(n){return!1}}(),o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},o.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=D(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=F(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},o.concat=function(e,t){if(P(T(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new o(0);if(1===e.length)return e[0];var n;if("number"!=typeof t)for(t=0,n=0;n<e.length;n++)t+=e[n].length;var r=new o(t),i=0;for(n=0;n<e.length;n++){var a=e[n];a.copy(r,i),i+=a.length}return r},o.prototype.write=function(e,t,n,r){if(isFinite(t))isFinite(n)||(r=n,n=void 0);else{var o=r;r=t,t=n,n=o}t=Number(t)||0;var c=this.length-t;n?(n=Number(n),n>c&&(n=c)):n=c,r=String(r||"utf8").toLowerCase();var d;switch(r){case"hex":d=i(this,e,t,n);break;case"utf8":case"utf-8":d=a(this,e,t,n);break;case"ascii":d=s(this,e,t,n);break;case"binary":d=u(this,e,t,n);break;case"base64":d=l(this,e,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":d=f(this,e,t,n);break;default:throw new Error("Unknown encoding")}return d},o.prototype.toString=function(e,t,n){var r=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,n=void 0!==n?Number(n):n=r.length,n===t)return"";var o;switch(e){case"hex":o=m(r,t,n);break;case"utf8":case"utf-8":o=d(r,t,n);break;case"ascii":o=h(r,t,n);break;case"binary":o=g(r,t,n);break;case"base64":o=c(r,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":o=p(r,t,n);break;default:throw new Error("Unknown encoding")}return o},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.copy=function(e,t,n,r){var i=this;if(n||(n=0),r||0===r||(r=this.length),t||(t=0),r!==n&&0!==e.length&&0!==i.length){P(r>=n,"sourceEnd < sourceStart"),P(t>=0&&t<e.length,"targetStart out of bounds"),P(n>=0&&n<i.length,"sourceStart out of bounds"),P(r>=0&&r<=i.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var a=r-n;if(100>a||!o._useTypedArrays)for(var s=0;a>s;s++)e[s+t]=this[s+n];else e._set(this.subarray(n,n+a),t)}},o.prototype.slice=function(e,t){var n=this.length;if(e=B(e,n,0),t=B(t,n,n),o._useTypedArrays)return o._augment(this.subarray(e,t));for(var r=t-e,i=new o(r,void 0,!0),a=0;r>a;a++)i[a]=this[a+e];return i},o.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},o.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},o.prototype.readUInt8=function(e,t){return t||(P(void 0!==e&&null!==e,"missing offset"),P(e<this.length,"Trying to read beyond buffer length")),e>=this.length?void 0:this[e]},o.prototype.readUInt16LE=function(e,t){return v(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return v(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return b(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return b(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(P(void 0!==e&&null!==e,"missing offset"),P(e<this.length,"Trying to read beyond buffer length")),!(e>=this.length)){var n=128&this[e];return n?-1*(255-this[e]+1):this[e]}},o.prototype.readInt16LE=function(e,t){return w(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return w(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return E(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return E(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return k(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return k(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,n){n||(P(void 0!==e&&null!==e,"missing value"),P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"trying to write beyond buffer length"),z(e,255)),t>=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,n){S(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){S(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){C(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){C(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||(P(void 0!==e&&null!==e,"missing value"),P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"Trying to write beyond buffer length"),W(e,127,-128)),t>=this.length||(e>=0?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){A(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){A(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){M(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){M(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){_(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){_(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),P("number"==typeof e&&!isNaN(e),"value is not a number"),P(n>=t,"end < start"),n!==t&&0!==this.length){P(t>=0&&t<this.length,"start out of bounds"),P(n>=0&&n<=this.length,"end out of bounds");for(var r=t;n>r;r++)this[r]=e}},o.prototype.inspect=function(){for(var e=[],t=this.length,r=0;t>r;r++)if(e[r]=U(this[r]),r===n.INSPECT_MAX_BYTES){e[r+1]="...";break}return"<Buffer "+e.join(" ")+">"},o.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var H=o.prototype;o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=H.get,e.set=H.set,e.write=H.write,e.toString=H.toString,e.toLocaleString=H.toString,e.toJSON=H.toJSON,e.copy=H.copy,e.slice=H.slice,e.readUInt8=H.readUInt8,e.readUInt16LE=H.readUInt16LE,e.readUInt16BE=H.readUInt16BE,e.readUInt32LE=H.readUInt32LE,e.readUInt32BE=H.readUInt32BE,e.readInt8=H.readInt8,e.readInt16LE=H.readInt16LE,e.readInt16BE=H.readInt16BE,e.readInt32LE=H.readInt32LE,e.readInt32BE=H.readInt32BE,e.readFloatLE=H.readFloatLE,e.readFloatBE=H.readFloatBE,e.readDoubleLE=H.readDoubleLE,e.readDoubleBE=H.readDoubleBE,e.writeUInt8=H.writeUInt8,e.writeUInt16LE=H.writeUInt16LE,e.writeUInt16BE=H.writeUInt16BE,e.writeUInt32LE=H.writeUInt32LE,e.writeUInt32BE=H.writeUInt32BE,e.writeInt8=H.writeInt8,e.writeInt16LE=H.writeInt16LE,e.writeInt16BE=H.writeInt16BE,e.writeInt32LE=H.writeInt32LE,e.writeInt32BE=H.writeInt32BE,e.writeFloatLE=H.writeFloatLE,e.writeFloatBE=H.writeFloatBE,e.writeDoubleLE=H.writeDoubleLE,e.writeDoubleBE=H.writeDoubleBE,e.fill=H.fill,e.inspect=H.inspect,e.toArrayBuffer=H.toArrayBuffer,e}}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer/index.js","/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer")},{"base64-js":3,buffer:2,ieee754:4,oMfpAn:5}],3:[function(e,t,n){(function(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function n(e){var t=e.charCodeAt(0);return t===a?62:t===s?63:u>t?-1:u+10>t?t-u+26+26:f+26>t?t-f:l+26>t?t-l+26:void 0}function r(e){function t(e){l[c++]=e}var r,o,a,s,u,l;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=e.length;u="="===e.charAt(f-2)?2:"="===e.charAt(f-1)?1:0,l=new i(3*e.length/4-u),a=u>0?e.length-4:e.length;var c=0;for(r=0,o=0;a>r;r+=4,o+=3)s=n(e.charAt(r))<<18|n(e.charAt(r+1))<<12|n(e.charAt(r+2))<<6|n(e.charAt(r+3)),t((16711680&s)>>16),t((65280&s)>>8),t(255&s);return 2===u?(s=n(e.charAt(r))<<2|n(e.charAt(r+1))>>4,t(255&s)):1===u&&(s=n(e.charAt(r))<<10|n(e.charAt(r+1))<<4|n(e.charAt(r+2))>>2,t(s>>8&255),t(255&s)),l}function o(t){function n(t){return e.charAt(t)}function r(e){return n(e>>18&63)+n(e>>12&63)+n(e>>6&63)+n(63&e)}var o,i,a,s=t.length%3,u="";for(o=0,a=t.length-s;a>o;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],u+=r(i);switch(s){case 1:i=t[t.length-1],u+=n(i>>2),u+=n(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=n(i>>10),u+=n(i>>4&63),u+=n(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),l="a".charCodeAt(0),f="A".charCodeAt(0);t.toByteArray=r,t.fromByteArray=o}("undefined"==typeof n?this.base64js={}:n)}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer/node_modules/base64-js/lib/b64.js","/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer/node_modules/base64-js/lib")},{buffer:2,oMfpAn:5}],4:[function(e,t,n){(function(){n.read=function(e,t,n,r,o){var i,a,s=8*o-r-1,u=(1<<s)-1,l=u>>1,f=-7,c=n?o-1:0,d=n?-1:1,h=e[t+c];for(c+=d,i=h&(1<<-f)-1,h>>=-f,f+=s;f>0;i=256*i+e[t+c],c+=d,f-=8);for(a=i&(1<<-f)-1,i>>=-f,f+=r;f>0;a=256*a+e[t+c],c+=d,f-=8);if(0===i)i=1-l;else{if(i===u)return a?0/0:1/0*(h?-1:1);a+=Math.pow(2,r),i-=l}return(h?-1:1)*a*Math.pow(2,i-r)},n.write=function(e,t,n,r,o,i){var a,s,u,l=8*i-o-1,f=(1<<l)-1,c=f>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,g=r?1:-1,m=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),t+=a+c>=1?d/u:d*Math.pow(2,1-c),t*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,o),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,o),a=0));o>=8;e[n+h]=255&s,h+=g,s/=256,o-=8);for(a=a<<o|s,l+=o;l>0;e[n+h]=255&a,h+=g,a/=256,l-=8);e[n+h-g]|=128*m}}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer/node_modules/ieee754/index.js","/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/buffer/node_modules/ieee754")},{buffer:2,oMfpAn:5}],5:[function(e,t){(function(e){function n(){}var e=t.exports={};e.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var r=n.shift();r()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),e.title="browser",e.browser=!0,e.env={},e.argv=[],e.on=n,e.addListener=n,e.once=n,e.off=n,e.removeListener=n,e.removeAllListeners=n,e.emit=n,e.binding=function(){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(){throw new Error("process.chdir is not supported")}}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/process/browser.js","/../../node_modules/gulp-browserify/node_modules/browserify/node_modules/process")},{buffer:2,oMfpAn:5}],6:[function(e,t){(function(){!function(e){function n(){try{return u in e&&e[u]}catch(t){return!1}}function r(e){return function(){var t=Array.prototype.slice.call(arguments,0);t.unshift(i),f.appendChild(i),i.addBehavior("#default#userData"),i.load(u);var n=e.apply(a,t);return f.removeChild(i),n}}function o(e){return e.replace(/^d/,"___$&").replace(h,"___")}var i,a={},s=e.document,u="localStorage",l="script";if(a.disabled=!1,a.set=function(){},a.get=function(){},a.remove=function(){},a.clear=function(){},a.transact=function(e,t,n){var r=a.get(e);null==n&&(n=t,t=null),"undefined"==typeof r&&(r=t||{}),n(r),a.set(e,r)},a.getAll=function(){},a.forEach=function(){},a.serialize=function(e){return JSON.stringify(e)},a.deserialize=function(e){if("string"!=typeof e)return void 0;try{return JSON.parse(e)}catch(t){return e||void 0}},n())i=e[u],a.set=function(e,t){return void 0===t?a.remove(e):(i.setItem(e,a.serialize(t)),t)},a.get=function(e){return a.deserialize(i.getItem(e))},a.remove=function(e){i.removeItem(e)},a.clear=function(){i.clear()},a.getAll=function(){var e={};return a.forEach(function(t,n){e[t]=n}),e},a.forEach=function(e){for(var t=0;t<i.length;t++){var n=i.key(t);e(n,a.get(n))}};else if(s.documentElement.addBehavior){var f,c;try{c=new ActiveXObject("htmlfile"),c.open(),c.write("<"+l+">document.w=window</"+l+'><iframe src="/favicon.ico"></iframe>'),c.close(),f=c.w.frames[0].document,i=f.createElement("div")}catch(d){i=s.createElement("div"),f=s.body}var h=new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]","g");a.set=r(function(e,t,n){return t=o(t),void 0===n?a.remove(t):(e.setAttribute(t,a.serialize(n)),e.save(u),n)}),a.get=r(function(e,t){return t=o(t),a.deserialize(e.getAttribute(t))}),a.remove=r(function(e,t){t=o(t),e.removeAttribute(t),e.save(u)}),a.clear=r(function(e){var t=e.XMLDocument.documentElement.attributes;e.load(u);for(var n,r=0;n=t[r];r++)e.removeAttribute(n.name);e.save(u)}),a.getAll=function(){var e={};return a.forEach(function(t,n){e[t]=n}),e},a.forEach=r(function(e,t){for(var n,r=e.XMLDocument.documentElement.attributes,o=0;n=r[o];++o)t(n.name,a.deserialize(e.getAttribute(n.name)))})}try{var g="__storejs__";a.set(g,g),a.get(g)!=g&&(a.disabled=!0),a.remove(g)}catch(d){a.disabled=!0}a.enabled=!a.disabled,"undefined"!=typeof t&&t.exports&&this.module!==t?t.exports=a:"function"==typeof define&&define.amd?define(a):e.store=a}(Function("return this")())}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/../../node_modules/store/store.js","/../../node_modules/store")},{buffer:2,oMfpAn:5}],7:[function(e,t,n){(function(){"use strict";var e,t,r,o,i,a,s,u,l=window.jQuery||window.Zepto,f=window.CodeMirror,c=function(){e=f(l("#code-hbs")[0],{mode:"xml",indentUnit:2,lineWrapping:!0,lineNumbers:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],tabSize:2,matchBrackets:!0,theme:"default",profile:"xhtml",extraKeys:{Enter:"newlineAndIndentContinueComment",F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)},"Ctrl-Q":function(e){e.foldCode(e.getCursor())}}}),r=f(l("#code-theme")[0],{mode:"css",indentUnit:2,tabSize:2,lineWrapping:!0,lineNumbers:!0,matchBrackets:!0,theme:"default",foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:{Enter:"newlineAndIndentContinueComment",F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),t=f(l("#code-css")[0],{mode:"css",indentUnit:2,tabSize:2,lineWrapping:!0,lineNumbers:!0,matchBrackets:!0,readOnly:!0,theme:"default",extraKeys:{Enter:"newlineAndIndentContinueComment",F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),o=f(l("#code-js")[0],{mode:{name:"javascript",json:!0},indentUnit:2,tabSize:2,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,theme:"default",extraKeys:{Enter:"newlineAndIndentContinueComment",F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}}),i=e.getWrapperElement(),a=t.getWrapperElement(),s=r.getWrapperElement(),u=o.getWrapperElement(),l(e.getInputField()).attr("name","demoTpl"),l(t.getInputField()).attr("name","coreStyle"),l(r.getInputField()).attr("name","selectedTheme"),l(o.getInputField()).attr("name","demoData")},d=function(){var e=l("#demo-area").width(),t=l(window).width()-180-e-1;l(i).width(t),l(a).width(t/2),l(s).width(t/2),l(u).width(t)},h=function(){c(),d(),l(window).resize(d)},g=function(n){e.setValue(n.html),t.setValue(n.css),o.setValue(n.javascript),b()},m=function(){return{html:e.getValue(),css:t.getValue(),theme:r.getValue(),javascript:o.getValue()}},p=function(){e.getInputField().value=e.getValue(),t.getInputField().value=t.getValue(),o.getInputField().value=o.getValue(),r.getInputField().value=r.getValue();var n=o.getValue();try{{JSON.parse(n)}o.getInputField().value=n}catch(i){o.getInputField().value=JSON.stringify(n),console.log("非标准JSON数据，stringify...")}},v=function(){e.setValue(""),t.setValue(""),o.setValue("")},b=function(){for(var n=e.lineCount(),r=0;n>r;r++)e.indentLine(r);for(var i=t.lineCount(),r=0;i>r;r++)t.indentLine(r);for(var a=o.lineCount(),r=0;a>r;r++)o.indentLine(r)},w=function(){return{html:e,css:t,theme:r,data:o}};n.initEditor=h,n.setEditorData=g,n.getEditorData=m,n.reset=v,n.tidyup=b,n.synchronizeData=p,n.getEditor=w}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/editor.js","/")},{buffer:2,oMfpAn:5}],8:[function(e){(function(){var e=window.jQuery||window.Zepto,t=!1;e.browser={msie:!1},e.fn.farbtastic=function(t){return e.farbtastic(this,t),this},e.farbtastic=function(t,n){var t=e(t)[0];return t.farbtastic||(t.farbtastic=new e._farbtastic(t,n))},e._farbtastic=function(n,r){var o=this;o.linkTo=function(t){return"object"==typeof o.callback&&e(o.callback).unbind("keyup",o.updateValue),o.color=null,"function"==typeof t?o.callback=t:("object"==typeof t||"string"==typeof t)&&(o.callback=e(t),o.callback.bind("keyup",o.updateValue),o.callback[0].value&&o.setColor(o.callback[0].value)),this},o.updateValue=function(){this.value&&this.value!=o.color&&o.setColor(this.value)},o.setColor=function(e){var t=o.unpack(e);return o.color!=e&&t&&(o.color=e,o.rgb=t,o.hsl=o.RGBToHSL(o.rgb),o.updateDisplay()),this},o.setHSL=function(e){return o.hsl=e,o.rgb=o.HSLToRGB(e),o.color=o.pack(o.rgb),o.updateDisplay(),this},o.initWidget=function(){var t={width:r.width,height:r.width};e(n).html('<div class="farbtastic" style="position: relative"><div class="farbtastic-solid"></div><canvas class="farbtastic-mask"></canvas><canvas class="farbtastic-overlay"></canvas></div>').find("*").attr(t).css(t),e(n).find("div>*").css("position","absolute"),e.browser.msie||!1,o.radius=(r.width-r.wheelWidth)/2-1,o.square=Math.floor(.7*(o.radius-r.wheelWidth/2))-1,o.mid=Math.floor(r.width/2),o.markerSize=.3*r.wheelWidth,o.solidFill=e(".farbtastic-solid",n).css({width:2*o.square-1,height:2*o.square-1,left:o.mid-o.square,top:o.mid-o.square}),o.cnvMask=e(".farbtastic-mask",n),o.ctxMask=o.cnvMask[0].getContext("2d"),o.cnvOverlay=e(".farbtastic-overlay",n),o.ctxOverlay=o.cnvOverlay[0].getContext("2d"),o.ctxMask.translate(o.mid,o.mid),o.ctxOverlay.translate(o.mid,o.mid),o.drawCircle(),o.drawMask()
  },o.drawCircle=function(){var n,i,a=+new Date,s=24,u=o.radius,l=r.wheelWidth,f=8/u/s*Math.PI,c=o.ctxMask,d=0;c.save(),c.lineWidth=l/u,c.scale(u,u);for(var h=0;s>=h;++h){var g=h/s,m=g*Math.PI*2,p=Math.sin(d),v=-Math.cos(d);if(x2=Math.sin(m),y2=-Math.cos(m),am=(d+m)/2,tan=1/Math.cos((m-d)/2),xm=Math.sin(am)*tan,ym=-Math.cos(am)*tan,color2=o.pack(o.HSLToRGB([g,1,.5])),h>0)if(e.browser.msie){var b=(1+Math.min(Math.abs(Math.tan(d)),Math.abs(Math.tan(Math.PI/2-d))))/s;n=o.pack(o.HSLToRGB([i-.15*b,1,.5])),color2=o.pack(o.HSLToRGB([g+.15*b,1,.5]));var w=c.createLinearGradient(p,v,x2,y2);w.addColorStop(0,n),w.addColorStop(1,color2),c.fillStyle=w;var y=(u+l/2)/u,E=(u-l/2)/u;c.beginPath(),c.moveTo(p*y,v*y),c.quadraticCurveTo(xm*y,ym*y,x2*y,y2*y),c.lineTo(x2*E,y2*E),c.quadraticCurveTo(xm*E,ym*E,p*E,v*E),c.fill()}else{var w=c.createLinearGradient(p,v,x2,y2);w.addColorStop(0,n),w.addColorStop(1,color2),c.strokeStyle=w,c.beginPath(),c.moveTo(p,v),c.quadraticCurveTo(xm,ym,x2,y2),c.stroke()}d=m-f,n=color2,i=g}c.restore(),t&&e("body").append("<div>drawCircle "+(+new Date-a)+"ms")},o.drawMask=function(){function n(e,t,n){for(var r=1/e,o=1/t,i=0;t>=i;++i)for(var a=1-i*o,s=0;e>=s;++s){var u=1-s*r,l=1-2*Math.min(a*u,(1-a)*u),f=l>0?.5*(2*a-1+l)/l:0;n(s,i,f,l)}}var r=+new Date,i=2*o.square,a=o.square;if(o.ctxMask.getImageData){var s=Math.floor(i/2),u=document.createElement("canvas");u.width=u.height=s+1;var l=u.getContext("2d"),f=l.getImageData(0,0,s+1,s+1),c=0;n(s,s,function(e,t,n,r){f.data[c++]=f.data[c++]=f.data[c++]=255*n,f.data[c++]=255*r}),l.putImageData(f,0,0),o.ctxMask.drawImage(u,0,0,s+1,s+1,-a,-a,2*a,2*a)}else if(e.browser.msie){var d,h,g=6,m=Math.floor(i/g);n(m,6,function(t,n,r,i){if(0==t&&(d=h,h=[]),r=Math.round(255*r),i=Math.round(255*i),n>0){var s=d[t][0],u=d[t][1],l=o.packDX(s,u),f=o.packDX(r,i),c=Math.round(o.mid+(.333*(n-1)-1)*a),p=Math.round(o.mid+(.333*n-1)*a);e("<div>").css({position:"absolute",filter:"progid:DXImageTransform.Microsoft.Gradient(StartColorStr="+l+", EndColorStr="+f+", GradientType=0)",top:c,height:p-c,left:o.mid+(t*g-a-1),width:g-(t==m?Math.round(g/2):0)}).appendTo(o.cnvMask)}h.push([r,i])})}else{var s=Math.floor(i/2);n(s,s,function(e,t,n,r){n=Math.round(255*n),o.ctxMask.fillStyle="rgba("+n+", "+n+", "+n+", "+r+")",o.ctxMask.fillRect(2*e-a-1,2*t-a-1,2,2)})}t&&e("body").append("<div>drawMask "+(+new Date-r)+"ms")},o.drawMarkers=function(){var e=r.width,t=Math.ceil(o.markerSize/4),n=o.markerSize-t+1,i=6.28*o.hsl[0],a=Math.sin(i)*o.radius,s=-Math.cos(i)*o.radius,u=2*o.square*(.5-o.hsl[1]),l=2*o.square*(.5-o.hsl[2]),f=o.invert?"#fff":"#000",c=o.invert?"#000":"#fff",d=[{x:a,y:s,r:n,c:"#000",lw:t+1},{x:a,y:s,r:o.markerSize,c:"#fff",lw:t},{x:u,y:l,r:n,c:c,lw:t+1},{x:u,y:l,r:o.markerSize,c:f,lw:t}];o.ctxOverlay.clearRect(-o.mid,-o.mid,e,e);for(var h=0;h<d.length;h++){var g=d[h];o.ctxOverlay.lineWidth=g.lw,o.ctxOverlay.strokeStyle=g.c,o.ctxOverlay.beginPath(),o.ctxOverlay.arc(g.x,g.y,g.r,0,2*Math.PI,!0),o.ctxOverlay.stroke()}},o.updateDisplay=function(){o.invert=.3*o.rgb[0]+.59*o.rgb[1]+.11*o.rgb[2]<=.6,o.solidFill.css("backgroundColor",o.pack(o.HSLToRGB([o.hsl[0],1,.5]))),o.drawMarkers(),"object"==typeof o.callback?(e(o.callback).css({backgroundColor:o.color,color:o.invert?"#fff":"#000"}),e(o.callback).each(function(){"string"==typeof this.value&&this.value!=o.color&&(this.value=o.color)}).change()):"function"==typeof o.callback&&o.callback.call(o,o.color)},o.widgetCoords=function(e){return{x:e.pageX-o.offset.left-o.mid,y:e.pageY-o.offset.top-o.mid}},o.mousedown=function(t){e._farbtastic.dragging||(e(document).bind("mousemove",o.mousemove).bind("mouseup",o.mouseup),e._farbtastic.dragging=!0),o.offset=e(n).offset();var r=o.widgetCoords(t);return o.circleDrag=Math.max(Math.abs(r.x),Math.abs(r.y))>o.square+2,o.mousemove(t),!1},o.mousemove=function(e){var t=o.widgetCoords(e);if(o.circleDrag){var n=Math.atan2(t.x,-t.y)/6.28;o.setHSL([(n+1)%1,o.hsl[1],o.hsl[2]])}else{var r=Math.max(0,Math.min(1,-(t.x/o.square/2)+.5)),i=Math.max(0,Math.min(1,-(t.y/o.square/2)+.5));o.setHSL([o.hsl[0],r,i])}return!1},o.mouseup=function(){e(document).unbind("mousemove",o.mousemove),e(document).unbind("mouseup",o.mouseup),e._farbtastic.dragging=!1},o.dec2hex=function(e){return(16>e?"0":"")+e.toString(16)},o.packDX=function(e,t){return"#"+o.dec2hex(t)+o.dec2hex(e)+o.dec2hex(e)+o.dec2hex(e)},o.pack=function(e){var t=Math.round(255*e[0]),n=Math.round(255*e[1]),r=Math.round(255*e[2]);return"#"+o.dec2hex(t)+o.dec2hex(n)+o.dec2hex(r)},o.unpack=function(e){function t(t){return parseInt(e.substring(t,t+2),16)/255}function t(t){return parseInt(e.substring(t,t+1),16)/15}return 7==e.length?[t(1),t(3),t(5)]:4==e.length?[t(1),t(2),t(3)]:void 0},o.HSLToRGB=function(e){var t,n,r=e[0],o=e[1],i=e[2];return n=.5>=i?i*(o+1):i+o-i*o,t=2*i-n,[this.hueToRGB(t,n,r+.33333),this.hueToRGB(t,n,r),this.hueToRGB(t,n,r-.33333)]},o.hueToRGB=function(e,t,n){return n=(n+1)%1,1>6*n?e+(t-e)*n*6:1>2*n?t:2>3*n?e+(t-e)*(.66666-n)*6:e},o.RGBToHSL=function(e){var t=e[0],n=e[1],r=e[2],o=Math.min(t,n,r),i=Math.max(t,n,r),a=i-o,s=0,u=0,l=(o+i)/2;return l>0&&1>l&&(u=a/(.5>l?2*l:2-2*l)),a>0&&(i==t&&i!=n&&(s+=(n-r)/a),i==n&&i!=r&&(s+=2+(r-t)/a),i==r&&i!=t&&(s+=4+(t-n)/a),s/=6),[s,u,l]},r.callback||(r={callback:r}),r=e.extend({width:200,wheelWidth:(r.width||200)/10,callback:null},r),o.initWidget(),e("canvas.farbtastic-overlay",n).mousedown(o.mousedown),r.callback&&o.linkTo(r.callback),o.color||o.setColor("#EEEEEE")}}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/farbtastic.js","/")},{buffer:2,oMfpAn:5}],9:[function(e,t,n){(function(){var e={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var n="";t=t||"";var r,o,i,a,s,u,l,f=0;for(t=e._utf8_encode(t);f<t.length;)r=t.charCodeAt(f++),o=t.charCodeAt(f++),i=t.charCodeAt(f++),a=r>>2,s=(3&r)<<4|o>>4,u=(15&o)<<2|i>>6,l=63&i,isNaN(o)?u=l=64:isNaN(i)&&(l=64),n=n+this._keyStr.charAt(a)+this._keyStr.charAt(s)+this._keyStr.charAt(u)+this._keyStr.charAt(l);return n},decode:function(t){var n,r,o,i,a,s,u,l="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f<t.length;)i=this._keyStr.indexOf(t.charAt(f++)),a=this._keyStr.indexOf(t.charAt(f++)),s=this._keyStr.indexOf(t.charAt(f++)),u=this._keyStr.indexOf(t.charAt(f++)),n=i<<2|a>>4,r=(15&a)<<4|s>>2,o=(3&s)<<6|u,l+=String.fromCharCode(n),64!=s&&(l+=String.fromCharCode(r)),64!=u&&(l+=String.fromCharCode(o));return l=e._utf8_decode(l)},_utf8_encode:function(e){var t="";e=e.replace(/\r\n/g,"\n");for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);128>r?t+=String.fromCharCode(r):r>127&&2048>r?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t},_utf8_decode:function(e){for(var t="",n=0,r=c1=c2=0;n<e.length;)r=e.charCodeAt(n),128>r?(t+=String.fromCharCode(r),n++):r>191&&224>r?(c2=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&c2),n+=2):(c2=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&c2)<<6|63&c3),n+=3);return t}},t=function(e){for(var t,n,r,o=e.substr(e.lastIndexOf("?")+1).split("&"),i=o.length,a=null,s=0;i>s;s++)t=o[s].split("="),t.length<2||(!a&&(a={}),n=t[0],r=t[1],t=a[n],t?"[object Array]"==Object.prototype.toString.call(t)?t.push(r):a[n]=[t,r]:a[n]=r);return a},r=function(e){var t,n,r;return/iPhone/.test(e)?(t=e.match(/OS\s(.*?)\s/)[1].replace(/_/g,"."),"iPhone(iOS "+t+")"):/iPad/.test(e)?(t=e.match(/OS\s(.*?)\s/)[1].replace(/_/g,"."),"iPad(iOS "+t+")"):/iPod/.test(e)?(t=e.match(/OS\s(.*?)\s/)[1].replace(/_/g,"."),"iPod(iOS "+t+")"):/Android/.test(e)?(t=e.match(/\s(Android.*?);/)[1],n=e.match(/;\s(.*?)\sBuild/)[1],r=n.split("; "),n=r[r.length-1],n+"("+t+")"):"unknow device."},o=function(e,t){var n=e[0],r=n.options;$.each(r,function(e,r){r.value===t&&(n.value=t)})},i=function(){function e(e,t){return new Array(t+1).join(e)}function t(t){var n=0,r=0,o="  ",i="",a=0,s=!1,u=null;for(n=0,r=t.length;r>n;n+=1)switch(u=t.charAt(n)){case"{":case"[":s?i+=u:(i+=u+"\n"+e(o,a+1),a+=1);break;case"}":case"]":s?i+=u:(a-=1,i+="\n"+e(o,a)+u);break;case",":i+=s?u:",\n"+e(o,a);break;case":":i+=s?u:": ";break;case" ":case"\n":case"	":s&&(i+=u);break;case'"':n>0&&"\\"!==t.charAt(n-1)&&(s=!s),i+=u;break;default:i+=u}return i}return t}();n.jsonFormat=i,n.Base64=e,n.queryToJson=t,n.UA2device=r,n.setSelectArea=o}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/tools.js","/")},{buffer:2,oMfpAn:5}]},{},[1]);