Created
August 29, 2017 22:28
-
-
Save lieutar/c91e971a43cf67ab634b10f8db83d33f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name はてブエントリページ拡張 | |
// @namespace tag:lieutar@gmail.com,2016 | |
// @include http://b.hatena.ne.jp/entry/* | |
// @version 1.0 | |
// ==/UserScript== | |
(function(){var $$pm=function $$pm(src){return{$meta:src,getMeta:function getMeta(){return src},isProvided:function isProvided(){return true},isReserved:function isReserved(){return false},isDeprecated:function isDeprecated(){return false},getDeprecatedReason:function getDeprecatedReason(){return null},getDepends:function getDepends(){return[]},getName:function getName(){return src.NAME},getVersion:function getVersion(){return src.VERSION},getBase:function getBase(){return $mod.baseOf(src.NAME)},getHome:function getHome(){var base=this.getBase();var match=String(base).match(/(.*)\/lib\/?$/);return match?match[1]:base},reserve:function reserve(){},getEntity:function getEntity(){},provide:function provide(){},getAuthor:function getAuthor(){return src.AUTHOR},getX:function getX(){return src.X||{}},getSrc:function getSrc(){return src.SRC},getNodeModule:function getNodeModule(){return src.NMOD},getSourceURL:function getSourceURL(){return this.getSrc()},withSourceContent:function withSourceContent(){}}};var mod_hateb_epp_cs$QTjSIy9$4BOOp0_2fe='var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};(function(){var $$pm=function $$pm(src){return{$meta:src,getMeta:function getMeta(){return src},isProvided:function isProvided(){return true},isReserved:function isReserved(){return false},isDeprecated:function isDeprecated(){return false},getDeprecatedReason:function getDeprecatedReason(){return null},getDepends:function getDepends(){return[]},getName:function getName(){return src.NAME},getVersion:function getVersion(){return src.VERSION},getBase:function getBase(){return $mod.baseOf(src.NAME)},getHome:function getHome(){var base=this.getBase();var match=String(base).match(/(.*)\\/lib\\/?$/);return match?match[1]:base},reserve:function reserve(){},getEntity:function getEntity(){},provide:function provide(){},getAuthor:function getAuthor(){return src.AUTHOR},getX:function getX(){return src.X||{}},getSrc:function getSrc(){return src.SRC},getNodeModule:function getNodeModule(){return src.NMOD},getSourceURL:function getSourceURL(){return this.getSrc()},withSourceContent:function withSourceContent(){}}};var mod_KaeL_Commons_Util_GLOBAL=function(){return function(){return this}.apply(null,[])}.apply($$pm({NAME:"KaeL.Commons.Util.GLOBAL"}),[]);var mod_KaeL_Sns_hatena_bookmark_Entry_revertURL=function(){return function(url){var pathinfo=url.replace(/^https?:\\/\\/b\\.hatena\\.(?:ne\\.jp|com)\\/entry\\//,"");return pathinfo.match(/^s\\//)?"https://"+pathinfo.substring(2):"http://"+pathinfo}}.apply($$pm({NAME:"KaeL.Sns.hatena.bookmark.Entry.revertURL"}),[]);var mod_KaeL_Sns_hatena_bookmark_CONST=function(){var HATEB_DOMAIN="http://b.hatena.ne.jp";return{HATEB_DOMAIN:HATEB_DOMAIN,API_DOMAIN:"//b.hatena.ne.jp",LOADING_GIF:HATEB_DOMAIN+"/images/loading.gif",CSS:{BOOKMARK_COUNT:[" font-size: 10px;"," font-weight: 900;"," color: #F00;"," background-color: #FCC;"," display: inline-block;"," text-decoration: none;"," line-height: 12px !important;"," padding: 2px;"," margin: 10px 0px;"].join("")}}}.apply($$pm({NAME:"KaeL.Sns.hatena.bookmark.CONST"}),[]);var mod_KaeL_Commons_Util_gensym=function(){var tbl="";var sl=Array.prototype.slice;(function(ft){if(arguments.length<1)return;for(var c=ft.charCodeAt(0),t=ft.charCodeAt(1);c<=t;c++){tbl+=String.fromCharCode(c)}arguments.callee.apply(this,sl.apply(arguments,[1]))})("09","AZ","az");var tostr=function tostr(n){var len=tbl.length;var R="";while(n>0){var mod=n%len;n=Math.floor(n/len);R=tbl[mod]+R}return R===""?"0":R};var rand=tostr(Math.round(Math.random()*4294967295));var counter=0;var PREFIX=tostr((new Date).getTime())+"$"+rand+"_";return function(prefix){return(prefix||"sym_")+PREFIX+Number(counter++).toString(16)}}.apply($$pm({NAME:"KaeL.Commons.Util.gensym"}),[]);var mod_KaeL_Commons_String_xmlify=function(){return function(s){return(s||"").replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/\\"/g,""").replace(/\\\'/g,"'")}}.apply($$pm({NAME:"KaeL.Commons.String.xmlify"}),[]);var mod_KaeL_DHTML_Elem_hasClassName=function(){return function(n,cn){if(!n)return false;var ncn=n.className;if(!ncn)return!cn;var _iteratorNormalCompletion=true;var _didIteratorError=false;var _iteratorError=undefined;try{for(var _iterator=ncn.split(/\\s+/)[Symbol.iterator](),_step;!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=true){var s=_step.value;if(s==cn)return true}}catch(err){_didIteratorError=true;_iteratorError=err}finally{try{if(!_iteratorNormalCompletion&&_iterator.return){_iterator.return()}}finally{if(_didIteratorError){throw _iteratorError}}}return false}}.apply($$pm({NAME:"KaeL.DHTML.Elem.hasClassName"}),[]);var mod_KaeL_Commons_DOM_NODE_TYPE=function(){return{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}}.apply($$pm({NAME:"KaeL.Commons.DOM.NODE_TYPE"}),[]);var mod_KaeL_Sns_hatena_User_Icon_url=function(){var ICON_DOMAIN="http://cdn1.www.st-hatena.com/users/";return function profileIconUrl(user){if(user.match(/@/))return"http://n.hatena.com/"+encodeURIComponent(user)+"/profile/image?size=48&type=icon";return ICON_DOMAIN+"/"+user.substring(0,2)+"/"+user+"/profile_l.gif"}}.apply($$pm({NAME:"KaeL.Sns.hatena.User.Icon.url"}),[]);var mod_KaeL_Commons_String_VERSION=function(){var lt=function lt(a,b){var A=a.split(/./);var B=b.split(/./);for(var i=0,l=Math.max(A.length,B.length);i<l;i++){var ae=A[i]||"";var be=B[i]||"";if(ae>be)return false;if(ae==be)continue;if(ae<be)return true}return false};var gt=function gt(a,b){var A=a.split(/./);var B=b.split(/./);for(var i=0,l=Math.max(A.length,B.length);i<l;i++){var ae=A[i]||"";var be=B[i]||"";if(ae<be)return false;if(ae==be)continue;if(ae>be)return true}return false};var eq=function eq(a,b){return a==b};return{lt:lt,gt:gt,eq:eq,le:function le(a,b){return lt(a,b)||eq(a,b)},ge:function ge(a,b){return gt(a,b)||eq(a,b)}}}.apply($$pm({NAME:"KaeL.Commons.String.VERSION"}),[]);var mod_KaeL_Commons_Class_LowLevel_JAR=function(){var classes=[];return{register:function register(constructor){classes.push(constructor)},classes:classes}}.apply($$pm({NAME:"KaeL.Commons.Class.LowLevel.JAR"}),[]);var mod_KaeL_Commons_Object_derive=function(){var ocreate="create"in Object?function(o){return Object.create(o)}:function(o){var klass=function klass(){};klass.prototype=o;return new klass};return function(obj,props){var ret=ocreate(obj);switch(typeof props==="undefined"?"undefined":_typeof(props)){case"function":props.apply(ret,[obj]);break;case"object":for(var f in props){ret[f]=props[f]}}return ret}}.apply($$pm({NAME:"KaeL.Commons.Object.derive"}),[]);var mod_KaeL_Commons_Array_toObject=function(){return function(src,val){var ret={};for(var i=0,l=src.length;i<l;i++){ret[src[i]]=val}return ret}}.apply($$pm({NAME:"KaeL.Commons.Array.toObject"}),[]);var mod_KaeL_Commons_Util_isFunc=function(AGENT){return function(o){if(o instanceof RegExp)return false;if(typeof o!="function")return false;return!("$meta"in o)}}.apply($$pm({NAME:"KaeL.Commons.Util.isFunc"}),[]);var mod_KaeL_Commons_Array_PROTOTYPE=function(){var runtime=Array.prototype;var polyfill={concat:runtime.concat,every:function every(callbackfn,thisArg){var T,k;if(this==null){throw new TypeError("this is null or not defined")}var O=Object(this);var len=O.length>>>0;if(typeof callbackfn!=="function"){throw new TypeError}if(arguments.length>1){T=thisArg}k=0;while(k<len){var kValue;if(k in O){kValue=O[k];var testResult=callbackfn.call(T,kValue,k,O);if(!testResult){return false}}k++}return true},filter:function filter(fun){if(this===void 0||this===null)throw new TypeError;var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;var res=[];var thisArg=arguments.length>=2?arguments[1]:void 0;for(var i=0;i<len;i++){if(i in t){var val=t[i];if(fun.call(thisArg,val,i,t))res.push(val)}}return res},find:function find(predicate){if(this==null){throw new TypeError("Array.prototype.find called on null or undefined")}if(typeof predicate!=="function"){throw new TypeError("predicate must be a function")}var list=Object(this);var length=list.length>>>0;var thisArg=arguments[1];var value;for(var i=0;i<length;i++){if(i in list){value=list[i];if(predicate.call(thisArg,value,i,list)){return value}}}return undefined},findIndex:function findIndex(predicate){if(this==null){throw new TypeError("Array.prototype.find called on null or undefined")}if(typeof predicate!=="function"){throw new TypeError("predicate must be a function")}var list=Object(this);var length=list.length>>>0;var thisArg=arguments[1];var value;for(var i=0;i<length;i++){if(i in list){value=list[i];if(predicate.call(thisArg,value,i,list)){return i}}}return-1},forEach:function forEach(callback,thisArg){var T,k;if(this==null){throw new TypeError(" this is null or not defined")}var O=Object(this);var len=O.length>>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=thisArg}k=0;while(k<len){var kValue;if(k in O){kValue=O[k];callback.call(T,kValue,k,O)}k++}},indexOf:function indexOf(searchElement,fromIndex){if(this===undefined||this===null){throw new TypeError(\'"this" is null or not defined\')}var length=this.length>>>0;fromIndex=+fromIndex||0;if(Math.abs(fromIndex)===Infinity){fromIndex=0}if(fromIndex<0){fromIndex+=length;if(fromIndex<0){fromIndex=0}}for(;fromIndex<length;fromIndex++){if(this[fromIndex]===searchElement){return fromIndex}}return-1},join:runtime.join,lastIndexOf:function lastIndexOf(searchElement){if(this===void 0||this===null){throw new TypeError}var n,k,t=Object(this),len=t.length>>>0;if(len===0){return-1}n=len-1;if(arguments.length>1){n=Number(arguments[1]);if(n!=n){n=0}else if(n!=0&&n!=1/0&&n!=-(1/0)){n=(n>0||-1)*Math.floor(Math.abs(n))}}for(k=n>=0?Math.min(n,len-1):len-Math.abs(n);k>=0;k--){if(k in t&&t[k]===searchElement){return k}}return-1},map:function map(callback,thisArg){var T,A,k;if(this==null){throw new TypeError(" this is null or not defined")}var O=Object(this);var len=O.length>>>0;if(typeof callback!=="function"){throw new TypeError(callback+" is not a function")}if(arguments.length>1){T=thisArg}A=new Array(len);k=0;while(k<len){var kValue,mappedValue;if(k in O){kValue=O[k];mappedValue=callback.call(T,kValue,k,O);A[k]=mappedValue}k++}return A},pop:runtime.pop,push:runtime.push,reduce:function reduce(callback){if(null===this||"undefined"===typeof this){throw new TypeError("Array.prototype.reduce called on null or undefined")}if("function"!==typeof callback){throw new TypeError(callback+" is not a function")}var t=Object(this),len=t.length>>>0,k=0,value;if(arguments.length>=2){value=arguments[1]}else{while(k<len&&!k in t){k++}if(k>=len)throw new TypeError("Reduce of empty array with no initial value");value=t[k++]}for(;k<len;k++){if(k in t){value=callback(value,t[k],k,t)}}return value},reduceRight:function reduceRight(callback){if(null===this||"undefined"===typeof this){throw new TypeError("Array.prototype.reduce called on null or undefined")}if("function"!==typeof callback){throw new TypeError(callback+" is not a function")}var t=Object(this),len=t.length>>>0,k=len-1,value;if(arguments.length>=2){value=arguments[1]}else{while(k>=0&&!k in t){k--}if(k<0)throw new TypeError("Reduce of empty array with no initial value");value=t[k--]}for(;k>=0;k--){if(k in t){value=callback(value,t[k],k,t)}}return value},reverse:runtime.reverse,shift:runtime.shift,slice:runtime.slice,some:function some(fun){if(this===void 0||this===null)throw new TypeError;var t=Object(this);var len=t.length>>>0;if(typeof fun!=="function")throw new TypeError;var thisArg=arguments.length>=2?arguments[1]:void 0;for(var i=0;i<len;i++){if(i in t&&fun.call(thisArg,t[i],i,t))return true}return false},sort:runtime.sort,splice:runtime.splice,toLocalString:runtime.toString,toString:runtime.toString,unshift:runtime.unshift};var dst={};for(var f in polyfill){dst[f]=runtime[f]||polyfill[f]}return dst}.apply($$pm({NAME:"KaeL.Commons.Array.PROTOTYPE"}),[]);var mod_KaeL_Commons_Type_duck=function(){var duck=function duck(o){if(!o){throw new Error("The object is empty.")}for(var i=1,l=duck.length;i<l;i++){if("function"!=typeof o[arguments[i]])throw new Error("The object doesn\'t have the method: "+arguments[i])}};duck.p=function(o){try{duck.apply(null,arguments);return true}catch(e){}return false};return duck}.apply($$pm({NAME:"KaeL.Commons.Type.duck"}),[]);var mod_KaeL_Commons_Function_setName=function(){return function(f,name){try{Object.defineProperty(f,"name",{value:name,writable:false});return true}catch(e){}return false}}.apply($$pm({NAME:"KaeL.Commons.Function.setName"}),[]);var mod_KaeL_Commons_Object_equals=function(){return function(a,b){if(a===b)return true;if((typeof a==="undefined"?"undefined":_typeof(a))!=(typeof b==="undefined"?"undefined":_typeof(b)))return false;var equals=arguments.callee;switch(typeof a==="undefined"?"undefined":_typeof(a)){case"number":if(isNaN(a))return isNaN(b);return a==b;case"boolean":case"string":return a==b;case"object":if(a===null)return b===null;if("object"!==(typeof b==="undefined"?"undefined":_typeof(b)))return false;if(null===b)return false;if(a instanceof Array){var l=a.length;if(l!=b.length)return false;for(var i=0;i<l;i++){if(!arguments.callee(a[i],b[i]))return false}return true}else if(a instanceof RegExp){if(!(b instanceof RegExp))return false;return String(a)==String(b)}else if(a instanceof Date){if(!(b instanceof Date))return false;return a.getTime()==b.getTime()}else{if("equals"in a&&"function"==typeof a.equals){return a.equals(b)}var i=0;var alen=0;var f;for(f in a){alen++;if(!(f in b))return false;if(!equals(a[f],b[f]))return false}var blen=0;for(f in b){blen++}return alen==blen}default:return a===b}}}.apply($$pm({NAME:"KaeL.Commons.Object.equals"}),[]);var mod_KaeL_Commons_Object_mix_simple=function(){return function(){var R={};for(var i=0,l=arguments.length;i<l;i++){var o=arguments[i];for(var f in o){R[f]=o[f]}}return R}}.apply($$pm({NAME:"KaeL.Commons.Object.mix.simple"}),[]);var mod_KaeL_Commons_Object_getPrototypeOf=function(){if("getPrototypeOf"in Object)return function getPrototypeOf(o){return Object.getPrototypeOf(o)};return function(o){return o.constructor?o.constructor.prototype:null}}.apply($$pm({NAME:"KaeL.Commons.Object.getPrototypeOf"}),[]);var mod_KaeL_Commons_Object_map=function(){return function(o,cb){var R={};for(var f in o){R[f]=cb(o,f)}return R}}.apply($$pm({NAME:"KaeL.Commons.Object.map"}),[]);var mod_KaeL_Commons_Object_keys=function(){if(Object.keys)return function(obj){return Object.keys(obj)};return function(obj){var R=[];for(var f in obj){R.push(f)}return R}}.apply($$pm({NAME:"KaeL.Commons.Object.keys"}),[]);var mod_KaeL_Commons_Object_values=function(){if("function"===typeof Object.values)return Object.values;return function(o){var R=[];for(var f in o){R.push(o[f])}return R}}.apply($$pm({NAME:"KaeL.Commons.Object.values"}),[]);var mod_KaeL_Commons_Util_isObject_simple=function(){return function(o){return!!(o&&o.constructor&&(o.constructor===Object||o.constructor.name&&o.constructor.name=="Object"))}}.apply($$pm({NAME:"KaeL.Commons.Util.isObject.simple"}),[]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_isa=function(){return function(spec,$self){var isa=spec.isa||null;if(isa){if(!(isa instanceof Array))isa=[isa]}if("Enum"in spec){(isa||(isa=[])).push(spec.Enum)}if(($self||null)&&isa){for(var i=0,l=isa.length;i<l;i++){if(isa[i]==="$self")isa[i]=$self}}return isa}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.prepare.isa"}),[]);var mod_KaeL_Commons_Function_advicer_prepare_input=function(){return function prepareInputAdvice(advice){if("function"===typeof advice)return advice;var result=null;var prepend=[];var append=[];if(advice.prepend||false){prepend=advice.prepend;if(!(prepend instanceof Array))prepend=[prepend]}if(advice.append||false){append=advice.append;if(!(append instanceof Array))append=[append]}if(advice.set||false){var set=advice.set;result=function advice$input$set(){var args=slice.apply(arguments,[0]);for(var pos in set){args[pos]=set[pos]}return prepend.concat(args).concat(append)}}else{result=function advice$input$(){return prepend.concat(slice.apply(arguments,[0])).concat(append)}}var dictify=advice.dictify||null;if(dictify){var dictifyLen=dictify.length;result=function(orig){return function advice$input$dictify(){var dict={};var src=orig.apply(this,arguments);for(var i=0;i<dictifyLen;i++){dict[dictify[i]]=src[i]}return[dict]}}(result)}var undictify=advice.undictify||null;if(undictify){var undictifyLen=undictify.length;result=function(orig){return function advice$input$undictify(){var src=orig.apply(this,arguments)[0];var args=new Array(undictifyLen);for(var i=0;i<undictifyLen;i++){args[i]=src[undictify[i]]}return args}}(result)}return result}}.apply($$pm({NAME:"KaeL.Commons.Function.advicer.prepare.input"}),[]);var mod_KaeL_Commons_Util_TYPES=function(){var dict={};var classes=[Boolean,Number,String,Function];for(var i=0,l=classes.length;i<l;i++){dict[_typeof(classes[i]())]=classes[i]}return dict}.apply($$pm({NAME:"KaeL.Commons.Util.TYPES"}),[]);var mod_KaeL_Commons_Util_isObject=function(){return function(o){if(o===undefined||o===null)return false;if("object"!==(typeof o==="undefined"?"undefined":_typeof(o)))return false;if(o instanceof Array)return false;if(o instanceof RegExp)return false;return true}}.apply($$pm({NAME:"KaeL.Commons.Util.isObject"}),[]);var mod_KaeL_Commons_String_ucfirst=function(){return function(s){return(s+"").replace(/^./,function($all){return $all.toUpperCase()})}}.apply($$pm({NAME:"KaeL.Commons.String.ucfirst"}),[]);var mod_KaeL_Commons_Array_uniq_string=function(){return function(a){var dict={};for(var i=0,l=a.length;i<l;i++){dict[a[i]]=true}var R=[];for(var f in dict){R.push(f)}return R}}.apply($$pm({NAME:"KaeL.Commons.Array.uniq.string"}),[]);var mod_KaeL_Commons_RegExp_GENERIC=function(){var exports={};var metachars_=exports.metachars_="!-/:-@\\\\[-^`\\\\{-\\\\~";var metachars=exports.metachars="["+metachars_+"]";var controls_=exports.controls_="\\0-";var controls=exports.controls="["+controls_+"]";var ctrlmeta_=exports.ctrlmeta_=metachars_+controls_;var ctrlmeta=exports.ctrlmeta="["+ctrlmeta_+"]";var number=exports.number="[\\\\-\\\\+](?:(?:0|[1-9]\\\\d*)(?:.\\\\d*)?|.\\\\d+)(?:e[\\\\-\\\\+]?(?:0|[1-9]\\\\d*))?";var iso8601OrderedDate="(?:\\\\d{1,4}\\\\D\\\\d{1,2}\\\\D\\\\d{1,2}|\\\\d{6})";exports.iso8601OrderedDate=iso8601OrderedDate;var looksLikeTimestamp=exports.looksLikeTimestamp=function(){var DATEPAT="\\\\D?(\\\\d{4})\\\\D(\\\\d{1,2})\\\\D(\\\\d{1,2})";var TIMEPAT="\\\\D(\\\\d{1,2})\\\\D(\\\\d{1,2})\\\\D(\\\\d{1,2})(?:\\\\.(\\\\d*))?";var TZPAT="(Z|[\\\\-\\\\+]?(?:\\\\d\\\\d(?::\\\\d\\\\d)?|\\\\d{1,3}))";return DATEPAT+TIMEPAT+"(?:"+TZPAT+")?"}();var iso8601OrderedTimestamp=iso8601OrderedDate+"\\\\D?(?:\\\\d{1,2}\\\\D\\\\d{1,2}\\\\D\\\\d{1,2}|\\\\d{6})";exports.iso8601Timestamp=iso8601OrderedTimestamp;return exports}.apply($$pm({NAME:"KaeL.Commons.RegExp.GENERIC"}),[]);var mod_KaeL_Commons_Array_gen=function(){return function(elem,len){elem=elem||undefined;len=len||0;var buf=new Array(len);while(len-- >0){buf[len]=elem}return buf}}.apply($$pm({NAME:"KaeL.Commons.Array.gen"}),[]);var mod_KaeL_Commons_Codec_JSON_read=function(){try{var parse=JSON.parse;return function(){return parse.apply(JSON,arguments)}}catch(e){}var APOS="\\\\\'(?:[^\\\\\\\\\']|\\\\\\\\.)*\\\\\'";var QUOT=\'\\\\"(?:[^\\\\\\\\"]|\\\\\\\\.)*\\\\"\';var NUMERIC="[\\\\-\\\\+]?(?:[1-9][0-9]*|0)(?:\\\\.[0-9]*(?:e[\\\\-\\\\+][0-9]+)?)?";var ATOMS="true|false|NaN|null|undefined|Infinity";var SAFE=new RegExp(["^(",[APOS,QUOT,NUMERIC,ATOMS].join("|"),")([\\0-]*)"].join(""));var QKEY=new RegExp(["^(",[APOS,QUOT].join("|"),")\\\\s*:\\\\s*([\\0-]*)"].join(""));var UNQKEY=/^(\\w+)\\s*:\\s*([\\u0000-\\uFFFF]*)\\s*/;var IGNORE=/^(?:\\/\\*(?:[^\\*]|\\*[^\\/])*\\*\\/|\\/\\/[^\\n\\r]*\\s*|\\s+)+/;var ACT=[];return function(src){var retval=null;var rest=(src+"").replace(/^\\s*/,"");var stack=[];var state="VALUE";var value=null;var onpop=function onpop(v){retval=v};var syntaxError=function syntaxError(msg){throw new Error("JSON SYNTAX ERROR::"+msg)};var push=function push(st,act,val){stack.push([state,onpop,val]);state=st;onpop=act};var pop=function pop(){var newState=stack.pop();if(!newState)return false;state=newState[0];onpop=newState[1];value=newState[2];return true};while(rest.length>0){var head=rest.charAt(0);switch(head){case"[":rest=rest.substring(1);(function(val){push("ARRAY",function(v){val.push(v)},val)})([]);continue;case"]":rest=rest.substring(1);if(state!="ARRAY")syntaxError("illegal character found: "+head);pop();break;case"{":rest=rest.substring(1);(function(val){push("DICKEY",function(v){val[v[0]]=v[1]},val)})({});continue;case"}":rest=rest.substring(1);if(state!="DICKEY")syntaxError("illegal character found: "+head);pop();break;default:if(state=="DICKEY"){var match=rest.match(QKEY);var key=null;if(match){key=eval("("+match[1]+")");rest=match[2]}else{match=rest.match(UNQKEY);if(match){key=match[1];rest=match[2]}else{syntaxError("illegal key format.")}}(function(val){push("DICVAL",function(v){val[1]=v;pop();onpop(val)},val)})([key]);continue}else{var match=rest.match(SAFE);if(match){value=eval("("+match[1]+")");rest=match[2]||""}else{syntaxError("illegal sequence found: "+rest.substring(0,5)+"...\\n"+"current state="+state)}}break}if(state!="VALUE")rest=rest.replace(/^\\s*,?\\s*/,"");rest=rest.replace(IGNORE,"");onpop(value)}if(stack.length>0)syntaxError("unterminated "+state);return retval}}.apply($$pm({NAME:"KaeL.Commons.Codec.JSON.read"}),[]);var mod_KaeL_Sns_hatena_bookmark_Entry_Page_Tab_append=function(window){var document=window.document;return function(name){var tabs=document.querySelector(".js-bookmarks-sort-tabs ul");var panels=document.querySelector(".js-bookmarks-sort-panels");if(!(tabs&&panels))return{tab:null,panel:null};var tab=document.createElement("li");var panel=document.createElement("div");tab.setAttribute("data-sort",name);panel.setAttribute("data-sort",name);tab.className="js-bookmarks-sort-tab is-didabled";panel.className="bookmarks-sort-panel js-bookmarks-sort-panel is-disabled";tabs.appendChild(tab);panels.appendChild(panel);if(window.localStorage.getItem("bookmark_sort_tab")==name){tab.dispatchEvent(new window.MouseEvent("click",{bubbles:true}))}return{tab:tab,panel:panel}}}.apply($$pm({NAME:"KaeL.Sns.hatena.bookmark.Entry.Page.Tab.append"}),[mod_KaeL_Commons_Util_GLOBAL]);var mod_KaeL_Sns_hatena_withHatena=function(win){return function withHatena(cb){(function(){if(typeof win.Hatena==="undefined"){win.setTimeout(arguments.callee,100);return}cb(win.Hatena)})()}}.apply($$pm({NAME:"KaeL.Sns.hatena.withHatena"}),[mod_KaeL_Commons_Util_GLOBAL]);var mod_KaeL_WebEx_Util_jsonp=function(window,gensym){return function jsonp(url,opt){var document=window.document;var JSON=window.JSON;var query="";var id=gensym("jsonp_").replace(/\\$/g,"_");var cb=function cb(){};for(var f in opt){var v=opt[f];if(v instanceof Function){cb=v;v=id}query+="&"+encodeURIComponent(f)+"="+encodeURIComponent(v)}url+=query.replace(/^./,url.match(/\\?/)?"&":"?");var id_receiver=gensym("script_").replace(/\\$/g,"_");var receive_script=String(function $$receive$$(json){var s=document.createElement("script");s.id="$$receive$$";s.language="json";s.type="application/json";s.appendChild(document.createTextNode(JSON.stringify(json)));document.body.appendChild(s);var me=document.querySelector("#$$id_receiver$$");if(me)me.parentNode.removeChild(me);delete window.$$receive$$}).replace(/\\$\\$receive\\$\\$/g,id).replace(/\\$\\$id_receiver\\$\\$/g,id_receiver);var head=document.querySelector("head");var rec=document.createElement("script");rec.language="JavaScript";rec.id=id_receiver;rec.appendChild(document.createTextNode(receive_script));head.appendChild(rec);var call=document.createElement("script");call.src=url;call.language="JavaScript";head.appendChild(call);function iter(){var container=document.querySelector("#"+id);if(!container){window.setTimeout(iter,100);return}var content=container.firstChild.textContent;container.parentNode.removeChild(container);cb(JSON.parse(content))}iter()}}.apply($$pm({NAME:"KaeL.WebEx.Util.jsonp"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Commons_Util_gensym]);var mod_KaeL_Commons_Class_gen_constructor=function(gensym){return function(){return function $new(){var self=this;var constructor=arguments.callee;var meta=constructor.$meta;if(!(self instanceof constructor)){var klass=function klass(){};klass.prototype=constructor.prototype;self=new klass}self.__ID__=gensym();var roles=meta?meta.getAllRoles():[];var i,l;for(i=0,l=roles.length;i<l;i++){var role=roles[i];role.initFeature(self);role.preInit(self,arguments)}self.initialize.apply(self,arguments);for(i=0,l=roles.length;i<l;i++){roles[i].postInit(self,arguments)}return self}}}.apply($$pm({NAME:"KaeL.Commons.Class.gen.constructor"}),[mod_KaeL_Commons_Util_gensym]);var mod_KaeL_Sns_hatena_User_Icon_get=function(G,profileIconUrl){var buildDefaultHref;var host=(G.location||{}).host||"";if(host.match(/\\w+\\.hatena\\.ne\\.jp/)){buildDefaultHref=function buildDefaultHref(user){return G.location.protocol+"//"+G.location.host+"/"}}else{buildDefaultHref=function buildDefaultHref(user){return"http://www.hatena.ne.jp/"+user+"/"}}return function profileIcon(user,href_){var href=href_||buildDefaultHref(user);var a=G.document.createElement("a");a.title=user;a.className="profile-icon";var icon=G.document.createElement("img");icon.src=profileIconUrl(user);icon.alt=user;a.appendChild(icon);return a}}.apply($$pm({NAME:"KaeL.Sns.hatena.User.Icon.get"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_User_Icon_url]);var mod_KaeL_Commons_Util_AGENT=function(VERSION){var NAME="unknown";var VER="";var isXUL=false;var isCfx=false;(function(){try{if("function"===typeof PerlSub){NAME="jspl";VER=sysver.PID;return}}catch(e){}try{if(!!process.version){NAME="node.js";VER=process.version;return}}catch(e){}try{require("@loader/options");require("chrome");require("sdk/self");NAME="gecko";isXUL=true;isCfx=true}catch(e){try{if(String(window).match(/chromewindow/i)){NAME="gecko";isXUL=true;return}}catch(e){}}var win=null;var navi=null;var ua=null;var match=null;var doc=null;try{win=window;navi=win.navigator;ua=navi.userAgent;doc=win.document}catch(e){return}if(win.opera){NAME="opera";match=ua.match(/Opera\\W([\\d\\.]+)/);VER=match[1];return}if(ua.indexOf("KaeL::JE")==0){NAME="KaeLJE";VER=navi.version;return}if(ua.indexOf("Gecko/")>-1){NAME="gecko";var m=ua.match(/Gecko\\/(\\S+)/);VER=m?m[1]:null;return}if(ua.toLowerCase().indexOf("chrome")>-1){NAME="chrome";return}if(ua.toLowerCase().indexOf("safari")>-1){NAME="webkit";return}if(ua.toLowerCase().indexOf("konqueror")>-1){NAME="khtml";return}if(document.all){NAME="ie";return}switch(NAME){case"gecko":match=ua.match(/Gecko\\/(\\d+)/);VER=match[1];break;case"webkit":case"chrome":match=ua.match(/AppleWebKit\\/([\\d\\.]+)/);VER=match[1];break;case"ie":match=ua.match(/^Mozilla\\/\\d+\\.\\d+ \\(compatible; MSIE (\\d+\\.\\d+)/);if(match)VER=match[1]}})();var hasDoc=false;try{hasDoc=!!(document&&window&&function(){return this===window}.call(null))}catch(e){hasDoc=false}var fsAccessible=isCfx||function(){for(var i=0,l=arguments.length;i<l;i++){if(arguments[i]==NAME)return true}return false}("KaeLJE","node.js","jspl","unknown");var AGENT_PROTO={};(function(){var proto=this;this.initialize=function(){this.NAME=NAME;this.__version=VER;this.__isXUL=isXUL;this.__isCfx=isCfx;this.__hasDoc=hasDoc;this.__fsAccessible=fsAccessible};this.versionLt=function(ver){return VERSION.lt(this.__version,ver)};this.versionIs=function(ver){return VERSION.eq(this.__version,ver)};this.versionGt=function(ver){return VERSION.gt(this.__version,ver)};this.versionLe=function(ver){return VERSION.le(this.__version,ver)};this.versionGe=function(ver){return VERSION.ge(this.__version,ver)};this.isKaeLJE=function(){return this.NAME=="KaeLJE"};this.isJSPL=function(){return this.NAME=="JSPL"};this.isNodeJS=function(){return this.NAME=="node.js"};this.isIE=function(ver){return this.NAME=="ie"};this.isOpera=function(){return this.NAME=="opera"};this.isGecko=function(){return this.NAME=="gecko"};this.isXUL=function(){return this.__isXUL};this.isCfx=function(){return this.__isCfx};this.isChrome=function(){return this.NAME=="chrome"};this.isWebkit=function(){return this.NAME=="webkit"||this.NAME=="chrome"};this.isKhtml=function(){return this.NAME=="khtml"||this.NAME=="webkit"||this.NAME=="chrome"};this.stringify=function(){return"["+this.NAME+" "+this.__version+"]"};this.toString=function(){return this.stringify()};this.isFsAccessible=function(){return!!this.__fsAccessible};this.hasDoc=function(){return this.__hasDoc};this.getBODY=isXUL?function(){var htmls=document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml","html");if(!htmls)return null;var node=htmls[0].firstChild;do{if(node.tagName&&node.localName=="body"&&node.namespaceURI=="http://www.w3.org/1999/xhtml")return node;node=node.nextSibling}while(node);return null}:hasDoc?function(){return document.body}:function(){return null}}).apply(AGENT_PROTO,[]);var Agent=function Agent(){this.constructor=Agent;this.initialize.apply(this,arguments)};Agent.prototype=AGENT_PROTO;return new Agent}.apply($$pm({NAME:"KaeL.Commons.Util.AGENT"}),[mod_KaeL_Commons_String_VERSION]);var mod_KaeL_Commons_Object_hasProp=function(getPrototypeOf){return function(obj,f,level,val){level=level||0;val=val||obj[f];if(obj===null||obj===undefined)return false;var proto=getPrototypeOf(obj);if(proto[f]===undefined)return true;if(proto[f]!==val)return true;if(level<1)return false;return arguments.callee(proto,f,level-1)}}.apply($$pm({NAME:"KaeL.Commons.Object.hasProp"}),[mod_KaeL_Commons_Object_getPrototypeOf]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_container=function(isSimpleObject,mix){return function(src,fspec_){var fspec=fspec_||{};var container=src||null;if(container){if("string"===typeof container)container={property:container};if(!isSimpleObject(container))throw new TypeError;container=mix(container);var getContainer=container.get||null;if(!getContainer){var prop=container.property||null;if(!prop){throw new Error("container getter is not specified.")}delete container.property;getContainer=function getContainer(){return this[prop]}}if("string"===typeof getContainer){var getterMethod=getContainer;getContainer=function getContainer(){return this[getterMethod]()}}container.get=getContainer;var setter=container.setter||null;var getter=container.getter||null;var predicate=container.predicate||null;var clearer=container.clearer||null;fspec.delegated=!!(setter||getter||predicate||clearer)}fspec.container=container;return container}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.prepare.container"}),[mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_Object_mix_simple]);var mod_KaeL_Commons_Function_ADVICERS=function(prepareInput){var slice=Array.prototype.slice;return{no:function no(orig,advice){return orig},override:function override(orig,advice){return advice},around:function around(orig,advice){return function advice$around(){for(var _len=arguments.length,args=Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key]}args.unshift(orig);return advice.apply(this,args)}},before:function before(orig,advice){return function advice$before(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2<_len2;_key2++){args[_key2]=arguments[_key2]}advice.apply(this,args);return orig.apply(this,args)}},after:function after(orig,advice){return function advice$after(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3<_len3;_key3++){args[_key3]=arguments[_key3]}var R=orig.apply(this,args);advice.apply(this,args);return R}},input:function input(orig,advice_){var advice=prepareInput(advice_);return function advice$input(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4<_len4;_key4++){args[_key4]=arguments[_key4]}var filtered=advice.apply(this,args);return orig.apply(this,filtered)}},output:function output(orig,advice){return function advice$output(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5<_len5;_key5++){args[_key5]=arguments[_key5]}var R=orig.apply(this,args);args.unshift(R);return advice.apply(this,args)}}}}.apply($$pm({NAME:"KaeL.Commons.Function.ADVICERS"}),[mod_KaeL_Commons_Function_advicer_prepare_input]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_specialForm=function(isSimpleObject,isObject,TYPES){return function prepareSpecialForm(spec,attr){if(isSimpleObject(spec))return spec;if(spec===undefined)throw new TypeError("undefined spec for "+(attr.getName?attr.getFullName():attr));if(spec instanceof Array)return function(o){return{isa:Array,init:function init(){return o.slice(0)}}}(spec);if(isObject(spec)){if("function"===typeof spec.buildSpec)return spec.buildSpec(attr);try{console.warn(spec,String(spec))}catch(e){}throw new Error("The complex attribute spec could not be resolved. :"+(attr.getFullName?attr.getFullName():attr))}return function(o){var R={init:function $specialFormInit(){return o}};var isa=TYPES[typeof o==="undefined"?"undefined":_typeof(o)]||(o instanceof RegExp?RegExp:null);if(isa)R.isa=isa;return R}(spec)}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.prepare.specialForm"}),[mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_Util_isObject,mod_KaeL_Commons_Util_TYPES]);var mod_KaeL_Commons_RegExp_quote=function(GENERIC){var metapat=new RegExp("("+GENERIC.metachars+")","g");return function(src){return src.replace(metapat,"\\\\$1")}}.apply($$pm({NAME:"KaeL.Commons.RegExp.quote"}),[mod_KaeL_Commons_RegExp_GENERIC]);var mod_KaeL_Commons_String_repeat=function(arrayGen){return function(part,len){return arrayGen(part+"",len).join("")}}.apply($$pm({NAME:"KaeL.Commons.String.repeat"}),[mod_KaeL_Commons_Array_gen]);var mod_KaeL_Sns_hatena_star_withStar=function(win,withHatena){return function withStar(cb){withHatena(function(Hatena){(function(){if(typeof Hatena.Star==="undefined"){win.setTimeout(arguments.callee,100);return}cb(Hatena.Star,Hatena)})()})}}.apply($$pm({NAME:"KaeL.Sns.hatena.star.withStar"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_withHatena]);var mod_KaeL_Sns_hatena_bookmark_Entry_Comment_List_with=function(C,jsonp){return function(uri,cb){jsonp(C.API_DOMAIN+"/entry/jsonlite/",{url:uri,callback:cb})}}.apply($$pm({NAME:"KaeL.Sns.hatena.bookmark.Entry.Comment.List.with"}),[mod_KaeL_Sns_hatena_bookmark_CONST,mod_KaeL_WebEx_Util_jsonp]);var mod_KaeL_Commons_DOM_HTML_toSource=function(NODE_TYPE,xmlify,AGENT){var element2SRC=function element2SRC(e){if(e.outerHTML)return e.outerHTML;var attrs=e.attributes||[];var tagsrc=[e.tagName];for(var i=0,l=attrs.length;i<l;i++){var a=attrs[i];tagsrc.push(a.name+\'="\'+xmlify(""+a.value)+\'"\')}var ret=["<",tagsrc.join(" "),">"];ret.push(e.innerHTML);ret.push("</");ret.push(e.tagName);ret.push(">");return ret.join("")};switch(AGENT.NAME){case"ie":case"opera":element2SRC=function element2SRC(e){return e.outerHTML}}var node2SRC=function node2SRC(node){switch(node.nodeType){case NODE_TYPE.DOCUMENT_NODE:case NODE_TYPE.DOCUMENT_FRAGMENT_NODE:var buf=[];for(var c=node.firstChild;c;c=c.nextSibling){buf.push(node2SRC(c))}return buf.join("");case NODE_TYPE.COMMENT_NODE:return"\\x3c!--"+xmlify(node.data)+"--\\x3e";case NODE_TYPE.TEXT_NODE:return xmlify(node.data);case NODE_TYPE.ELEMENT_NODE:return element2SRC(node);default:return""}};return node2SRC}.apply($$pm({NAME:"KaeL.Commons.DOM.HTML.toSource"}),[mod_KaeL_Commons_DOM_NODE_TYPE,mod_KaeL_Commons_String_xmlify,mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_XPCOM_CHROME=function(AGENT){if(!AGENT.isXUL())return null;if(AGENT.isCfx())return require("chrome");try{var c=Components;var Cc=c.classes;var CC=function CC(){return c.constructor.apply(c,arguments)};var Ci=c.interfaces;var Cu=c.utils;var Cr=c.results;var Cm=c.manager;if(!Cc)return null}catch(e){return null}try{var cw=ChromeWorker}catch(e){cw=null}return Object.freeze({Cc:Cc,CC:CC,Ci:Ci,Cu:Cu,Cr:Cr,Cm:Cm,components:c,ChromeWorker:cw})}.apply($$pm({NAME:"KaeL.Commons.XPCOM.CHROME"}),[mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_Util_getStacktrace=function(AGENT){var stringBase=function stringBase(parseStackLine){return function(e_){var e=e_||new Error;var stack=e.stack.split(/[\\r\\n]+/).slice(2);var ret=[];for(var i=0,l=stack.length;i<l;i++){if(stack[i]=="")continue;var info=parseStackLine(stack[i]);if(info)ret.push(info)}ret.src=e.stack;return ret}};if(AGENT.isGecko()){return stringBase(function(line){var match=line.match(/^(?:([^@]+@))?(.*?):(\\d+)$/);return{calledAs:match[1],lineNumber:parseInt(match[3]),fileName:match[2],brief:line}})}if(AGENT.isNodeJS()||AGENT.isChrome()){return stringBase(function(line){var match=line.match(/^\\s*at\\s+(.+?)\\s+\\(([^:]*):(\\d*):\\d*\\)$/);if(!match){match=line.match(/([^:]*):(\\d*):\\d*\\)$/);if(match)return{calledAs:null,lineNumber:parseInt(match[2]),fileName:match[1],brief:line};return null}return{calledAs:match[1],lineNumber:parseInt(match[3]),fileName:match[2],brief:line}})}return function(){var ret=[];ret.src="";return ret}}.apply($$pm({NAME:"KaeL.Commons.Util.getStacktrace"}),[mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_Object_each=function(hasProp){return function(obj,fun,level){for(var f in obj){if(!hasProp(obj,f,level))continue;var ret=fun.apply(null,[f,obj[f]]);if(ret===false)break}}}.apply($$pm({NAME:"KaeL.Commons.Object.each"}),[mod_KaeL_Commons_Object_hasProp]);var mod_KaeL_Commons_Function_advicer_extract=function(ADVICERS){return function(src){var dst={};for(var f in ADVICERS){dst[f]=src[f]}return dst}}.apply($$pm({NAME:"KaeL.Commons.Function.advicer.extract"}),[mod_KaeL_Commons_Function_ADVICERS]);var mod_KaeL_Commons_String_indent=function(repeat){return function(str){var depth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var chr=arguments.length>2&&arguments[2]!==undefined?arguments[2]:" ";var indent=repeat(chr,depth);return str.replace(/^/gm,indent)}}.apply($$pm({NAME:"KaeL.Commons.String.indent"}),[mod_KaeL_Commons_String_repeat]);var mod_KaeL_Commons_String_pad=function(repeat){return function(src,len,fill){src=""+src;len=len||0;fill=""+(fill===0?"0":fill||" ");var srclen=src.length;var abslen=Math.abs(len);var filled=repeat(fill,Math.ceil(abslen/fill.length)).substring(0,abslen);if(srclen>abslen)return src;if(len<0){return src+filled.substring(srclen)}return filled.substring(0,abslen-srclen)+src}}.apply($$pm({NAME:"KaeL.Commons.String.pad"}),[mod_KaeL_Commons_String_repeat]);var mod_KaeL_Sns_hatena_star_add=function(window,withStar,jsonp){var JSONP_MAX_BYTES=1800;function exwrap(ex_){return function(n,Star){var document=n.ownerDocument;var typeError=new TypeError;var ex=void 0;if(ex_ instanceof Function){ex=ex_}else if(ex_ instanceof String||"string"==typeof ex_){ex=function ex(n,Star){return{uri:ex_}}}else{ex=function ex(n,Star){var R={};for(var f in ex_){var spec=ex_[f];if(spec instanceof Function){R[f]=spec(n,Star)}else if(spec instanceof String||"string"==typeof spec||spec instanceof window.Node){R[f]=spec}else{typeError.message="Malformed spec: "+f+" -> "+spec;throw typeError}}return R}}var R=ex(n,Star);if(!("entryNode"in R))R.entryNode=R;if(!("star_container"in R&&"comment_container"in R||"container"in R)){R.container=n}if("container"in R){var c=R.container;var cc=document.createElement("span");var sc=document.createElement("span");c.appendChild(cc);c.appendChild(sc);R.comment_container=cc;R.star_container=sc;delete R.container}if(!("title"in R))R.title=Star.EntryLoader.scrapeTitle(n);return R}}return function addStars(nodes_,ex_){withStar(function(Star,Hatena){var nodes=nodes_ instanceof window.Node?[nodes_]:nodes_||[];var entries=[];var ex=exwrap(ex_);var _iteratorNormalCompletion2=true;var _didIteratorError2=false;var _iteratorError2=undefined;try{for(var _iterator2=nodes[Symbol.iterator](),_step2;!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=true){var li=_step2.value;var earg=ex(li,Star,Hatena);var e=new Star.Entry(earg);e.showButtons();entries.push(e)}}catch(err){_didIteratorError2=true;_iteratorError2=err}finally{try{if(!_iteratorNormalCompletion2&&_iterator2.return){_iterator2.return()}}finally{if(_didIteratorError2){throw _iteratorError2}}}var receive=function receive(res){var entries_=res.entries;var encodedUriToEntryInfoMap={};if(!entries_)entries_=[];var _iteratorNormalCompletion3=true;var _didIteratorError3=false;var _iteratorError3=undefined;try{for(var _iterator3=entries_[Symbol.iterator](),_step3;!(_iteratorNormalCompletion3=(_step3=_iterator3.next()).done);_iteratorNormalCompletion3=true){var _entryInfo=_step3.value;if(!_entryInfo.uri)return;var eURI=_entryInfo.eURI;if(!eURI)eURI=_entryInfo.eURI=encodeURIComponent(_entryInfo.uri);encodedUriToEntryInfoMap[eURI]=_entryInfo}}catch(err){_didIteratorError3=true;_iteratorError3=err}finally{try{if(!_iteratorNormalCompletion3&&_iterator3.return){_iterator3.return()}}finally{if(_didIteratorError3){throw _iteratorError3}}}var _iteratorNormalCompletion4=true;var _didIteratorError4=false;var _iteratorError4=undefined;try{for(var _iterator4=entries[Symbol.iterator](),_step4;!(_iteratorNormalCompletion4=(_step4=_iterator4.next()).done);_iteratorNormalCompletion4=true){var e=_step4.value;if(e.hasBoundToStarEntry())return;if(!e.eURI)e.eURI=encodeURIComponent(e.uri);var entryInfo=entryInfo=encodedUriToEntryInfoMap[e.eURI];if(entryInfo)e.bindStarEntry(entryInfo);if(typeof e.can_comment=="undefined")e.setCanComment(res.can_comment);e.showStars();e.showCommentButton()}}catch(err){_didIteratorError4=true;_iteratorError4=err}finally{try{if(!_iteratorNormalCompletion4&&_iterator4.return){_iterator4.return()}}finally{if(_didIteratorError4){throw _iteratorError4}}}if(res.rks){if(!Hatena.Visitor||typeof Hatena.Visitor=="undefined"){Hatena.Visitor={}}if(!Hatena.Visitor.RKS){Hatena.Visitor.RKS=res.rks}}Hatena.Star.User.RKS.ready(res.rks)};(function(){if(!entries.length)return;var jsonpBase=Star.BaseURL.replace(/^http:/,Star.BaseURLProtocol)+"entries.json?";var url=jsonpBase;var _iteratorNormalCompletion5=true;var _didIteratorError5=false;var _iteratorError5=undefined;try{for(var _iterator5=entries[Symbol.iterator](),_step5;!(_iteratorNormalCompletion5=(_step5=_iterator5.next()).done);_iteratorNormalCompletion5=true){var entry=_step5.value;if(url.length>JSONP_MAX_BYTES){jsonp(url,{callback:receive});url=jsonpBase}url+="uri="+encodeURIComponent(entry.uri)+"&"}}catch(err){_didIteratorError5=true;_iteratorError5=err}finally{try{if(!_iteratorNormalCompletion5&&_iterator5.return){_iterator5.return()}}finally{if(_didIteratorError5){throw _iteratorError5}}}if(!Hatena.Visitor)url+="timestamp=1";jsonp(url,{callback:receive})})()})}}.apply($$pm({NAME:"KaeL.Sns.hatena.star.add"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_star_withStar,mod_KaeL_WebEx_Util_jsonp]);var mod_KaeL_Commons_XPCOM_PREFS=function(c){if(!c)return null;var pb=c.Cc["@mozilla.org/preferences-service;1"].getService(c.Ci.nsIPrefService).QueryInterface(c.Ci.nsIPrefBranch);return pb}.apply($$pm({NAME:"KaeL.Commons.XPCOM.PREFS"}),[mod_KaeL_Commons_XPCOM_CHROME]);var mod_KaeL_Commons_Object_deepClone=function(eachProperties,isFunc,array){var done=[];var result=[];var withRecursiveChecking=function withRecursiveChecking(obj,cloner){var index=array.indexOf.call(done,obj);if(index>-1){return result[index]}var R=cloner(obj);index=done.length;done[index]=obj;result[index]=R;return R};var deepClone_internal=function deepClone_internal(obj,objHandler){var deepClone=arguments.callee;switch(typeof obj==="undefined"?"undefined":_typeof(obj)){case"undefined":case"unknown":return undefined;case"number":return obj-0;case"string":return""+obj;case"function":return obj;case"object":if(obj===null)return null;return withRecursiveChecking(obj,function(obj){if(obj instanceof Array){var l=obj.length;var ret=new Array(l);for(var i=0;i<l;i++){ret[i]=deepClone(obj[i],objHandler)}return ret}else if(obj instanceof RegExp){var flags=[];if(obj.global)flags.push("g");if(obj.ignoreCase)flags.push("i");if(obj.multiline)flags.push("m");return new RegExp(obj.source,flags.join(""))}return objHandler(obj,function(obj){var ret={};eachProperties(obj,function(f,val){ret[f]=deepClone(val,objHandler)});return ret})});default:}return null};return function deepClone(obj,objHandler_){var objHandler=objHandler_||function(obj,simple){if(isFunc(obj.deepClone||false))return obj.deepClone();return simple(obj)};done=[];result=[];var R=deepClone_internal(obj,objHandler);done=[];result=[];return R}}.apply($$pm({NAME:"KaeL.Commons.Object.deepClone"}),[mod_KaeL_Commons_Object_each,mod_KaeL_Commons_Util_isFunc,mod_KaeL_Commons_Array_PROTOTYPE]);var mod_KaeL_Commons_Codec_JSON_jsonify_string=function(strpad){var escaped={};escaped[\'"\']=\'\\\\"\';escaped["\\\\"]="\\\\\\\\";escaped["/"]="\\\\/";escaped["\\b"]="\\\\b";escaped["\\f"]="\\\\f";escaped["\\n"]="\\\\n";escaped["\\r"]="\\\\r";escaped["\\t"]="\\\\t";var escapeChars=/[^\\u0020\\u0021\\u0023-\\u005B\\u005D-\\u007E]/g;var escape=function escape($a){return escaped[$a]||"\\\\u"+strpad(String($a).charCodeAt(0).toString(16),4,"0")};return function(src){return\'"\'+(""+src).replace(escapeChars,escape)+\'"\'}}.apply($$pm({NAME:"KaeL.Commons.Codec.JSON.jsonify.string"}),[mod_KaeL_Commons_String_pad]);var mod_KaeL_Commons_XPCOM_TIMER=function(c,PREFS){if(!c)return null;var Timer=c.CC("@mozilla.org/timer;1","nsITimer");var nsITimer=c.Ci.nsITimer;var TYPE_ONE_SHOT=nsITimer.TYPE_ONE_SHOT;var TYPE_REPEATING_SLACK=nsITimer.TYPE_REPEATING_SLACK;var MIN_DELAY=4;try{MIN_DELAY=PREFS.getIntPref("dom.min_timeout_value")}catch(e){}var Timers=[];var Free=[];function alloc(){if(Free.length>0)return Free.shift();return Timers.length}function free(num){Timers[num]=null;Free.push(num)}function allocTimer(cb,msec_,type){var id=alloc();var msec=msec_||0;var t=Timer();Timers[id]=t;t.initWithCallback({notify:cb},Math.max(msec,MIN_DELAY),type);return id}function freeTimer(id){var t=Timers[id];if(!t)return;t.cancel();free(id)}function setTimeout(cb,msec){var id=allocTimer(function(){freeTimer(id);cb()},msec||0,TYPE_ONE_SHOT);return id}function setInterval(cb,msec){return allocTimer(cb,msec||0,TYPE_REPEATING_SLACK)}return{setTimeout:setTimeout,clearTimeout:freeTimer,setInterval:setInterval,clearInterval:freeTimer}}.apply($$pm({NAME:"KaeL.Commons.XPCOM.TIMER"}),[mod_KaeL_Commons_XPCOM_CHROME,mod_KaeL_Commons_XPCOM_PREFS]);var mod_KaeL_Commons_Class_ROOTPROTO=function(_equals,gensym,eachProperties,_deepClone,_derive,isFunc){var slice=Array.prototype.slice;return{initialize:function initialize(){},toString:function toString(){return this.stringify()},stringify:function stringify(){var constructor=this.constructor;if(isFunc(constructor.getName)&&this.__ID__){return"["+constructor.getName()+" "+this.__ID__+"]"}return Object.prototype.toString.apply(this,[])},method:function method(name){var self=this;var bargs=[];if(arguments.length>1){var args=slice.apply(arguments,[1]);var lastArg=args.pop();var last=slice.apply(lastArg,[0]);bargs=args.concat(last)}return function(){self[name].apply(self,bargs.concat(slice.apply(arguments,[0])))}},hash:function hash(){return this.__ID__},equals:function equals(b){if(!(b instanceof this.constructor))return false;var success=true;eachProperties(this,function(p,val){if(p=="__ID__")return true;if(_equals(val,b[p]))return true;success=false;return false});return success},deepClone:function deepClone(){var klass=function klass(){};klass.prototype=this.constructor.prototype;var obj=new klass;eachProperties(this,function(name,val){obj[name]=_deepClone(val)});obj.__ID__=gensym();return obj},derive:function derive(){return _derive(this)}}}.apply($$pm({NAME:"KaeL.Commons.Class.ROOTPROTO"}),[mod_KaeL_Commons_Object_equals,mod_KaeL_Commons_Util_gensym,mod_KaeL_Commons_Object_each,mod_KaeL_Commons_Object_deepClone,mod_KaeL_Commons_Object_derive,mod_KaeL_Commons_Util_isFunc]);var mod_KaeL_Commons_Object_UTIL=function(mix,derive,each,deepClone,getPrototypeOf,map,keys,values,isSimpleObject){return{mix:mix,derive:derive,each:each,deepClone:deepClone,getPrototypeOf:getPrototypeOf,map:map,keys:keys,values:values,isSimple:isSimpleObject}}.apply($$pm({NAME:"KaeL.Commons.Object.UTIL"}),[mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Object_derive,mod_KaeL_Commons_Object_each,mod_KaeL_Commons_Object_deepClone,mod_KaeL_Commons_Object_getPrototypeOf,mod_KaeL_Commons_Object_map,mod_KaeL_Commons_Object_keys,mod_KaeL_Commons_Object_values,mod_KaeL_Commons_Util_isObject_simple]);var mod_KaeL_Commons_Codec_JSON_jsonify_indented=function(jsonifyString,indent){return function jsonify(obj){var depth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:2;var br=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\\n";var elem=null;switch(typeof obj==="undefined"?"undefined":_typeof(obj)){case"string":elem=jsonifyString(obj);break;case"number":case"boolean":elem=""+obj;break;case"object":if(obj==null){elem="null"}else if(obj instanceof Array){var buf=[];for(var i=obj.length;i-- >0;){buf[i]=jsonify(obj[i],depth,br)}elem="["+br+indent(buf.join(","+br),depth)+br+"]"}else{var _buf=[];for(var f in obj){_buf.push(jsonifyString(f,depth)+": "+jsonify(obj[f],depth,br))}elem="{"+br+indent(_buf.join(","+br),depth)+br+"}"}break;default:elem="null";break}return elem}}.apply($$pm({NAME:"KaeL.Commons.Codec.JSON.jsonify.indented"}),[mod_KaeL_Commons_Codec_JSON_jsonify_string,mod_KaeL_Commons_String_indent]);var mod_KaeL_Commons_Util_TIMER=function(GLOBAL,AGENT,xpcomTIMER){if(xpcomTIMER)return xpcomTIMER;var METHODS=["setTimeout","clearTimeout","setInterval","clearInterval"];var obj={};for(var i=0,l=METHODS.length;i<l;i++){(function(method){obj[method]=function(){return GLOBAL[method].apply(GLOBAL,arguments)}})(METHODS[i])}return obj}.apply($$pm({NAME:"KaeL.Commons.Util.TIMER"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Commons_Util_AGENT,mod_KaeL_Commons_XPCOM_TIMER]);var mod_KaeL_Commons_Class_LowLevel_gen=function(LLJAR,ROOTPROTO,derive,generateConstructor){return function(meta,protoInitializer){var constructor=generateConstructor();constructor.$$meta=meta;var proto=derive(ROOTPROTO,protoInitializer);constructor.prototype=proto;proto.constructor=constructor;LLJAR.register(constructor);return constructor}}.apply($$pm({NAME:"KaeL.Commons.Class.LowLevel.gen"}),[mod_KaeL_Commons_Class_LowLevel_JAR,mod_KaeL_Commons_Class_ROOTPROTO,mod_KaeL_Commons_Object_derive,mod_KaeL_Commons_Class_gen_constructor]);var mod_KaeL_Commons_Codec_JSON_jsonify=function(indentedJsonify){try{var stringify=JSON.stringify;return function(){return stringify.apply(JSON,arguments)}}catch(e){return function(obj){return indentedJsonify(obj,0,"")}}}.apply($$pm({NAME:"KaeL.Commons.Codec.JSON.jsonify"}),[mod_KaeL_Commons_Codec_JSON_jsonify_indented]);var mod_KaeL_DHTML_MutationObserver_classNameBase=function(TIMER,window,cnMatch){var setTimeout=TIMER.setTimeout;var modifier=function modifier(mod){return function(n){try{mod(n)}catch(e){window.console.error(e)}}};return function observeMutation(classnameActions){var container=arguments.length>1&&arguments[1]!==undefined?arguments[1]:window.document;var mods={};for(var cn in classnameActions){var mod=modifier(classnameActions[cn]);mods[cn]=mod;var _iteratorNormalCompletion6=true;var _didIteratorError6=false;var _iteratorError6=undefined;try{for(var _iterator6=container.querySelectorAll("."+cn)[Symbol.iterator](),_step6;!(_iteratorNormalCompletion6=(_step6=_iterator6.next()).done);_iteratorNormalCompletion6=true){var n=_step6.value;mod(n)}}catch(err){_didIteratorError6=true;_iteratorError6=err}finally{try{if(!_iteratorNormalCompletion6&&_iterator6.return){_iterator6.return()}}finally{if(_didIteratorError6){throw _iteratorError6}}}}var mo=new window.MutationObserver(function(ms){var _iteratorNormalCompletion7=true;var _didIteratorError7=false;var _iteratorError7=undefined;try{for(var _iterator7=ms[Symbol.iterator](),_step7;!(_iteratorNormalCompletion7=(_step7=_iterator7.next()).done);_iteratorNormalCompletion7=true){var m=_step7.value;switch(m.type){case"childList":{var _iteratorNormalCompletion8=true;var _didIteratorError8=false;var _iteratorError8=undefined;try{var _loop=function _loop(){var n=_step8.value;if(!n.tagName)return{v:void 0};var _loop2=function _loop2(_cn){var mod=mods[_cn];if(cnMatch(n,_cn))setTimeout(function(){mod(n)},100);var sel="."+_cn;var matched=n.querySelectorAll(sel);var _iteratorNormalCompletion9=true;var _didIteratorError9=false;var _iteratorError9=undefined;try{var _loop3=function _loop3(){var n=_step9.value;setTimeout(function(){mod(n)},100)};for(var _iterator9=matched[Symbol.iterator](),_step9;!(_iteratorNormalCompletion9=(_step9=_iterator9.next()).done);_iteratorNormalCompletion9=true){_loop3()}}catch(err){_didIteratorError9=true;_iteratorError9=err}finally{try{if(!_iteratorNormalCompletion9&&_iterator9.return){_iterator9.return()}}finally{if(_didIteratorError9){throw _iteratorError9}}}};for(var _cn in mods){_loop2(_cn)}};for(var _iterator8=m.addedNodes[Symbol.iterator](),_step8;!(_iteratorNormalCompletion8=(_step8=_iterator8.next()).done);_iteratorNormalCompletion8=true){var _ret=_loop();if((typeof _ret==="undefined"?"undefined":_typeof(_ret))==="object")return _ret.v}}catch(err){_didIteratorError8=true;_iteratorError8=err}finally{try{if(!_iteratorNormalCompletion8&&_iterator8.return){_iterator8.return()}}finally{if(_didIteratorError8){throw _iteratorError8}}}break}case"attributes":{var _ret4=function(){var n=m.target;switch(m.attributeName){case"class":{var _loop4=function _loop4(_cn2){if(!cnMatch(n,_cn2))return"continue";var mod=mods[_cn2];setTimeout(function(){mod(n)},100)};for(var _cn2 in mods){var _ret5=_loop4(_cn2);if(_ret5==="continue")continue}break}default:{break}}return"break"}();if(_ret4==="break")break}default:{break}}}}catch(err){_didIteratorError7=true;_iteratorError7=err}finally{try{if(!_iteratorNormalCompletion7&&_iterator7.return){_iterator7.return()}}finally{if(_didIteratorError7){throw _iteratorError7}}}});mo.observe(container,{subtree:true,childList:true,attributes:true,attributeFilter:["class"]})}}.apply($$pm({NAME:"KaeL.DHTML.MutationObserver.classNameBase"}),[mod_KaeL_Commons_Util_TIMER,mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_DHTML_Elem_hasClassName]);var mod_KaeL_Commons_Class_Manager=function(ROOTPROTO,LLJAR,genLL,gensym,derive){return genLL({name:"KaeL.Commons.Class.Manager",finalClass:true,has:{metaClass:{set:false,get:false},classes:{set:false,get:false}}},function(){this.initialize=function(metaClass){this.__classes={};this.__metaClass=metaClass;var kObjMeta=new metaClass({name:"KaeL.Commons.Object",manager:this,abstractClass:true,proto:ROOTPROTO});var KObject=kObjMeta.getConstructor();var lowlevels=LLJAR.classes;for(var i=0,l=lowlevels.length;i<l;i++){var llc=lowlevels[i];var meta=llc.$$meta;meta.constructorFunction=llc;KObject.subClass(meta,function(){})}};this.register=function(klass){var dic=this.__classes;var name=klass.getName();if(dic[name])throw new Error("class "+name+" is already exists.");dic[name]=klass};this.get=function(name){return this.__classes[name]||null}})}.apply($$pm({NAME:"KaeL.Commons.Class.Manager"}),[mod_KaeL_Commons_Class_ROOTPROTO,mod_KaeL_Commons_Class_LowLevel_JAR,mod_KaeL_Commons_Class_LowLevel_gen,mod_KaeL_Commons_Util_gensym,mod_KaeL_Commons_Object_derive]);var mod_KaeL_Commons_Util_toSource=function(AGENT,jsonify){if(AGENT.isGecko())return eval("uneval");return function(obj){switch(typeof obj==="undefined"?"undefined":_typeof(obj)){case"function":return obj.toString();case"string":case"number":case"boolean":return jsonify(obj);case"object":if(obj==null){return"null"}else if(obj instanceof Array){return"["+obj.map(arguments.callee).join(",")+"]"}else{var buf=[];for(var f in obj){buf.push(arguments.callee(f)+":"+arguments.callee(obj[f]))}return"{"+buf.join(",")+"}"}default:return""}}}.apply($$pm({NAME:"KaeL.Commons.Util.toSource"}),[mod_KaeL_Commons_Util_AGENT,mod_KaeL_Commons_Codec_JSON_jsonify]);var mod_KaeL_Commons_Codec_JSON=function(read,stringify){return{parse:read,stringify:stringify,able:function able(o){return read(stringify(o))}}}.apply($$pm({NAME:"KaeL.Commons.Codec.JSON"}),[mod_KaeL_Commons_Codec_JSON_read,mod_KaeL_Commons_Codec_JSON_jsonify]);var mod_KaeL_Commons_Function_advice=function(advicers,mix,uneval){var completeAinfo=function completeAinfo(func){func.adviceinfo.toString=function(){var ainfo=func.adviceinfo;var R=["#advicedFunction{"];for(var f in ainfo){if(f==="toString")continue;R.push(" "+f+": [");var slot=ainfo[f];for(var i=0,l=slot.length;i<l;i++){R.push(uneval(slot[i]).replace(/^/m," ").replace(/$/,","))}R[R.length-1]=R[R.length-1].replace(/,$/,"");R.push(" ],")}R[R.length-1]=" ]";R.push(" core: "+uneval(func));return R.concat(["}"]).join("\\n")}};return function(orig,opt_){var opt=opt_;if("function"===typeof opt)opt={around:opt};if(!orig)throw new TypeError;var func=orig;for(var type in advicers){var ainfo=mix(func.adviceinfo||{});var advice=opt[type]||null;(ainfo[type]||(ainfo[type]=[])).push(advice);if(!advice)continue;func=advicers[type](func,advice);func.adviceinfo=ainfo;completeAinfo(func)}return func}}.apply($$pm({NAME:"KaeL.Commons.Function.advice"}),[mod_KaeL_Commons_Function_ADVICERS,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Util_toSource]);var mod_KaeL_Commons_Object_toSummary=function(JSON){function toSummary_element(e){if(e instanceof Array)return"[Array]";if("object"===(typeof e==="undefined"?"undefined":_typeof(e)))return"[Object]";return toSummary(e)}function toSummary(o){var maxLength=arguments.length>1&&arguments[1]!==undefined?arguments[1]:60;switch(typeof o==="undefined"?"undefined":_typeof(o)){case"undefined":return"undefined";case"boolean":case"number":case"string":return JSON.stringify(o);case"function":return"[Function]"}if(o===null)return"null";if(o instanceof RegExp)return String(o);if(o instanceof Array){var _R="[";var _iteratorNormalCompletion10=true;var _didIteratorError10=false;var _iteratorError10=undefined;try{for(var _iterator10=o[Symbol.iterator](),_step10;!(_iteratorNormalCompletion10=(_step10=_iterator10.next()).done);_iteratorNormalCompletion10=true){var e=_step10.value;var estr=toSummary_element(e);if(_R.length+estr.length>maxLength-1){return _R+"...]"}_R+=estr+","}}catch(err){_didIteratorError10=true;_iteratorError10=err}finally{try{if(!_iteratorNormalCompletion10&&_iterator10.return){_iterator10.return()}}finally{if(_didIteratorError10){throw _iteratorError10}}}return _R.replace(/,$/,"]")}var R="{";for(var key in o){if(R.length+key.length>maxLength-2)return R+"...}";R+=key+":";var _estr=toSummary_element(o[key]);if(R.length+_estr.length>maxLength-2)return R+"...}";R+=_estr+","}return R.replace(/,$/,"}")}return toSummary}.apply($$pm({NAME:"KaeL.Commons.Object.toSummary"}),[mod_KaeL_Commons_Codec_JSON]);var mod_KaeL_Commons_Object_mix=function(advice,isFunc){var defaultFilter=function defaultFilter(a,b,name){var val=b[name];if(!isFunc(val))return null;return[name,function(){return b[name].apply(b,arguments)}]};var passThrough=function passThrough(a,b,name){var val=b[name];if(!isFunc(val))return null;return[name,b[name]]};var mix=function mix(a,b,filter){if(arguments.length>2){var orig=defaultFilter;var i=2;if(isFunc(filter)){i++;orig=filter}else{if(filter instanceof RegExp){filter={regexp:filter}}if("object"==(typeof filter==="undefined"?"undefined":_typeof(filter))){i++;var opt=filter;if("delegateTo"in opt){var field=opt.delegateTo;orig=function orig(A,B,f){if(!isFunc(B[f]))return null;return[f,function $mix$delegating(){var dObj=this[field];if(!dObj){throw new Error(field+" was not defined.")}var meth=dObj[f];if(!isFunc(meth)){throw new Error(field+"."+f+" is not function.")}return meth.apply(dObj,arguments)}]}}else if(isFunc(opt.filteringMethod||null)){orig=opt.filteringMethod}else{switch(opt.filteringMethod||null){case"passThrough":orig=passThrough;break}}if(filter.regexp||null){var regexp=filter.regexp;if(!(regexp instanceof Array))regexp=[regexp];var regslen=regexp.length;orig=advice(orig,function(base,a,b,f){var ret=base(a,b,f);if(!ret)return null;for(var i=0;i<regslen;i++){if(!regexp[i].test(f))return null}return ret})}if(isFunc(opt["methodName"]||null)){var mn=opt["methodName"];orig=advice(orig,function(base,a,b,f){var ret=base(a,b,f);if(!ret||!mn(f))return null;return ret})}}}var skip=true;var attrs={};for(var l=arguments.length;i<l;i++){skip=false;attrs[arguments[i]]=true}filter=function filter(a,b,f){if(!skip&&!attrs[f])return null;return orig(a,b,f)}}else{filter=defaultFilter}for(var f in b){var filtered=filter(a,b,f);if(!filtered)continue;var name,val;if(filtered instanceof Array){name=filtered[0];val=filtered[1]}else if("string"==typeof filtered){name=filtered;val=b[f]}else{name=f;val=b[f]}a[name]=val}return a};mix.defaultFilter=defaultFilter;mix.OVERWRITE_ALL=function(){return true};return mix}.apply($$pm({NAME:"KaeL.Commons.Object.mix"}),[mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Util_isFunc]);var mod_KaeL_Commons_Class_Meta_Method=function(llgen,isObject,advice,duck,ou,array){var Method=llgen({name:this.getName(),finalClass:true,has:{meta:{initArg:"meta",set:false,get:"getMeta"},proto:{initArg:"proto",set:false,get:"getPrototype"},abstractMethod:{initArg:"abstractMethod",set:false,get:"isAbstract"},name:{initArg:"name",set:false,get:"getName"},body:{initArg:"body",set:false,get:"getBody"},modifiers:{initArg:"modifiers",set:false,get:"getModifiers"}}},function(){this.initialize=function(opt_){var self=this;var opt=opt_;if(arguments.length>1){var oopt=arguments[1];if("function"===typeof oopt){opt.body=oopt}else if(oopt instanceof Array){oopt=oopt.slice(0);opt.body=oopt.pop();opt.modifiers=oopt}else{opt=ou.mix(opt,oopt)}}var meta=opt.meta;self.__meta=meta;self.__proto=opt.proto;self.__name=opt.name;self.__abstractMethod=!!(opt.abstractMethod||false);self.__body=opt.body;var modifiers=(opt.modifiers||[]).slice(0);var moddict={};for(var i=0,l=modifiers.length;i<l;i++){var mod=modifiers[i];duck(mod,"applyMethodModifier");mod.register(self)}self.__moddict=moddict;self.__compiled=false};this.getMeta=function(){return this.__meta};this.getName=function(){return this.__name};this.getBody=function(){return this.__body};this.getModifiers=function(){return ou.values(this.__moddict)};this.getModifier=function(name){if(name.getName)name=name.getName();return this.__moddict[name]||null};this.isAbstract=function(){return this.__abstractMethod};this.forEachModifiers=function(fun){array.forEach.call(this.getModifiers(),fun)};this.getFullName=function(){return this.getMeta().getName()+"#"+this.getName()};this.getCompiled=function(){var self=this;if(self.__compiled===false){var src=self.getBody();var proc=src;self.forEachModifiers(function(mod){proc=mod.applyMethodModifier(self,proc)});self.__compiled=proc}return self.__compiled}});return Method}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Method"}),[mod_KaeL_Commons_Class_LowLevel_gen,mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Type_duck,mod_KaeL_Commons_Object_UTIL,mod_KaeL_Commons_Array_PROTOTYPE]);var mod_KaeL_Commons_Function_advicer_merge=function(advice,prepareInput,ADVICERS,mix){var prepare=function prepare(src){return mix("function"==typeof src?{around:src}:src)};return function mergeAdvice(base_,mod_){var dst=prepare(base_);var mod=prepare(mod_);for(var f in ADVICERS){var src=dst[f]||null;var m=mod[f]||null;if(!m)continue;if("function"===typeof m){dst[f]=m;continue}if(!src){if(f==="input"){dst[f]=m;continue}throw new Error(\'Source advicer does not have "\'+f+\'".\')}if(f==="input")src=prepareInput(src);dst[f]=advice(src,m)}return dst}}.apply($$pm({NAME:"KaeL.Commons.Function.advicer.merge"}),[mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Function_advicer_prepare_input,mod_KaeL_Commons_Function_ADVICERS,mod_KaeL_Commons_Object_mix_simple]);var mod_KaeL_Commons_Array_Prototype_filtered=function(src,advice){var map=src.map;return function(opt_){var opt=opt_||{filter:function filter(x){return x}};if("function"===typeof opt)opt={filter:opt};var filter=opt.filter;var name=opt.name||"the array";var minOccurs=opt.minOccurs||0;var maxOccurs="maxOccurs"in opt?opt.maxOccurs:null;var dst={};var afilter=function afilter(a){return map.apply(a,[filter])};var adviceInfo={concat:{input:function input(){return map.apply(arguments,[function(o){return(o instanceof Array?afilter:filter)(o)}])}},shift:{before:function before(){if(minOccurs<1)return;if(this.length==minOccurs)throw new Error(name+" needs "+minOccurs+" elements")}},pop:{before:function before(){if(minOccurs<1)return;if(this.length==minOccurs)throw new Error(name+" needs "+minOccurs+" elements")}},push:{before:function before(){if(maxOccurs===null)return;if(arguments.length+this.length>maxOccurs)throw new Error("max length of "+name+" is "+maxOccurs+".")},input:function input(){return map.apply(arguments,[filter])}},unshift:{before:function before(){if(maxOccurs===null)return;if(arguments.length+this.length>maxOccurs)throw new Error("max length of "+name+" is "+maxOccurs+".")},input:function input(){return map.apply(arguments,[filter])}},splice:{before:function before(index,howMany){var inc=arguments.length-2;inc-=Math.min(howMany,this.length-index);if(inc<0){if(minOccurs<1)return;if(this.length+inc<minOccurs)throw new Error(name+" needs "+minOccurs+" elements")}else{if(maxOccurs===null)return;if(this.length+inc>maxOccurs)throw new Error("max length of "+name+" is "+maxOccurs+".")}},input:function input(index,howMany){if(arguments.length<3)return arguments;return src.concat.apply(src.slice.apply(arguments,[0,2]),[map.apply(src.slice.apply(arguments,[2]),filter)])}}};for(var f in src){dst[f]=advice(src[f],adviceInfo[f]||{})}return dst}}.apply($$pm({NAME:"KaeL.Commons.Array.Prototype.filtered"}),[mod_KaeL_Commons_Array_PROTOTYPE,mod_KaeL_Commons_Function_advice]);var mod_KaeL_Commons_Util_isaValidator=function(TYPES,toSummary){var printClass=function printClass(f){if(f===null)return"Object(null)";if(f===Object)return"Object";if(f===Array)return"Array";if(f===RegExp)return"RegExp";if(f.getName)return f.getName();return String(f)};var printObject=function printObject(v){if(v===null)return"null";var cls="object"===(typeof v==="undefined"?"undefined":_typeof(v))?" "+printClass(v.constructor):"";return"["+(typeof v==="undefined"?"undefined":_typeof(v))+cls+" "+toSummary(v)+"]"};return function(isa,name_){var name=name_?name_+":":"";if(!isa)return function(){};if(isa instanceof String||typeof isa==="string"){if(isa in TYPES)return function isaValidator$typeofValidator(v){if(isa===(typeof v==="undefined"?"undefined":_typeof(v)))return;throw new TypeError(name+"Illegal type : (required "+isa+") but (received"+printObject(v)+")")}}if(!(isa instanceof Function))throw new Error("First argument should be a function or valid type-name. (received:"+printClass(isa)+")");var typeName=null;var found=false;for(typeName in TYPES){if(TYPES[typeName]!==isa)continue;found=true;break}if(found){return function isaValidator$typeofAndInstanceofValidator(v){if(typeName===(typeof v==="undefined"?"undefined":_typeof(v)))return;if(v instanceof isa)return;throw new TypeError(name+"illegal type : (required "+typeName+") but (received "+printObject(v)+")")}}return function isaValidator$insctanceofValidator(v){if(v instanceof isa)return;throw new TypeError(name+"illegal type : (required "+printClass(isa)+") but (received "+printObject(v)+")")}}}.apply($$pm({NAME:"KaeL.Commons.Util.isaValidator"}),[mod_KaeL_Commons_Util_TYPES,mod_KaeL_Commons_Object_toSummary]);var mod_KaeL_Commons_Type_Constraint=function(llgen,duckTyping,rawIsaValidator,mix){var TypeConstraint;var RootConstraint=null;var isaValidator=function isaValidator(isa){if(isa instanceof Array){var enumdict={};for(var i=0,l=isa.length;i<l;i++){enumdict[isa[i]]=true}return function(v){if("string"!=typeof v)throw new TypeError("The object should be a string.");if(enumdict[v]||false)return;throw new Error("Specified string is invalid: (valid values: "+isa.join(", ")+")")}}return rawIsaValidator(isa)};var duckValidator=function duckValidator(args){return function(v){duckTyping.apply(null,[v].concat(args))}};TypeConstraint=llgen({name:this.getName(),has:{base:{lazy:false,set:false,get:"getBase"},isa:{lazy:false,set:false,get:"getIsa"},maybe:{lazy:false,set:false,get:"isMaybe"},does:{lazy:false,set:false,get:"getDoes"},duck:{lazy:false,set:false,get:"getDuck"},specifiedValidator:{initArg:"validate",lazy:false,set:false,get:"getSpecifiedValidator"},compiledValidator:{initArg:null,set:false,get:false},validators:{initArg:null,set:false,get:false}}},function(){this.constructor=TypeConstraint;this.initialize=function(opt_){var opt=opt_||{};this.__base=opt.base||RootConstraint;this.__maybe=!!("maybe"in opt?opt.maybe:true);this.__isa=[];var isa=opt.isa||null;if(isa){if(!(isa instanceof Array))isa=[isa];this.__isa=isa}var enumopt=opt.Enum||null;if(enumopt){if(!(enumopt instanceof Array))throw new Error("The \'Enum\' option should be specified as an array.");this.__isa.push(enumopt)}var does=opt.does||null;if(does){if(!(does instanceof Array))does=[does];for(var i=0,l=does.length;i<l;i++){duckTyping(does[i],"getName","isApplication")}}this.__does=does;var duck=opt.duck||null;if(duck&&!(duck instanceof Array))throw new Error("The \'duck\' option should be specified as an array.");this.__duck=duck;this.__speciviedValidator=null;var validate=opt.validate;if(validate){this.__specifiedValidator=validate}this.__compiledValidator=null;this.__validators={}};this.isRoot=function(){return this.__base===null};this.getBase=function(){return this.__base};this.isMaybe=function(){return this.__maybe};this.getIsa=function(){return this.__isa};this.getDoes=function(){return this.__does};this.getDuck=function(){return this.__duck};this.getSpecifiedValidator=function(){return this.__speciviedValidator};this.getPrimaryType=function(){var self=this;var isa=self.getIsa();if(isa.length>=1)return isa[0];return null};this.sub=function(opt){var self=this;var subopt=mix(opt,{base:this});if("boolean"!==typeof subopt.maybe)subopt.maybe=self.isMaybe();return new this.constructor(subopt)};this.getCompiledValidator=function(){var self=this;if(!self.__compiledValidator){var i,l;var validators=[];var base=self.getBase();if(base)validators.push(base.getCompiledValidator());var isa=self.__isa;var isaValidators=[];for(i=0,l=isa.length;i<l;i++){isaValidators.push(isaValidator(isa[i]))}validators.push(function(v){var errors=[];var i,l;for(i=0,l=isaValidators.length;i<l;i++){try{isaValidators[i](v);return}catch(e){errors.push(e)}}if(errors.length<1)return;var messages=[];for(i=0,l=errors.length;i<l;i++){messages.push(errors[i].message)}throw new Error(messages.join("\\n"))});var does=self.__does;if(does){for(i=0,l=does.length;i<l;i++){(function(does){validators.push(function(v){if(!does.isApplication(v))throw new Error("The object is not a "+does.getName()+" application.")})})(does[i])}}var duck=self.__duck;if(duck)validators.push(duckValidator(duck));var spValid=self.__speciviedValidator;if(spValid)validators.push(spValid);var maybe=this.isMaybe();self.__compiledValidator=function typeConstraint$compiledValidator(v){if(v===null){if(maybe)return;throw new Error("The object is null.")}for(var i=0,l=validators.length;i<l;i++){validators[i](v)}}}return self.__compiledValidator};this.getValidator=function(name){var self=this;var prefix=name||false?name+": ":"";var compiledValidator=self.getCompiledValidator();return function(v){try{compiledValidator(v)}catch(e){throw new Error(prefix+e.message)}}};this.getPredicate=function(){var self=this;var compiledValidator=self.getCompiledValidator();return function(v){try{compiledValidator(v);return true}catch(e){}return false}};this.getDefaultFilter=function(name){var isa=this.__isa;var validate=this.getValidator(name||null);var base=this.getBase();return function(_v){try{validate(_v);return _v}catch(e){var v;for(var i=0,l=isa.length;i<l;i++){if("function"!=typeof isa[i])continue;v=isa[i](_v);break}try{validate(v)}catch(e){if(!base)throw e;return base.getDefaultFilter(v)}}return v}};this.test=function(v){return this.getPredicate()(v)};this.validate=function(v,name){this.getValidator(name)(v)}});RootConstraint=new TypeConstraint;TypeConstraint.root=RootConstraint;return TypeConstraint}.apply($$pm({NAME:"KaeL.Commons.Type.Constraint"}),[mod_KaeL_Commons_Class_LowLevel_gen,mod_KaeL_Commons_Type_duck,mod_KaeL_Commons_Util_isaValidator,mod_KaeL_Commons_Object_mix_simple]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_type=function(TypeConstraint,prepareIsa){return function(spec,$self_){var $self=$self_||null;var Type=spec.Type||null;var isa=prepareIsa(spec,$self);var does=spec.does||null;var duck=spec.duck||null;var validate=spec.validate||null;var maybe="maybe"in spec?spec.maybe:true;var typeSpec={isa:isa,does:does,duck:duck,maybe:maybe,validate:validate};if($self){if(isa||does||duck||validate||"maybe"in spec){var R=Type?Type.sub(typeSpec):new TypeConstraint(typeSpec);return R}else{return TypeConstraint.root}}else{var pspec={};pspec.Type=Type;pspec.isa=isa;pspec.does=does;pspec.duck=duck;pspec.maybe=maybe;pspec.validate=validate;return pspec}}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.prepare.type"}),[mod_KaeL_Commons_Type_Constraint,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_isa]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare=function(TYPES,isObject,isSimpleObject,ucfirst,mix,prepareType,prepareSpecialForm,prepareContainerSpec){var prepare_setter=function prepare_setter(field,spec,pspec){var exportsSetter=true;var hideSetter=false;var setDef="set"in spec?spec.set:{};if(setDef===false){setDef={hide:true}}else if(setDef===true){setDef={hide:false}}else if("string"===typeof setDef){setDef={pseudo:true,name:setDef}}else if(!isSimpleObject(setDef)){throw new TypeError(String(setDef))}if(!("hide"in setDef))setDef.hide=false;if(!("pseudo"in setDef))setDef.pseudo=false;if(!("name"in setDef)){if("setterName"in spec){setDef.name=spec.setterName}else{setDef.name=(setDef.hide?"$":"")+"set"+ucfirst(field)}}pspec.set=setDef};var prepare_initializer=function prepare_initializer(field,spec,pspec){var initializer=function initializer(){return null};if("init"in spec){initializer=spec.init;if("function"!==typeof initializer){if(initializer instanceof Array){initializer=function(initValue){return function(){return initValue.slice(0)}}(initializer)}else{initializer=function(initValue){return function(){return initValue}}(initializer)}}}pspec.init=initializer};var prepare_initAction=function prepare_initAction(field,spec,pspec){var pseudo=pspec.pseudo;var initAction=spec.initAction||null;var initArg=initAction?null:!pseudo&&"initArg"in spec?spec.initArg:field;pspec.initArg=initArg;pspec.initAction=initAction||initArg&&true;pspec.required=!!(spec.required||false)};var prepare_getter=function prepare_getter(field,spec,pspec){var getDef="get"in spec?spec.get:{};if(getDef===true)getDef={};else if(getDef===false)getDef={hide:true};else if("string"===typeof getDef)getDef={pseudo:true,name:getDef};if(!isSimpleObject(getDef))throw new TypeError;var output=pspec.output=spec.output||null;getDef=mix(getDef);if(!("hide"in getDef))getDef.hide=false;if(!("pseudo"in getDef))getDef.pseudo=false;var getterName=getDef.name||spec.getterName||null;if(!getterName){var isa=null;if("isa"in pspec){isa=pspec.isa?pspec.isa[0]:null}else{var tc=pspec.Type;isa=tc?tc.getPrimaryType():null}var prefix=Boolean===isa?"is":"get";getterName=(getDef.hide?"$":"")+prefix+ucfirst(field)}getDef.privateName=output?"$"+getterName:null;getDef.name=getterName;pspec.get=getDef};return function prepare(attr_,spec_){var attr=attr_;var spec=prepareSpecialForm(spec_,attr);var $self=null;var field=attr;if("string"!=typeof attr){field=attr.getName();$self=attr.getMeta().getConstructor()}var pspec={completed:!!$self};var ts=prepareType(spec,$self);if(ts&&"Type"in ts){pspec=mix(pspec,ts)}else{pspec.Type=ts}pspec.filter=spec.filter||function(v){return v};var predicate=spec.predicate||null;if(predicate===true)predicate="has"+ucfirst(field);pspec.predicate=predicate;var clearer=spec.clearer||null;if(clearer===true)clearer="clear"+ucfirst(field);pspec.clearer=clearer;var lazy="lazy"in spec?spec.lazy:true;pspec.lazy=lazy;prepareContainerSpec(spec.container||null,pspec);var set=spec.set||{};var get=spec.get||{};pspec.pseudo="string"==typeof set||set&&!!(set.pseudo||false)||"string"==typeof get||get&&!!(get.pseudo||false);prepare_setter(field,spec,pspec);prepare_initializer(field,spec,pspec);prepare_initAction(field,spec,pspec);prepare_getter(field,spec,pspec);var handles=spec.handles||{};if(handles instanceof Array){var newHandles={};for(var i=0,l=handles.length;i<l;i++){newHandles[handles[i]]={}}handles=newHandles}if(!isSimpleObject(handles))throw new TypeError;pspec.handles=handles;pspec.methods=mix(spec.methods||{});pspec.property=!("property"in spec&&spec.property===false);return pspec}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.prepare"}),[mod_KaeL_Commons_Util_TYPES,mod_KaeL_Commons_Util_isObject,mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_String_ucfirst,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_type,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_specialForm,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_container]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_inherit=function(prepare,prepareSpecialForm,advice,extractAdvice,mergeAdvice,mix,isObject){return function inheritSpec(attr,base,spec_){var result=mix(prepareSpecialForm(base,attr));var spec=mix(spec_);delete result.methods;delete result.handles;var nop=function nop(){};var ovrOrAdv=function ovrOrAdv(name){var v=spec[name];if(isObject(v)){result[name]=advice(spec[name],v)}else{result[name]=v}};for(var f in spec){(({setterName:nop,getterName:nop,set:nop,get:nop,init:ovrOrAdv,filter:ovrOrAdv})[f]||function(f){result[f]=spec[f]})(f)}if("setterName"in spec){if(!(spec.set||null))spec.set={};if("string"==typeof spec.set)new TypeError;spec.set=mix(spec.set);spec.set.name=spec.setterName;delete spec.setterName}if("getterName"in spec){if(!(spec.get||null))spec.get={};if("string"==typeof spec.get)new TypeError;spec.get=mix(spec.get);spec.get.name=spec.getterName;delete spec.getterName}var mergeAccessor=function mergeAccessor(prop){var ac=spec[prop];if("string"==typeof ac)ac={pseudo:true,name:ac};result[prop]=mix(result[prop]||{},ac,extractAdvice(mergeAdvice(result[prop]||null,ac)))};mergeAccessor("set");mergeAccessor("get");var R=prepare(attr,result);return R}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.inherit"}),[mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_specialForm,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Function_advicer_extract,mod_KaeL_Commons_Function_advicer_merge,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Util_isObject_simple]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_delegatify=function(prepareAttributeSpec,prepareContainerSpec){return function(name,src,containerSrc){var dspec=prepareAttributeSpec(name,src);var cspec=prepareContainerSpec(containerSrc);var getContainer=cspec.get;cspec.setter=dspec.set.name;cspec.getter=dspec.get.name;cspec.predicate=dspec.predicate;cspec.clearer=dspec.clearer;dspec.container=cspec;dspec.initArg=null;dspec.initAction=null;var methods={};var hsrc=dspec.handles;var f;for(f in hsrc){(function(f){var hspec=hsrc[f];var as=hspec.as||f;methods[as]=function(){var c=getContainer.call(this);return c[as].apply(c,arguments)}})(f)}var msrc=dspec.methods;for(f in msrc){(function(f){methods[f]=function(){var c=getContainer.call(this.context);return c[f].apply(c,arguments)}})(f)}delete dspec.handles;dspec.methods=methods;delete dspec.isa;delete dspec.does;delete dspec.duck;delete dspec.maybe;delete dspec.initAction;delete dspec.init;delete dspec.required;delete dspec.filter;delete dspec.validate;delete dspec.init;delete dspec.lazy;return dspec}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.delegatify"}),[mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_container]);var mod_KaeL_Commons_Class_Meta_Attribute_spec_roleExported=function(prepare,mix,isObject){return function(name,spec_,role){var spec=mix(spec_);var i,l;if("does"in spec){var does=spec.does;if(!(does instanceof Array))does=[does];for(i=0,l=does.length;i<l;i++){if(does[i]==="$self")does[i]=role}spec.does=does}spec=prepare(name,spec_);if(spec.initAction===true)delete spec.initAction;var propname=role.getPropName();var bindFeature=function bindFeature(orig,name){return function(){var feature=this[propname]||null;if(!feature)throw new Error("illegal state: "+name+" < "+role.getName());return orig.apply(feature,arguments)}};var adviceAdvicer=function adviceAdvicer(src){var dst={};for(var f in src){var e=src[f];dst[f]="function"===typeof e?bindFeature(e,"advice:"+f):e}return dst};var props=["initAction","filter","init","validator"];for(i=0,l=props.length;i<l;i++){var p=props[i];if("function"==typeof spec[p])spec[p]=bindFeature(spec[p],p)}if(isObject(spec.set||null))spec.set=adviceAdvicer(spec.set);if(isObject(spec.get||null))spec.get=adviceAdvicer(spec.get);if(spec.handles||null){var xhandles={};var handles=spec.handles;for(var h in handles){var hinfo=handles[h];xhandles[h]=adviceAdvicer(hinfo)}spec.handles=xhandles}if(spec.methods||null){var xmethods={};var methods=spec.methods;var updateMethod=function updateMethod(orig){return function(){var newthis=mix(this);newthis.context=this.context[propname];newthis.owner=this.context;return orig.apply(newthis,arguments)}};for(var m in methods){xmethods[m]=updateMethod(methods[m])}spec.methods=xmethods}spec.origin=role;return spec}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute.spec.roleExported"}),[mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Util_isObject_simple]);var mod_KaeL_Commons_Class_Meta_Attribute=function(llgen,isObject,advice,mix,prepareSpec,inheritSpec,prepareIsa,duck){var Attribute=llgen({name:this.getName(),finalClass:true,has:{inherited:{initArg:"inherit",set:false,get:"isInherited"},meta:{initArg:"meta",set:false,get:"getMeta"},proto:{initArg:"proto",set:false,get:"getPrototype"},name:{initArg:"name",set:false,get:"getName"},spec:{initArg:"spec",set:false,get:"getSpec"},typeConstraint:{initArg:null,set:false,get:"getTypeConstraint"},pspec:{initArg:null,set:false,get:"getPreparedSpec"},pseudo:{isa:Boolean,initArg:null,set:false,get:"isPseudo"},lazy:{isa:Boolean,initArg:null,set:false,get:"isLazy"}}},function(){this.constructor=Attribute;this.initialize=function(opt){var self=this;self.__meta=opt.meta;self.__proto=opt.proto;self.__name=opt.name;self.__origin=opt.origin||self.__meta;self.__isa=false;self.__typeConstraint=null;self.__filter=null;self.__validator=null;self.__initflag=null;self.__privateGetter=false;self.__getter=false;self.__setter=false;self.__predicate=false;self.__clearer=false;self.__initAction=false;self.__handlers=false;self.__methods=false;self.__modifiers=false;var spec=opt.spec;self.__spec=spec;self.__inherited=spec.inherit||false;var pspec;if(self.__inherited){var superSpec=self.getSuperAttributeSpec();var myspec=mix(self.__spec);if(myspec.isa||null)myspec.isa=prepareIsa(myspec.isa,self);pspec=inheritSpec(self,superSpec,myspec)}else{pspec=prepareSpec(self,self.__spec)}var modifiers={};var modsrc=spec.modifiers||[];for(var i=0,l=modsrc.length;i<l;i++){var mod=modsrc[i];duck(mod,"applyAttributeModifier");modifiers[mod.constructor.getName()]=mod;pspec=mod.applyAttributeModifier(self,pspec)}self.__modifiers=modifiers;self.__pspec=pspec;self._initRaw()};this.getName=function(){return this.__name};this.getMeta=function(){return this.__meta};this.getPrototype=function(){return this.__proto};this.isInherited=function(){return this.__inherited};this.getSpec=function(){return this.__spec};this.getPreparedSpec=function(){return this.__pspec};this.getSetterName=function(){return this.__pspec.set.name||null};this.exportsSetter=function(){return!this.__pspec.set.pseudo};this.isSetterHidden=function(){return this.__pspec.hideSetter||false};this.getOrigin=function(){return this.__origin};this.isLazy=function(){return this.__pspec.lazy||false};this.getSuperAttributeSpec=function(){var self=this;var ras=self.getRoleAttributeSpec();if(ras)return ras;var superAttr=self.getSuperAttribute();return superAttr?superAttr.getSpec():null};this.getRoleAttributeSpec=function(){var roles=this.__meta.getRoles();var name=this.getName();var origin=this.getOrigin();for(var i=0,l=roles.length;i<l;i++){var role=roles[i];if(role===origin)continue;var ret=role.getHas()[name]||null;if(ret)return ret}return null};this.getSuperAttribute=function(){var superMeta=this.__meta.getSuperMeta();if(!superMeta)return null;return superMeta.getAttribute(this.getName(),true)};this.isPropertyDefiner=function(){return this.__pspec.property};this.getFullName=function(){return this.__meta.getName()+"@"+this.getName()};this.getTypeConstraint=function(){return this.__pspec.Type};this.getIsa=function(){return this.getTypeConstraint().getIsa()};this.getDoes=function(){return this.getTypeConstraint().getDoes()};this.getDuck=function(){return this.getTypeConstraint().getDuck()};this.isMaybe=function(){return this.getTypeConstraint().isMaybe()};this.getSpecifiedValidator=function(){return this.getTypeConstraint().getSpecifiedValidator()};this.getFilter=function(){var self=this;if(!self.__filter){var filter=this.__pspec.filter;if(filter===true){var tc=this.getTypeConstraint();filter=tc.getDefaultFilter()}self.__filter=filter}return self.__filter};this.getValidator=function(){var self=this;if(!self.__validator){var tc=self.getTypeConstraint();var validator=tc.getValidator(self.getFullName());self.__validator=validator}return self.__validator};this.getSetter=function(){var self=this;if(self.__setter===false){var pspec=self.__pspec;var setDef=pspec.set;if(setDef.pseudo){var setterName=setDef.name;self.__setter=setterName?function(v){return this[setterName](v)}:null}else{var initFlag=this.getInitFlag();var rawSetter=this.getRawSetter();var validate=this.getValidator();var filter=this.getFilter();var setter=advice(function $setter(v_){var v=filter.call(this,v_);validate.apply(this,[v]);rawSetter.apply(this,[v]);this[initFlag]=true;return this},setDef);self.__setter=setter}}return self.__setter};this.getInitArg=function(){return this.__pspec.initArg};this.isRequired=function(){return this.__pspec.required};this.getInitAction=function(){var self=this;if(self.__initAction===false){var pspec=self.__pspec;var initAction=null;if(self.isPseudo()||self.isDelegated()){initAction=function initAction(){}}else{var sInitAction=pspec.initAction;var lazy=self.isLazy();var setter=self.getSetterName();var initializer=self.getInitializer();if(!sInitAction){if(lazy){initAction=function $initAction(){}}else{initAction=function $initAction(){this[setter](initializer.call(this))}}}else if(sInitAction===true){var initArg=self.getInitArg();initAction=function $initAction(opt_){var opt=opt_||{};if(isObject(opt)&&initArg in opt){this[setter](opt[initArg])}else if(!lazy){this[setter](initializer.call(this))}};var required=self.isRequired()||false;if(required)initAction=advice(initAction,{before:function before(opt){if(initArg in opt)return;throw new Error(\'"\'+initArg+\'" is required.\')}})}else{initAction=function $initAction(opt){var result=sInitAction.apply(this,[opt]);if(result!==undefined)this[setter](result)}}}self.__initAction=initAction}return self.__initAction};this.getRawGetter=function(){return this.__rawGetter};this.getOutputFilter=function(){return this.__pspec.output||null};this.getGetterName=function(){return this.__pspec.get.name||null};this.getPrivateGetterName=function(){return this.__pspec.get.privateName};this.exportsGetter=function(){return!this.__pspec.get.pseudo};this.isGetterHidden=function(){return this.__pspec.hideGetter||false};this.getPrivateGetter=function(){var self=this;if(self.__privateGetter===false){var pspec=self.__pspec;var pseudo=self.isPseudo();var delegated=self.isDelegated();var initFlag=self.getInitFlag();var setter=self.getSetter();var rawGetter=self.getRawGetter();var initializer=self.getInitializer();var getter=null;if(delegated){getter=rawGetter}else if(!pseudo){getter=function $getter(){if(!(this[initFlag]||false)){var initVal=initializer.call(this);setter.call(this,initVal)}return rawGetter.apply(this,arguments)}}if(getter)getter=advice(getter,pspec.get);self.__privateGetter=getter}return self.__privateGetter},this.getGetter=function(){var self=this;if(self.__getter===false){var output=self.getOutputFilter();var privateGetter=self.getPrivateGetter();var getter=output?advice(privateGetter,{output:output}):privateGetter;self.__getter=getter}return self.__getter};this.getHandlers=function(){var self=this;if(self.__handlers===false){var pspec=self.__pspec;var handles=pspec.handles;var getterName=self.getGetterName();var pgetterName=self.getPrivateGetterName();var setterName=self.getSetterName();var predicate=self.getPredicate();var clearer=self.getClearer();var exports={};for(var f in handles){(function(f){var hspec=handles[f];if(false===hspec)return;if("function"===typeof hspec)hspec={around:hspec};if(!isObject(hspec))hspec={};var as=hspec.as||f;var fullName=self.getFullName();var methodName=fullName+"#"+as;var aspec={};for(var ff in hspec){var ainfo=hspec[ff];if("function"===typeof ainfo){ainfo=function(orig){return function(){var _this=this;var self=this;var prop=self[getterName]();var thisArg={context:self,get:function get(){return _this[getterName]()},$get:function $get(){return _this[pgetterName]()},set:function set(){return _this[setterName]()},has:function has(){return predicate.call(_this)},clear:function clear(){return clearer.call(_this)},toString:function toString(){return"[Attribute "+fullName+"]"}};return orig.apply(thisArg,arguments)}}(ainfo)}aspec[ff]=ainfo}exports[as]=advice(function(){var prop=this[getterName]();var method=prop[f];if(!method)throw new Error("undefined method: "+self.getFullName()+"."+f);return method.apply(prop,arguments)},aspec)})(f)}self.__handlers=exports}return self.__handlers};this.getMethods=function(){var self=this;if(self.__methods===false){var exports={};var pspec=this.__pspec;var methods=pspec.methods;var getterName=this.getGetterName();var pgetterName=this.getPrivateGetterName();var setterName=this.getSetterName();var predicate=this.getPredicate();var clearer=this.getClearer();for(var name in methods){(function(name,entity){var fullName=self.getFullName();var methodName=self.fullName+"#"+name;exports[name]=function(){var _this2=this;var thisArg=mix(methods,{context:this,get:function get(){return _this2[getterName]()},$get:function $get(){return _this2[pgetterName]()},set:function set(v){return _this2[setterName](v)},has:function has(){return predicate.call(_this2)},clear:function clear(){return clearer.call(_this2)},toString:function toString(){return"[Attribute "+fullName+"]"}});return entity.apply(thisArg,arguments)}})(name,methods[name])}self.__methods=exports}return self.__methods};this._initRaw=function(){var self=this;var spec=self.getSpec();var field=self.getName();var pspec=self.__pspec;var container=pspec.container;var delegated=pspec.delegated||false;var pseudo=pspec.pseudo;var initFlag="__"+field+"$initialized";var getContainer=null;var predicateMethod=null;var clearerMethod=null;var rawGetter=null;var rawSetter=null;if(container){getContainer=container.get;var setter=container.setter||null;var getter=container.getter||null;var predicate=container.predicate||null;var clearer=container.clearer||null;delegated=!!(setter||getter||predicate||clearer);if(delegated){initFlag=null;if(setter)rawSetter=function rawSetter(v){return getContainer.call(this)[setter](v)};if(getter)rawGetter=function rawGetter(){return getContainer.call(this)[getter]()};if(predicate)predicateMethod=function predicateMethod(){return getContainer.call(this)[predicate]()};if(clearer)clearerMethod=function clearerMethod(){return getContainer.call(this)[clearer]()}}else{rawSetter=function rawSetter(v){getContainer.apply(this,[])[field]=v};rawGetter=function rawGetter(){return getContainer.apply(this,[])[field]};predicateMethod=function predicateMethod(){return field in getContainer.call(this)};clearerMethod=function clearerMethod(){delete getContainer.call(this)[field]}}}else{var objField="__"+field;if(pseudo){initFlag=null}else{rawSetter=function rawSetter(v){this[objField]=v};rawGetter=function rawGetter(){return this[objField]}}}if(!pseudo){if(!predicateMethod){predicateMethod=function predicateMethod(){return this[initFlag]||false}}if(!clearerMethod){clearerMethod=function clearerMethod(){rawSetter.apply(this,[null]);this[initFlag]=false}}}self.__pseudo=pseudo;self.__delegated=delegated;self.__initflag=initFlag;self.__getContainer=getContainer;self.__rawSetter=rawSetter;self.__rawGetter=rawGetter;self.__predicate=predicateMethod;self.__clearer=clearerMethod;if(!self.isLazy()&&!pseudo&&!delegated){var initializer=self.getInitializer();var setter=self.getSetter();self.__clearer=advice(clearerMethod,{after:function after(){setter.apply(this,[initializer.apply(this,[])])}})}};this.isPseudo=function(){return this.__pseudo};this.isDelegated=function(){return this.__delegated};this.getInitializer=function(){return this.__pspec.init};this.getContainerGetter=function(){return this.__getContainer};this.getRawSetter=function(){return this.__rawSetter};this.getPredicateName=function(){return this.__pspec.predicate};this.getPredicate=function(){return this.__predicate};this.getClearerName=function(){return this.__pspec.clearer};this.getClearer=function(){return this.__clearer};this.getInitFlag=function(){return this.__initflag};this.apply=function(){this.exportSymbols();this.defineProperty();return this};this.exportSymbols=function(){var self=this;var meta=self.__meta;var field=self.__name;var proto=self.__proto;var predicate=self.getPredicateName();if(predicate){proto[predicate]=self.getPredicate()}var clearer=self.getClearerName();if(clearer){proto[clearer]=self.getClearer()}if(self.exportsSetter()){proto[self.getSetterName()]=self.getSetter()}if(self.exportsGetter()){proto[self.getGetterName()]=self.getGetter();var privateGetterName=self.getPrivateGetterName();if(privateGetterName){proto[privateGetterName]=self.getPrivateGetter()}}var sym;var handlers=self.getHandlers();for(sym in handlers){meta.defineMethod(sym,handlers[sym])}var methods=self.getMethods();for(sym in methods){meta.defineMethod(sym,methods[sym])}};this.defineProperty=function(){if(!this.isPropertyDefiner())return;if(!Object.defineProperty)return;var propDef={};var field=this.__name;var pspec=this.__pspec;var hideSetter=this.isSetterHidden();var hideGetter=this.isGetterHidden();var setterName=this.getSetterName();var getterName=this.getGetterName();if(!hideSetter)propDef.set=function(v){this[setterName].apply(this,arguments);return v};if(!hideGetter)propDef.get=function(){return this[getterName].apply(this,arguments)};var proto=this.__proto;if(!proto.hasOwnProperty(field))Object.defineProperty(proto,field,propDef)};this.isOverrided=function(obj){var self=this;var objmeta=obj.constructor.$meta||null;if(!objmeta)return false;if(objmeta===this.getMeta())return false;var attr=objmeta.getAttribute(this.getName(),true);return attr!==this};this.actInitialize=function(obj,opt){var initAction=this.getInitAction();if(this.isOverrided(obj))return;try{initAction.apply(obj,[opt])}catch(e){e.message="Error occured when initialize "+this.getFullName()+"("+(obj.constructor.getName?obj.constructor.getName():obj.constructor)+")"+": "+e.message;throw e}}});return Attribute}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.Attribute"}),[mod_KaeL_Commons_Class_LowLevel_gen,mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare,mod_KaeL_Commons_Class_Meta_Attribute_spec_inherit,mod_KaeL_Commons_Class_Meta_Attribute_spec_prepare_isa,mod_KaeL_Commons_Type_duck]);var mod_KaeL_Commons_Class_Meta_makeUtil=function(advice,Attribute){return function(meta,proto){var SuperClass=meta.__super;var Super=SuperClass.prototype;var advices={};var _inherit=function _inherit(field,spec){var src=Super[field];var as=spec.as||field;proto[as]=advice(src,spec)};var defadvice=function defadvice(field,spec){if("function"===typeof spec)spec={around:spec};var slot=advices[field]||(advices[field]={});for(var f in spec){slot[f]=spec[f]}};var define=function define(field,def){meta.defineMethod(field,def)};var _has=function _has(field,spec){meta.defineAttribute(field,spec)};var commit=function commit(){var fields=meta.getAttributes();var initAttrs=function initAttrs(opt_){var opt=opt_||{};for(var field in fields){var fspec=fields[field];fspec.actInitialize(this,opt)}};proto.initialize=advice(proto.initialize||function(){},{before:initAttrs});for(var f in advices){var spec=advices[f];if(!proto[f])throw new Error("Unknown method: "+f);proto[f]=advice(proto[f],spec)}};return{SuperClass:SuperClass,Super:Super,MetaClass:meta,has:function has(spec){for(var f in spec){_has(f,spec[f])}},inherit:function inherit(spec){for(var f in spec){_inherit(f,spec[f])}},advice:function advice(spec){for(var f in spec){defadvice(f,spec[f])}},override:function override(spec){for(var f in spec){defadvice(f,{override:spec[f]})}},input:function input(spec){for(var f in spec){defadvice(f,{input:spec[f]})}},output:function output(spec){for(var f in spec){defadvice(f,{output:spec[f]})}},around:function around(spec){for(var f in spec){defadvice(f,{around:spec[f]})}},before:function before(spec){for(var f in spec){defadvice(f,{before:spec[f]})}},after:function after(spec){for(var f in spec){defadvice(f,{after:spec[f]})}},methods:function methods(spec){for(var f in spec){define(f,spec[f])}},emptyMethods:function emptyMethods(){var args=arguments.length==1&&arguments[0]instanceof Array?arguments[0]:arguments;for(var i=0,l=args.length;i<l;i++){var em=args[i];proto[em]=function(){return false}}},commit:commit}}}.apply($$pm({NAME:"KaeL.Commons.Class.Meta.makeUtil"}),[mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Class_Meta_Attribute]);var mod_KaeL_Commons_Class_Meta=function(llgen,generateConstructor,makeUtil,gensym,mix,ou,arrayToObject,isFunc,array,duck,advice,setFunctionName,Attribute,Method,global){var initConstructor=function initConstructor(newClass,classObj){newClass.$meta=classObj;setFunctionName(newClass,classObj.getName());mix(newClass,classObj,{regexp:/^(?!initialize(?!.+)|_)/});mix(newClass,classObj.getAllClassMethods(),{filteringMethod:"passThrough"})};var prepare=function prepare(opt,spec){if(opt===undefined){opt={};spec=function spec(){}}else if(spec===undefined){if("string"==typeof opt){spec=function spec(){}}else if(opt.proto||opt.constructorFunction||opt.name||opt.does||opt.has||opt.input||opt.output||opt.around||opt.after||opt.before||opt.inherit||opt.methods||opt.abstractMethods||opt.abstractClass||opt.emptyMethods||opt.classMethods){spec=function spec(){}}else{spec=opt;opt={superClass:Object};if("function"!==typeof spec){try{global.console.warn("Deprecated class creation form.")}catch(e){}}}}if("object"===(typeof spec==="undefined"?"undefined":_typeof(spec))){var tmpl=spec;spec=function spec(){for(var f in tmpl){this[f]=tmpl[f]}}}if("string"==typeof opt){opt={name:opt}}else if(isFunc(opt)){opt={superClass:opt}}var constructor=opt.constructorFunction||null;if(constructor&&constructor.$$meta||null){var llspec=constructor.$$meta;opt.lowLevel=true;opt.name=llspec.name;opt.has=llspec.has}else{opt.lowLevel=false}return{opt:opt,spec:spec}};var MetaClass=llgen({name:this.getName(),has:{name:{set:false,isa:String,get:"getName"},finalClass:{set:false,isa:Boolean,get:"isFinal"},abstractClass:{set:false,isa:Boolean,get:"isAbstract"},superClass:{set:false,get:"getSuperClass"},superMeta:{initArg:null,set:false,get:"getSuperMeta"},abstractMethods:{set:false,initArg:null,get:"getAbstractMethods"},derivedAbstractMethods:{set:false,initArg:null,get:"getDerivedAbstractMethods"},allAbstractMethods:{set:false,initArg:null,get:"getAllAbstractMethods"},children:{set:false,get:"getChildren"},attributes:{initArg:"has",set:false,get:"getAttributes"},methods:{set:false,get:"getMethods"},classMethods:{set:false,get:"getClassMethods"},classOption:{set:false,get:"getOptions"},classInitializer:{set:false,get:"getInitializer"},proto:{set:false,get:"getPrototype"},constructor:{initArg:null,set:false,get:"getConstructor"}}},function(){this.initialize=function(opt_,spec_){var args=prepare(opt_,spec_);var opt=args.opt;var spec=args.spec;var isAbstract=this.__abstractClass=!!(opt.abstractClass||opt.abstractMethods);var abstractMethods=opt.abstractMethods||[];this.__abstractMethods=abstractMethods;this.__manager=opt.manager;this.__anonymous=!(opt.name||false);this.__name=opt.name||gensym("_CLASS_");this.__final=opt.finalClass?true:false;this.__super=opt.superClass||Object;var roles=this.__roles=opt.does||[];for(var i=0,l=roles.length;i<l;i++){duck(roles[i],"exportSymbols","getNeeds")}this.__lowLevel=opt.lowLevel;this.__children=[];this.__classOption=opt;this.__classInitializer=spec;this.__has={};this.__classMethods={};this.__attributes={};this.__methods={};this.__abstractMethodsDict=false;this.__roleAbstractMethods=false;this.__inheritedAbstractMethods=false;this.__derivedAbstractMethods=false;var constructor=this.__constructor=opt.constructorFunction||null;if(opt.lowLevel){initConstructor(constructor,this)}var proto=opt.proto||(constructor?constructor.prototype:null);if(proto){this.__proto=proto}else{this._initialize_createPrototype(opt)}if("classMethods"in opt)this.defineClassMethods(opt.classMethods);this._initialize_after()};this.defineClassMethods=function(spec){for(var f in spec){this.defineClassMethod(f,spec[f])}};this.defineClassMethod=function(name,spec_){var spec=spec_;if("function"!=typeof spec){var orig=this.getAllClassMethods()[name]||null;if(!orig)throw new Error("unknown class method: "+name);spec=advice(orig,spec)}var constructor=this.getConstructor();this.getClassMethods()[name]=spec;constructor[name]=spec};this.getClassMethods=function(){return this.__classMethods};this.getAllClassMethods=function(){var self=this;var superMeta=self.getSuperMeta();var superClassMethods=superMeta?superMeta.getAllClassMethods():{};var myClassMethods=this.__classMethods;return ou.mix(superClassMethods,myClassMethods)};this.isSubclassOf=function(base){return this.getPrototype()instanceof base};this.isSubClass=function(sub){return sub.isSubclassOf(this.getConstructor())};this._initialize_after=function(){this._initialize_after_check();if("$meta"in this.__super){this.__super.$meta.registerChildClass(this)}if(!this.__anonymous)this.__manager.register(this)};this._initialize_after_check=function(){var derivedAbstractMethods=this.getDerivedAbstractMethods();var proto=this.__proto;if(this.__abstractClass){var allAbstract=this.getAllAbstractMethods();var i,l;for(i=0,l=allAbstract.length;i<l;i++){(function(meth){proto[meth]=function(){var className="$meta"in this.constructor?this.constructor.$meta.getName():"<unknown>";throw new Error(className+\' must implement "\'+meth+\'".\')}})(allAbstract[i])}}else if(derivedAbstractMethods.length>0){throw new Error(this.getName()+" have to implement abstract methods ("+derivedAbstractMethods.join(", ")+").")}};this._initialize_createPrototype=function(opt){var self=this;var superProto=this.__super.prototype;var proto=ou.derive(superProto);this.__proto=proto;var roles=this.__roles||[];var i,l;for(i=0,l=roles.length;i<l;i++){roles[i].exportSymbols(proto,self)}var util=makeUtil(self,proto);for(var f in util){if(!util.hasOwnProperty(f))continue;if(f.match(/^(?:commit|classMethods|[A-Z].*)$/))continue;if(!(f in opt))continue;util[f].apply(util,[opt[f]])}this.__classInitializer.apply(proto,[superProto,util]);for(i=0,l=roles.length;i<l;i++){roles[i].applyAdvicers(proto)}util.commit();return proto};this._initialize_lowlevel=function(meta){};this.isAnonymous=function(){return this.__anonymous};this.getName=function(){return this.__name};this.isAbstract=function(){return this.__abstractClass};this.isFinal=function(){return this.__final};this.isRegular=function(){return this.__regular};this.getPrototype=function(){return this.__proto};this.getSuperClass=function(){return this.__super};this.getSuperProto=function(){return this.__super.prototype};this.getSuperMeta=function(){return"$meta"in this.__super?this.__super.$meta:null};this.getLinearisedMeta=function(){var superMeta=this.getSuperMeta();return[this].concat(superMeta?superMeta.getLinearisedMeta():[])};this.getLinearisedClassNames=function(){return array.map.call(this.getLinearisedMeta(),function(m){return m.getMeta()})};this.getRoles=function(){return(this.__roles||[]).slice(0)};this.getAllRoles=function(){var R=(this.__roles||[]).slice(0);var parent=this.getSuperMeta();if(parent){R.unshift.apply(R,parent.getAllRoles())}return R};this.doesRole=function(role){if(typeof role=="string")role=this.__manager.get(role);if(!role)return false;var roles=this.__roles;for(var i=0,l=roles.length;i<l;i++){if(role.doesRole(roles[i]))return true}var base=this.getSuperMeta();if(!base)return false;return base.doesRole(role)};this.stringify=function(){return"[class "+this.getName()+"]"};this.getOptions=function(){return this.__classOption};this.getInitializer=function(){return this.__classInitializer};this.getChildren=function(){return this.__children};this.getAbstractMethods=function(){return this.__abstractMethods};this.defineAttribute=function(name,spec){var attr=new Attribute({name:name,meta:this,proto:this.getPrototype(),spec:spec});this.__attributes[name]=attr;var proto=this.getPrototype();attr.apply();return attr};this.getAttributes=function(){return this.__attributes};this.getAttribute=function(name,recursively){var attr=this.__attributes[name]||null;if(attr)return attr;if(!recursively)return null;var parent=this.getSuperMeta();if(!parent)return null;return parent.getAttribute(name,true)};this.hasAttribute=function(name){return name in this.__attributes};this.defineMethod=function(name,def){var proto=this.getPrototype();var meth=Method({meta:this,name:name,proto:proto},def);this.__methods[name]=meth;proto[name]=meth.getCompiled()};this.getMethod=function(name){var proto=this.getPrototype();if("function"!==typeof proto[name])return null;var mdic=this.__methods;if(!proto.hasOwnProperty(name)){var sm=this.getSuperMeta();if(!sm)return null;return sm.getMethod(name)}if(!(name in mdic)){var body=proto[name];mdic[name]=Method({meta:this,name:name,abstractMethod:this.isAbstractMethod(name),proto:proto},body)}return mdic[name]};this.isAbstractMethod=function(name){var self=this;if(self.__abstractMethodsDict===false){self.__abstractMethodsDict=arrayToObject(this.getAllAbstractMethods(),true)}return self.__abstractMethodsDict[name]||false};this.getRoleAbstractMethods=function(){if(this.__roleAbstractMethods===false){var roles=this.__roles;var proto=this.getPrototype();var amflag={};var ram=[];for(var i=0,l=roles.length;i<l;i++){var role=roles[i];var needs=role.getNeeds();for(var j=0,m=needs.length;j<m;j++){var meth=needs[j];if(amflag[meth])continue;if(!isFunc(proto[meth]||null)){amflag[meth]=true;ram.push(meth)}}}this.__roleAbstractMethods=ram}return this.__roleAbstractMethods.slice(0)};this.getInheritedAbstractMethods=function(){if(this.__inheritedAbstractMethods===false){var proto=this.getPrototype();var superMeta=this.getSuperMeta();var superProto=this.getSuperProto();var superAbstract=superMeta&&superMeta.isAbstract()?superMeta.getAllAbstractMethods():[];var amflag={};var iam=[];for(var i=0,l=superAbstract.length;i<l;i++){var meth=superAbstract[i];if(amflag[meth])continue;if(proto[meth]===superProto[meth]){amflag[meth]=true;iam.push(meth)}}this.__inheritedAbstractMethods=iam}return this.__inheritedAbstractMethods.slice(0)};this.getDerivedAbstractMethods=function(){if(!this.__derivedAbstractMethods){this.__derivedAbstractMethods=ou.keys(ou.mix(arrayToObject(this.getInheritedAbstractMethods(),true),arrayToObject(this.getRoleAbstractMethods(),true)))}return this.__derivedAbstractMethods};this.getAllAbstractMethods=function(){if(!this.__allAbstractMethods){var derivedAbstractMethods=this.getDerivedAbstractMethods();var myAbstractMethods=this.getAbstractMethods();var all={},i,l;for(i=0,l=derivedAbstractMethods.length;i<l;i++){all[derivedAbstractMethods[i]]=true}for(i=0,l=myAbstractMethods.length;i<l;i++){all[myAbstractMethods[i]]=true}var allAbstractMethods=[];for(var f in all){allAbstractMethods.push(f)}this.__allAbstractMethods=allAbstractMethods}return this.__allAbstractMethods};this.getAllMethods=function(){var proto=this.getPrototype();var buf={};var f;for(f in proto){if("function"===typeof proto[f])buf[f]=true}var abs=this.getAllMethods();for(var i=0,l=abs.length;i<l;i++){buf[abs[i]]=true}var R=[];for(f in buf){R.push(f)}return R};this.isImplemented=function(name){var proto=this.__proto;if(name in proto&&isFunc(proto[name]))return true;return false};this.hasAbstractMethod=function(name){if(!this.isAbstract())return false;var methods=this.getAllAbstractMethods();for(var i=0,l=methods.length;i<l;i++){if(methods[i]==name)return true}return false};this.can=function(name){if(this.isImplemented(name))return true;return this.hasAbstractMethod(name)};this.registerChildClass=function(child){this.__children.push(child)};this.subClass=function(opt,spec){if(this.isFinal()){throw new Error("class "+this.getName()+" is final class.")}var args=prepare(opt,spec);opt=args.opt;spec=args.spec;opt.superClass=this.getConstructor();opt.manager=this.__manager;var meta=new MetaClass(opt,spec);return meta.getConstructor()};this.getConstructor=function(){var meta=this;var proto=this.getPrototype();if(!this.__constructor){var newClass=this.isAbstract()?function(){throw new Error(meta.getName()+" is abstract class.")}:generateConstructor();newClass._super=this.getSuperClass();newClass.prototype=proto;proto.constructor=newClass;initConstructor(newClass,this);this.__constructor=newClass}return this.__constructor}});return MetaClass}.apply($$pm({NAME:"KaeL.Commons.Class.Meta"}),[mod_KaeL_Commons_Class_LowLevel_gen,mod_KaeL_Commons_Class_gen_constructor,mod_KaeL_Commons_Class_Meta_makeUtil,mod_KaeL_Commons_Util_gensym,mod_KaeL_Commons_Object_mix,mod_KaeL_Commons_Object_UTIL,mod_KaeL_Commons_Array_toObject,mod_KaeL_Commons_Util_isFunc,mod_KaeL_Commons_Array_PROTOTYPE,mod_KaeL_Commons_Type_duck,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Function_setName,mod_KaeL_Commons_Class_Meta_Attribute,mod_KaeL_Commons_Class_Meta_Method,mod_KaeL_Commons_Util_GLOBAL]);var mod_KaeL_Commons_Class_FRAMEWORK=function(Man,MetaClass){var MAN=new Man(MetaClass);return MAN}.apply($$pm({NAME:"KaeL.Commons.Class.FRAMEWORK"}),[mod_KaeL_Commons_Class_Manager,mod_KaeL_Commons_Class_Meta]);var mod_KaeL_Commons_Class_get=function(MAN){return function(){var meta=MAN.get.apply(MAN,arguments);return meta?meta.getConstructor():null}}.apply($$pm({NAME:"KaeL.Commons.Class.get"}),[mod_KaeL_Commons_Class_FRAMEWORK]);var mod_KaeL_Commons_Object=function(getClass){return getClass("KaeL.Commons.Object")}.apply($$pm({NAME:"KaeL.Commons.Object"}),[mod_KaeL_Commons_Class_get]);var mod_KaeL_Commons_DOM_TypeId=function(Obj,AGENT){return Obj.subClass(this.getName(),function(){this.initialize=function(doc){this.__doc=doc;this.__HTML=false;this.__XHTML=false;this.__XUL=false;this.__XML=true;this.identifier="xml";if(AGENT.isGecko()){var elem=doc.createElement("foo");var ns=elem.namespaceURI;if(ns=="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"){this.__XUL=true;this.identifier="xul";return}}var root=doc.documentElement;var rootNS=root.namespaceURI||root.tagUrn;if(rootNS=="http://www.w3.org/1999/xhtml"){this.__XHTML=true;this.identifier="xhtml";return}if(root.tagName.toLowerCase()=="html"){this.__HTML=true;this.__XML=false;this.identifier="html";return}};this.isHTML=function(){return this.__HTML};this.isXHTML=function(){return this.__XHTML};this.isXUL=function(){return this.__XUL};this.isXML=function(){return this.__XML};this.getIdentifier=function(){return this.identifier};this.stringify=function(){return"["+this.constructor.getName()+" "+this.identifier+"]"}})}.apply($$pm({NAME:"KaeL.Commons.DOM.TypeId"}),[mod_KaeL_Commons_Object,mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_Class_Role_Feature=function(Obj){return Obj.subClass({name:this.getName(),override:{initialize:function initialize(owner){if(!(owner&&owner.constructor&&owner.constructor.$meta))throw new TypeError("illegal feature owner: "+owner);this.__OWNER__=owner}}})}.apply($$pm({NAME:"KaeL.Commons.Class.Role.Feature"}),[mod_KaeL_Commons_Object]);var mod_KaeL_Commons_Class_Property_Array=function(Base,ucfirst,advice,mix,isObject,makeFilteredArrayMethods,Tc){var ap=Base.subClass({name:this.getName(),has:{dynamic:false,clearer:{isa:[String,Boolean],init:false},predicate:{isa:[String,Boolean],init:false},container:{},initArg:{predicate:true},initAction:{isa:Function,predicate:true},minOccurs:{isa:Number,init:0,maybe:false,set:false},maxOccurs:{isa:Number,init:null,set:false},init:{isa:[Function],predicate:true,set:false,filter:function filter(v){if(!v)return null;if(v instanceof Array)return function(){return v.slice(0)};if(v!==true)return v;if(this.getMinOccurs()>0){throw new Error("illegal array property specification: "+"default initializer could not be created.")}return function(){return[]}}},maybe:true,isa:{init:null,filter:function filter(v){if(!(v instanceof Array))return[v];return v},set:false},does:{init:null,set:false},duck:{init:null,isa:Array,set:false},validate:{init:null,isa:Function,set:false},emaybe:false,filter:{init:null,isa:[Function,Boolean],set:false},output:{init:null,isa:[Function,Boolean],set:false},set:{predicate:true},get:{predicate:true},lazy:true,handles:{init:function init(){return{}},methods:{buildFromHandles:function buildFromHandles(attr){var self=this.context;var src=this.get();var attrName=attr.getName||null?attr.getName():attr;var attrFullName=attr.getName||null?attr.getFullName():attr;var ucfn=self.isDynamic()?ucfirst(attrName):"";var handles={};var methods={};var filter=self.buildFilters(attr).filter;var filteredMethods=makeFilteredArrayMethods({name:attrFullName,filter:filter,minOccurs:self.getMinOccurs(),maxOccurs:self.getMaxOccurs()});filteredMethods.sortSelf=function(){var sorted=this.sort.apply(this,arguments);for(var i=0,l=sorted.length;i<l;i++){this[i]=sorted[i]}};if(self.getMinOccurs()<1){filteredMethods.clear=function(){this.splice(0)}}filteredMethods.getLengthOf=function(){return this.length};filteredMethods.has=function(){return this.length>0};for(var f in src){(function(spec){if(!isObject(spec)){if(spec===false)return;spec={}}spec.as=(spec.as||f)+ucfn;var meth=filteredMethods[f]||null;if(meth){handles[f]=spec}else{var adviced=advice(function(){return meth.apply(this.get(),arguments)},spec);methods[spec.as]=adviced}})(mix({},src[f]))}return{handles:handles,methods:methods}}}},methods:{init:function init(){return{}},methods:{buildFromMethods:function buildFromMethods(attr){var self=this.context;var src=this.get();var attrName=!!(attr.getName||null)?attr.getName():attr;var dst={};var ucfn=self.isDynamic()?ucfirst(attr.getName()):"";var filters=self.buildFilters(attr);for(var f in src){(function(orig){dst[f+ucfn]=function(){var thisArg=mix(this,{filter:filters.filter,validator:filters.validator,maybe:self.isEmaybe(),minOccurs:self.getMinOccurs(),maxOccurs:self.getMaxOccurs()});return orig.apply(thisArg,arguments)}})(src[f])}return dst}}}},methods:{buildFilters:function buildFilters(attr){var self=this;var isa=null;var isaSrc=self.getIsa();if(isaSrc){isa=[];var $self=attr.getMeta?attr.getMeta().getConstructor():null;for(var i=0,l=isaSrc.length;i<l;i++){isa[i]=isaSrc[i];if(isa[i]==="$self"){if(!$self)throw new Error("could not resolve \'$self\'.");isa[i]=$self}}}var tc=Tc({isa:isa,does:self.getDoes(),duck:self.getDuck(),maybe:self.isEmaybe(),validate:self.getValidate()});var validate=tc.getValidator((attr.getFullName?attr.getFullName():attr)+"[*]");var vfilter=function vfilter(v){validate(v);return v};var filter=function(orig){if(!orig)return vfilter;if(orig===true){orig=tc.getDefaultFilter()}return advice(orig,{output:vfilter})}(this.getFilter());return{filter:filter,validator:validate}},buildSpec:function buildSpec(attr_){var self=this;var attr=attr_||null;var filters=self.buildFilters(attr);var _filter=filters.filter;var _validator=filters.validator;var fromHandles=self.buildFromHandles(attr);var methods=self.buildFromMethods(attr);var handles=fromHandles.handles;mix(methods,fromHandles.methods);var spec={isa:Array,lazy:self.isLazy(),maybe:self.isMaybe(),predicate:self.getPredicate(),container:self.getContainer(),clearer:self.getClearer(),filter:function filter(src){if(src instanceof Array){var dst=[];for(var i=0,l=src.length;i<l;i++){dst.push(_filter.call(this,src[i]))}return dst}return src},validator:function validator(v){for(var i=0,l=src.length;i<l;i++){_validator(v[i])}},handles:handles,methods:methods};var output=self.getOutput();if(output){if(output===true)output=function output(o){return o.sclice(0)};spec.output=output}if(self.hasInit())spec.init=self.getInit();if(self.hasSet())spec.set=self.getSet();if(self.hasGet())spec.get=self.getGet();if(self.hasInitArg())spec.initArg=self.getInitArg();if(self.hasInitAction())spec.initAction=self.getInitAction();return spec}}});return ap}.apply($$pm({NAME:"KaeL.Commons.Class.Property.Array"}),[mod_KaeL_Commons_Object,mod_KaeL_Commons_String_ucfirst,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Util_isObject,mod_KaeL_Commons_Array_Prototype_filtered,mod_KaeL_Commons_Type_Constraint]);var mod_KaeL_Commons_DOM_TypeId_get=function(TypeId,AGENT){if(AGENT.isIE()){return function(doc){return TypeId(doc)}}var PRIV=" * "+this.getName()+" * ";return function(doc){if(!doc[PRIV])doc[PRIV]=TypeId(doc);return doc[PRIV]}}.apply($$pm({NAME:"KaeL.Commons.DOM.TypeId.get"}),[mod_KaeL_Commons_DOM_TypeId,mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_Class_Role=function(Obj,FW,Feature,ap,exportMethods,smix,getClass,isFunc,isObject,gensym,quotemeta,ADVICERS,advice,struniq,ucfirst,delegatifyAttributeSpec,roleExportedSpec){var MODNAME=this.getName();var DEFAULT_EXPORTS=new RegExp("^(?!(?:"+["initialize","postInit","preInit","method","hash","equals","deepClone","stringify","toString"].join("|")+")(?!.+)|"+"[_\\\\$].*)");var Role=Obj.subClass({name:MODNAME,has:{anonymous:{initArg:null,init:false,isa:Boolean,set:false},name:{isa:String,lazy:false,init:function init(){this.$setAnonymous(true);return"_ROLE_"+gensym()},set:false},does:ap({isa:"$self",init:true,set:false}),has:{set:false,init:function init(){return{}},methods:{getAttributeSpec:function getAttributeSpec(name){return this.get()[name]||null}}},delegatifiedHas:{initArg:null,set:false,get:false,init:function init(){var has=this.getHas();var dst={};for(var f in has){dst[f]=delegatifyAttributeSpec(f,has[f],"__OWNER__")}return dst}},delegatifiedAttributeMethodsPattern:{initArg:null,set:false,get:false,init:function init(){var src=this.$getDelegatifiedHas();var buf=[];for(var f in src){var spec=src[f];var handles=spec.handles||{};for(var h in handles){var as=handles[h].as||h;buf.push(quotemeta(as))}var methods=spec.methods||{};for(var m in methods){buf.push(quotemeta(m))}}if(buf.length<1)return/(?!)/;return new RegExp("^(?:"+buf.join("|")+")")}},methods:{set:false,init:function init(){return{}}},emptyMethods:{set:false,init:function init(){return[]}},base:{isa:"$self",set:{hide:true,after:function after(base){if(base)this.getDoes().unshift(base)}}},advicers:{initAction:function initAction(opt){var self=this;var dst={};var tmp=smix(opt.advice||{});var f,target,slot;for(f in ADVICERS){if(!(f in opt))continue;slot=opt[f];for(target in slot){(tmp[target]||(tmp[target]={}))[f]=slot[target]}}var propName=self.getPropName();for(target in tmp){slot=tmp[target];var dstslot={};dst[target]=dstslot;for(f in slot){var spec=slot[f];dstslot[f]="function"===typeof spec?function(orig){return function(){var feature=this[propName]||null;return orig.apply(feature,arguments)}}(spec):spec}}return dst},set:false,methods:{applyAdvicers:function applyAdvicers(proto){var self=this.context;var advicers=this.get();var does=self.getDoes();var i,l;for(i=0,l=does.length;i<l;i++){does[i].applyAdvicers(proto)}for(var target in advicers){var func=proto[target];if("function"!=typeof func)continue;proto[target]=advice(func,advicers[target])}}}},needs:ap({isa:String,init:true,set:false,get:false}),doesCache:{initArg:null,lazy:false,init:function init(){return{}},set:false,get:false},exports:{isa:Function,filter:function filter(exp_){var exp=exp_;if(isObject(exp)){var inc=exp.include;var qinc=[];for(var i=0,l=inc.length;i<l;i++){qinc.push(quotemeta(inc[i]))}var incX=new RegExp("^(?:"+qinc.join("|")+")");exp=function exp(sym){if(DEFAULT_EXPORTS.test(sym))return true;if(incX.test(sym))return true;return false}}else if(exp instanceof RegExp){return function(sym){return exp.test(sym)}}return exp},init:function init(){return DEFAULT_EXPORTS},set:false},calculatedExports:{isa:Function,maybe:false,initArg:false,set:false,init:function init(){var excludedAccessorsPattern=this.$getExcludedAccessorsPattern();var excludedMethodsPattern=this.$getExcludedMethodsPattern();var includedMethodsPattern=this.$getIncludedMethodsPattern();var delegatifiedAttributeMethodsPattern=this.$getDelegatifiedAttributeMethodsPattern();return advice(this.getExports(),{around:function around(orig,sym){if(includedMethodsPattern.test(sym))return true;if(excludedAccessorsPattern.test(sym))return false;if(excludedMethodsPattern.test(sym))return false;if(delegatifiedAttributeMethodsPattern.test(sym))return false;return orig.apply(this,[sym])}})}},excludedMethods:{initAction:function initAction(opt_){var opt=opt_||{};if(!("methods"in opt||"emptyMethods"in opt))return{};if(!isObject(opt.feature||null))return{};return opt.feature.methods||{}},init:function init(){return{}},set:false,get:false},excludedMethodsPattern:{initArg:null,init:function init(){var empty=/(?!)/;var buf=[];var src=this.$getExcludedMethods();for(var f in src){buf.push(quotemeta(f))}if(buf.length<1)return empty;return new RegExp("^(?:"+buf.join("|")+")$")},set:false,get:false},includedMethodsPattern:{initArg:null,init:function init(){var empty=/(?!)/;var buf=[];var src=this.getMethods();for(var f in src){buf.push(quotemeta(f))}if(buf.length<1)return empty;return new RegExp("^(?:"+buf.join("|")+")$")},set:false,get:false},excludedAttributes:{initAction:function initAction(opt_){var opt=opt_||{};if(!isObject(opt.feature||null))return undefined;return opt.feature.has||undefined},init:function init(){return{}},set:false,get:false},excludedAccessorsPattern:{initArg:null,init:function init(){var src=this.$getExcludedAttributes();var feature=this.getFeature();var empty=/^(?!.|)/;if(!feature)return empty;var featureMeta=feature.$meta||null;if(!featureMeta)return empty;var attrs=featureMeta.getAttributes();var buf=[];for(var f in src){var attr=attrs[f];var getterName=attr.getGetterName();var setterName=attr.getSetterName();if(getterName)buf.push(quotemeta(getterName));if(setterName)buf.push(quotemeta(setterName))}if(buf.length<1)return empty;return new RegExp("^(?:"+buf.join("|")+")")},set:false,get:false},featurePrototypeInitializer:{isa:Function,maybe:false,init:function init(){return function(){}},set:false},baseFeature:{initArg:false,set:false,init:function init(){var base=this.getBase();return base?base.getFeature():Feature}},feature:{set:false,initAction:function initAction(opt_){var opt=opt_||{};var feature=opt.feature||null;if(feature)return feature;if("has"in opt)return{};if("methods"in opt)return{};if("emptyMethods"in opt)return{};return undefined},filter:function filter(feature){if(feature.$meta)return feature;var fopt=smix({name:this.getName()+":feature"},feature);fopt.emptyMethods=struniq((fopt.emptyMethods||[]).concat(this.getEmptyMethods()||[]));fopt.methods=smix(fopt.methods||{},this.getMethods()||{});fopt.has=smix(fopt.has||{},this.$getDelegatifiedHas()||{});var featureClass=this.getBaseFeature().subClass(fopt,this.getFeaturePrototypeInitializer());return featureClass},validate:function validate(feature){var CError=getClass("KaeL.Commons.Error");var IllegalArgumentException=CError?CError.IllegalArgument:TypeError;if(!feature.$meta){throw new IllegalArgumentException("specified feature is not a class.")}if(!feature.doesRole("KaeL.Commons.Class.Role.Feature.Role")){throw new IllegalArgumentException("specified feature does not "+"KaeL.Commons.Class.Role.Feature.Role")}},init:function init(){var finit=this.getFeaturePrototypeInitializer();if(finit)return this.getBaseFeature().subClass({name:"feature:"+this.getName()},finit);return null}},propName:{initArg:null,set:false,init:function init(){return"~"+this.stringify()}}},input:{initialize:function initialize(opt_,featurePrototypeInitializer){var opt=opt_||{};if(!("featurePrototypeInitializer"in opt)&&(featurePrototypeInitializer||null)){opt.featurePrototypeInitializer=featurePrototypeInitializer}return[opt]}},after:{initialize:function initialize(){if(!this.anonymous)FW.register(this)}},methods:{subRole:function subRole(opt_,featurePrototypeInitializer){var opt=smix(opt_,{base:this,featurePrototypeInitializer:featurePrototypeInitializer||false});return new this.constructor(opt)},stringify:function stringify(){return"["+MODNAME+" "+this.getName()+" "+this.__ID__+"]"},doesRole:function doesRole(role){if(this===role)return true;var rhash=role.__ID__;var dc=this.$getDoesCache();if(dc[rhash])return true;var base=this.getDoes();for(var i=0,l=base.length;i<l;i++){if(!base[i].doesRole(role))continue;dc[rhash]=true;return true}return false},isApplication:function isApplication(classOrObj){var meta=null;if(classOrObj.doesRole)return classOrObj.doesRole(this);if(classOrObj.constructor.doesRole)return classOrObj.constructor.doesRole(this);return false},exportSymbols:function exportSymbols(proto,meta){var does=this.getDoes();for(var i=0,l=does.length;i<l;i++){does[i].exportSymbols(proto,meta)}var feature=this.getFeature();if(!feature)return;exportMethods(proto,feature.prototype,{delegateTo:this.getPropName(),methodName:this.getCalculatedExports()});var has=this.getHas();for(var f in has){if(meta.hasAttribute(f))continue;var res=roleExportedSpec(f,has[f],this);meta.defineAttribute(f,res)}},initFeature:function initFeature(obj){var does=this.getDoes();for(var i=0,l=does.length;i<l;i++){does[i].initFeature(obj)}var feature=this.getFeature();if(!feature)return;obj[this.getPropName()]=new feature(obj)},_modInit:function _modInit(meth,obj,args){var does=this.getDoes();for(var i=0,l=does.length;i<l;i++){does[i][meth](obj,args)}if(!this.getFeature())return;var feature=obj[this.getPropName()];if(feature[meth])feature[meth].apply(feature,args)},preInit:function preInit(obj,args){this._modInit("preInit",obj,args)},postInit:function postInit(obj,args){this._modInit("postInit",obj,args)},getNeeds:function getNeeds(){var self=this;var buf=this.$getNeeds().slice(0);var base=this.does;var i,l;for(i=0,l=base.length;i<l;i++){var baseNeeds=base[i].getNeeds();buf.push.apply(buf,baseNeeds)}var flags={};var ret=[];for(i=0,l=buf.length;i<l;i++){var m=buf[i];if(flags[m])continue;flags[m]=true;ret.push(m)}self.getNeeds=function(){return ret};return ret}}});Role.DEFAULT_EXPORTS=DEFAULT_EXPORTS;return Role}.apply($$pm({NAME:"KaeL.Commons.Class.Role"}),[mod_KaeL_Commons_Object,mod_KaeL_Commons_Class_FRAMEWORK,mod_KaeL_Commons_Class_Role_Feature,mod_KaeL_Commons_Class_Property_Array,mod_KaeL_Commons_Object_mix,mod_KaeL_Commons_Object_mix_simple,mod_KaeL_Commons_Class_get,mod_KaeL_Commons_Util_isFunc,mod_KaeL_Commons_Util_isObject_simple,mod_KaeL_Commons_Util_gensym,mod_KaeL_Commons_RegExp_quote,mod_KaeL_Commons_Function_ADVICERS,mod_KaeL_Commons_Function_advice,mod_KaeL_Commons_Array_uniq_string,mod_KaeL_Commons_String_ucfirst,mod_KaeL_Commons_Class_Meta_Attribute_spec_delegatify,mod_KaeL_Commons_Class_Meta_Attribute_spec_roleExported]);var mod_KaeL_Commons_Data_Sequence_Feature=function(Role){return new Role({name:this.getName(),needs:["get"],methods:{getIteratorArgs:function getIteratorArgs(pos){var item=this.__OWNER__.get(pos);return[item,pos]},each:function each(fun){var owner=this.__OWNER__;for(var i=0,l=this._getOwnerLength();i<l;i++){var args=owner.getIteratorArgs(i);if(false===fun.apply(null,args))break}},map:function map(fun){var ret=[];this.__OWNER__.each(function(){ret.push(fun.apply(null,arguments))});return ret},reduce:function reduce(fun){var ret=undefined;var _callback=function callback(v){ret=v;_callback=function callback(v){ret=fun(ret,v)}};this.__OWNER__.each(function(v){_callback(v)});return ret},toArray:function toArray(){var ret=[];this.__OWNER__.each(function(o){ret.push(o)});return ret},join:function join(sep){return this.toArray().join(sep)}},feature:{methods:{_getOwnerLength:function _getOwnerLength(){var owner=this.__OWNER__;if("number"===typeof owner.length)return owner.length;if("function"===typeof owner.length)return owner.length();if("function"===typeof owner.getLength)return owner.getLength();throw new TypeError}}}})}.apply($$pm({NAME:"KaeL.Commons.Data.Sequence.Feature"}),[mod_KaeL_Commons_Class_Role]);var mod_KaeL_Commons_Data_List_Array=function(Obj,SeqFeature){return Obj.subClass({name:this.getName(),does:[SeqFeature]},function(){this.initialize=function(src,index){index=index||0;this.__src=src;this.__car_fetched=false;this.__cdr_fetched=false;this.__car=null;this.__cdr=null;this.__index=index};this.car=function(){if(!this.__car_fetched){this.__car_fetched=true;var src=this.__src;var index=this.__index;var carsrc=src[index];this.__car=carsrc.constructor===Array?new this.constructor(carsrc):carsrc}return this.__car};this.get=function(i){return this.__src[this.__index+i]};this.length=function(){return this.__src.length-this.__index};this.cdr=function(){if(!this.__cdr_fetched){this.__cdr_fetched=true;var src=this.__src;var index=this.__index+1;this.__cdr=src.length>index?new this.constructor(src,index):null}return this.__cdr};this.push=function(){var src=this.__src;src.push.apply(src,arguments)};this.forEach=function(){this.each.apply(this,arguments)}})}.apply($$pm({NAME:"KaeL.Commons.Data.List.Array"}),[mod_KaeL_Commons_Object,mod_KaeL_Commons_Data_Sequence_Feature]);var mod_KaeL_Commons_Error_build_private=function(List){return function(opt,structure){var base=opt.base;var prefix=opt.prefix||"";var dict=opt.dictionary||{};var error=base;(function(node){if(!node)return;var car=node.car();if(typeof car=="string"){dict[car]=error.subClass(prefix+car)}else if(car instanceof List){var preError=error;var caar=car.car();error=dict[caar]=error.subClass(prefix+caar);arguments.callee(car.cdr());error=preError}arguments.callee(node.cdr())})(List(structure));return dict}}.apply($$pm({NAME:"KaeL.Commons.Error.build.private"}),[mod_KaeL_Commons_Data_List_Array]);var mod_KaeL_Commons_Error=function(KObj,FRAMEWORK,getStacktrrace,build,AGENT){var ERRORNAME=this.getName();var MetaClass=FRAMEWORK.get("KaeL.Commons.Class.Meta").getConstructor();var baseMeta=new MetaClass({name:ERRORNAME,manager:FRAMEWORK,superClass:Error},function(SUPER){this.initialize=function(){var st=getStacktrrace();st.shift();this.stack=st.src;this.stacktrace=st;this.initError.apply(this,arguments)};this.initError=function(msg,reason){this.name=this.constructor.getName();this.message=msg;this.reason=reason;if(AGENT.isNodeJS()){this.stack=this.stack.replace(/^[^\\n]*/,this.name+" "+this.message).replace(/(?:\\n +at [^\\n]+){6}/,"")}};this.stringify=function(){var buf=[[this.constructor.getName()+" : "+(this.message||"")].join("")];var st=this.stacktrace;for(var i=0,l=st.length;i<l;i++){var f=st[i];buf.push(" "+f.fileName+":"+f.lineNumber)}return buf.join("\\n")};this.toString=this.stringify});var base=baseMeta.getConstructor();return build({base:base,dictionary:base,prefix:ERRORNAME+"."},[["IllegalArgument","IndexOutOfBounds"],"IOException",["FileSystemException","AccessDeniedException","AtomicMoveNotSupportedException","DirectoryNotEmptyException","FileAlreadyExistsException","FileSystemLoopException","NoSuchFileException","NotDirectoryException","NotLinkException"],"IllegalState","NoSuchProperty","NumberFormat","UnsupportedOperation"])}.apply($$pm({NAME:"KaeL.Commons.Error"}),[mod_KaeL_Commons_Object,mod_KaeL_Commons_Class_FRAMEWORK,mod_KaeL_Commons_Util_getStacktrace,mod_KaeL_Commons_Error_build_private,mod_KaeL_Commons_Util_AGENT]);var mod_KaeL_Commons_DOM_createElement=function(CError,getTypeId,AGENT,gensym){var prefixes={};var defaultOperation=function defaultOperation(doc,uri,name){return doc.createElement(name)};if(AGENT.isIE()){defaultOperation=function defaultOperation(doc,uri,name){var prefix=prefixes[uri]||(prefixes[uri]="ns_"+gensym());if(!doc.namespaces)return doc.createElement(name);if(!doc.namespaces[prefix])doc.namespaces.add(prefix,uri);return doc.createElement(prefix+":"+name)}}var createElementNS=function createElementNS(doc,uri,name){if("function"===typeof doc.createElementNS){return doc.createElementNS(uri,name)}else{return defaultOperation(doc,uri,name)}};return function(doc,uri,name){if(arguments.length<2)throw CError.IllegalArgument("too few arguments");if(arguments.length==2){name=uri;uri="http://www.w3.org/1999/xhtml";if(getTypeId(doc).identifier=="html"){return doc.createElement(name)}}return createElementNS(doc,uri,name)}}.apply($$pm({NAME:"KaeL.Commons.DOM.createElement"}),[mod_KaeL_Commons_Error,mod_KaeL_Commons_DOM_TypeId_get,mod_KaeL_Commons_Util_AGENT,mod_KaeL_Commons_Util_gensym]);var mod_KaeL_Commons_DOM_HTML_toFragment=function(crElem,window){return function(src,context){var doc,ctag;if(context){doc=context.ownerDocument||context;ctag=context.tagName||"div"}else{doc=window.document;ctag="div"}var container=crElem(doc,ctag);var frgn=doc.createDocumentFragment();container.innerHTML=src;while(container.firstChild){frgn.appendChild(container.firstChild.cloneNode(true));container.removeChild(container.firstChild)}return frgn}}.apply($$pm({NAME:"KaeL.Commons.DOM.HTML.toFragment"}),[mod_KaeL_Commons_DOM_createElement,mod_KaeL_Commons_Util_GLOBAL]);var mod_KaeL_Sns_hatena_bookmark_Entry_Comment_domify=function(window,toFragment,toHTML,xmlify,profileIcon){var document=window.document;function renderTags(_ref){var user=_ref.user,_ref$tags=_ref.tags,tags=_ref$tags===undefined?[]:_ref$tags;if(tags.length<1)return"";var R=\'<ul class="entry-comment-tags">\';var _iteratorNormalCompletion11=true;var _didIteratorError11=false;var _iteratorError11=undefined;try{for(var _iterator11=tags[Symbol.iterator](),_step11;!(_iteratorNormalCompletion11=(_step11=_iterator11.next()).done);_iteratorNormalCompletion11=true){var tag=_step11.value;R+=\'<li><a href="/\'+user+"/"+encodeURIComponent(tag)+\'"\\n title="\'+xmlify(tag)+\'">\'+xmlify(tag)+"</a></li>"}}catch(err){_didIteratorError11=true;_iteratorError11=err}finally{try{if(!_iteratorNormalCompletion11&&_iterator11.return){_iterator11.return()}}finally{if(_didIteratorError11){throw _iteratorError11}}}R+="</ul>";return R}var ecm=null,menu=null;return function(bm,eid){var user=bm.user,comment=bm.comment,tags=bm.tags,timestamp=bm.timestamp;var icon=profileIcon(user);var img=icon.querySelector("img");icon.className="entry-user-icon";var ts_short=timestamp.replace(/(?: .+$|\\D)/g,"");var ts_pretty=timestamp.replace(/ .+/,"");var R=toFragment(\'\\n <div class="entry-comment-contents\\n js-ignorable-user-content js-bookmark-item"\\n >\'+toHTML(icon)+\'<span class="entry-comment-username"\\n ><a href="/\'+user+\'/" title="\'+user+\'">\'+user+\'</a\\n ></span\\n ><span class="entry-comment-text js-bookmark-comment"\\n >\'+xmlify(comment)+"</span\\n >"+renderTags({user:user,tags:tags})+\'<p class="entry-comment-meta"\\n ><span class="entry-comment-timestamp"\\n ><a class="js-bookmark-anchor-path" \\n href="/\'+user+"/"+ts_short+"#bookmark-"+eid+\'">\'+ts_pretty+\'</a\\n ></span\\n ><span class="entry-comment-permalink"\\n ><a href="/entry/\'+eid+"/comment/"+user+\'">リンク</a></span\\n ></p></div>\').firstElementChild;if(!(comment||"").match(/\\S/)){var pl=R.querySelector(".entry-comment-permalink");if(pl)pl.parentNode.removeChild(pl)}if(ecm===null){var fetch=function fetch(sel){return(document.querySelector(sel)||{cloneNode:function cloneNode(){return document.createDocumentFragment()}}).cloneNode(true)};ecm=fetch(".entry-comment-menu");menu=fetch(".entry-comment-menu-list")}R.appendChild(ecm.cloneNode(true));R.appendChild(menu.cloneNode(true));return R}}.apply($$pm({NAME:"KaeL.Sns.hatena.bookmark.Entry.Comment.domify"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Commons_DOM_HTML_toFragment,mod_KaeL_Commons_DOM_HTML_toSource,mod_KaeL_Commons_String_xmlify,mod_KaeL_Sns_hatena_User_Icon_get]);var mod_hateb_epp_Favorites_ex=function(window,domifyComment,observeElementsByClassName,addStars){var document=window.document,setTimeout=window.setTimeout;var entry=null;var dict={};function main(container){var ex=document.createElement("div");var silent=document.createElement("div");var cp=container.parentNode;cp.insertBefore(ex,container);cp.insertBefore(silent,container);observeElementsByClassName({"entry-info-favorite-icon":function entryInfoFavoriteIcon(n){var user=n.alt;var bm=dict[user];if(!bm)return;var cmn=domifyComment(bm,entry.eid);var eid=entry.eid;var ts_short=bm.timestamp.replace(/(?: .+$|\\D)/g,"");var meta=cmn.querySelector(".entry-comment-meta");addStars(cmn,{uri:"http://b.hatena.ne.jp/"+user+"/"+ts_short+"#bookmark-"+eid,container:meta});if(String(bm.comment||"").match(/\\S/)){ex.appendChild(cmn)}else{cmn.style.display="inline-block";silent.appendChild(cmn)}}},container)}function observe(){var container=document.querySelector(".entry-info-favorite");if(container)setTimeout(function(){main(container)},500);else setTimeout(observe,200)}return function(e){entry=e;var _iteratorNormalCompletion12=true;var _didIteratorError12=false;var _iteratorError12=undefined;try{for(var _iterator12=entry.bookmarks[Symbol.iterator](),_step12;!(_iteratorNormalCompletion12=(_step12=_iterator12.next()).done);_iteratorNormalCompletion12=true){var bm=_step12.value;dict[bm.user]=bm}}catch(err){_didIteratorError12=true;_iteratorError12=err}finally{try{if(!_iteratorNormalCompletion12&&_iterator12.return){_iterator12.return()}}finally{if(_didIteratorError12){throw _iteratorError12}}}observe()}}.apply($$pm({NAME:"hateb.epp.Favorites.ex"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_bookmark_Entry_Comment_domify,mod_KaeL_DHTML_MutationObserver_classNameBase,mod_KaeL_Sns_hatena_star_add]);var mod_hateb_epp_Tab_append_silentBookmarkers=function(window,domifyComment,appendTab){var CSS_ENTRY=["display: inline-block;","text-align: left;"].join("");var document=window.document,setTimeout=window.setTimeout;function main(_ref2){var eid=_ref2.eid,_ref2$bookmarks=_ref2.bookmarks,bookmarks=_ref2$bookmarks===undefined?[]:_ref2$bookmarks;var _appendTab=appendTab("silent"),tab=_appendTab.tab,panel=_appendTab.panel;tab.innerHTML="コメントなし";panel.style.textAlign="justify";var container=document.createElement("div");container.className="js-bookmarks js-bookmarks-silent";panel.appendChild(container);var count=0;var _iteratorNormalCompletion13=true;var _didIteratorError13=false;var _iteratorError13=undefined;try{for(var _iterator13=bookmarks[Symbol.iterator](),_step13;!(_iteratorNormalCompletion13=(_step13=_iterator13.next()).done);_iteratorNormalCompletion13=true){var bm=_step13.value;if(bm.comment)continue;count++;var entry=domifyComment(bm,eid);entry.style.cssText=CSS_ENTRY;container.appendChild(entry)}}catch(err){_didIteratorError13=true;_iteratorError13=err}finally{try{if(!_iteratorNormalCompletion13&&_iterator13.return){_iterator13.return()}}finally{if(_didIteratorError13){throw _iteratorError13}}}if(count>0)tab.innerHTML+="("+count+")"}return function(entry){function iter(){var tabs=document.querySelector(".js-bookmarks-sort-tabs ul");if(tabs){main(entry)}else{setTimeout(iter,200)}}iter()}}.apply($$pm({NAME:"hateb.epp.Tab.append.silentBookmarkers"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_bookmark_Entry_Comment_domify,mod_KaeL_Sns_hatena_bookmark_Entry_Page_Tab_append]);var mod_hateb_epp_cs_x=function(window,revertURL,withCommentList,favex,silentBookmarkers){return function(){withCommentList(revertURL(window.location.href),function(entry){favex(entry);silentBookmarkers(entry)})}}.apply($$pm({NAME:"hateb.epp.cs.x"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Sns_hatena_bookmark_Entry_revertURL,mod_KaeL_Sns_hatena_bookmark_Entry_Comment_List_with,mod_hateb_epp_Favorites_ex,mod_hateb_epp_Tab_append_silentBookmarkers]);return function(main){main()}(mod_hateb_epp_cs_x)})();\n';var mod_KaeL_Commons_Util_GLOBAL=function(){return function(){return this}.apply(null,[])}.apply($$pm({NAME:"KaeL.Commons.Util.GLOBAL"}),[]);var mod_KaeL_Commons_String_xmlify=function(){return function(s){return(s||"").replace(/&/g,"&").replace(/ /g," ").replace(/</g,"<").replace(/>/g,">").replace(/\"/g,""").replace(/\'/g,"'")}}.apply($$pm({NAME:"KaeL.Commons.String.xmlify"}),[]);var mod_KaeL_WebEx_cs_extern_with=function(window,xmlify){return function(xjs){var doc=window.document;var s=doc.createElement("script");s.setAttribute("class","xjs");s.appendChild(doc.createTextNode("/* XJS */(function(){"+xjs+"})();"));(doc.querySelector("head")||doc.body||doc.documentElement).appendChild(s)}}.apply($$pm({NAME:"KaeL.WebEx.cs.extern.with"}),[mod_KaeL_Commons_Util_GLOBAL,mod_KaeL_Commons_String_xmlify]);var mod_hateb_epp_cs=function(withExtern,XJS){return function main(){withExtern(XJS)}}.apply($$pm({NAME:"hateb.epp.cs"}),[mod_KaeL_WebEx_cs_extern_with,mod_hateb_epp_cs$QTjSIy9$4BOOp0_2fe]);return function(main){main()}(mod_hateb_epp_cs)})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
はてブエントリページ拡張
はてブエントリページ新デザインで見にくくなったコメントなしブクマ専用タブを追加したり、ページのサマリの下にお気に入りユーザのコメント一覧を追加して星をつけやすくしたりするものですよ。
インストール
最初に各ブラウザ対応の greasemonkey およびその互換アドオン(tampermonkeyとか)を導入すべし。
そのあと [Raw] からね。
グリモンじゃなくてブラウザ拡張版ないの?
ブラウザ拡張版は現在AMOに申請中です。
とは言っても今のところソース公開もなし、通らないでしょうね。
github で公開したらいいんですけど、個人的に使ってた自家製モジュールシステムとか、自家製汎用ライブラリとかに依存してて、そのへんまとめて上げないと駄目でしょうね。と言うことで現在整理中です。