2018-09-21 10:09:25 +08:00
flarum . core = function ( t ) { var e = { } ; function n ( i ) { if ( e [ i ] ) return e [ i ] . exports ; var o = e [ i ] = { i : i , l : ! 1 , exports : { } } ; return t [ i ] . call ( o . exports , o , o . exports , n ) , o . l = ! 0 , o . exports } return n . m = t , n . c = e , n . d = function ( t , e , i ) { n . o ( t , e ) || Object . defineProperty ( t , e , { enumerable : ! 0 , get : i } ) } , n . r = function ( t ) { "undefined" != typeof Symbol && Symbol . toStringTag && Object . defineProperty ( t , Symbol . toStringTag , { value : "Module" } ) , Object . defineProperty ( t , "__esModule" , { value : ! 0 } ) } , n . t = function ( t , e ) { if ( 1 & e && ( t = n ( t ) ) , 8 & e ) return t ; if ( 4 & e && "object" == typeof t && t && t . _ _esModule ) return t ; var i = Object . create ( null ) ; if ( n . r ( i ) , Object . defineProperty ( i , "default" , { enumerable : ! 0 , value : t } ) , 2 & e && "string" != typeof t ) for ( var o in t ) n . d ( i , o , function ( e ) { return t [ e ] } . bind ( null , o ) ) ; return i } , n . n = function ( t ) { var e = t && t . _ _esModule ? function ( ) { return t . default } : function ( ) { return t } ; return n . d ( e , "a" , e ) , e } , n . o = function ( t , e ) { return Object . prototype . hasOwnProperty . call ( t , e ) } , n . p = "" , n ( n . s = 89 ) } ( [ function ( t , e , n ) { "use strict" ; function i ( t , e ) { t . prototype = Object . create ( e . prototype ) , t . prototype . constructor = t , t . _ _proto _ _ = e } n . d ( e , "a" , function ( ) { return i } ) } , function ( t , e , n ) { "use strict" ; n . d ( e , "a" , function ( ) { return i } ) ; var i = function ( ) { function t ( t , e ) { void 0 === t && ( t = { } ) , void 0 === e && ( e = null ) , this . data = t , this . freshness = new Date , this . exists = ! 1 , this . store = e } var e = t . prototype ; return e . id = function ( ) { return this . data . id } , e . attribute = function ( t ) { return this . data . attributes [ t ] } , e . pushData = function ( e ) { for ( var n in e ) if ( "object" == typeof e [ n ] ) for ( var i in this . data [ n ] = this . data [ n ] || { } , e [ n ] ) e [ n ] [ i ] instanceof t && ( e [ n ] [ i ] = { data : t . getIdentifier ( e [ n ] [ i ] ) } ) , this . data [ n ] [ i ] = e [ n ] [ i ] ; else this . data [ n ] = e [ n ] ; this . freshness = new Date } , e . pushAttributes = function ( t ) { this . pushData ( { attributes : t } ) } , e . save = function ( e , n ) { var i = this ; void 0 === n && ( n = { } ) ; var o = { type : this . data . type , id : this . data . id , attributes : e } ; if ( e . relationships ) { for ( var r in o . relationships = { } , e . relationships ) { var s = e . relationships [ r ] ; o . relationships [ r ] = { data : s instanceof Array ? s . map ( t . getIdentifier ) : t . getIdentifier ( s ) } } delete e . relationships } var a = this . copyData ( ) ; this . pushData ( o ) ; var u = { data : o } ; return n . meta && ( u . meta = n . meta ) , app . request ( Object . assign ( { method : this . exists ? "PATCH" : "POST" , url : app . forum . attribute ( "apiUrl" ) + this . apiEndpoint ( ) , data : u } , n ) ) . then ( function ( t ) { return i . store . data [ t . data . type ] = i . store . data [ t . data . type ] || { } , i . store . data [ t . data . type ] [ t . data . id ] = i , i . store . pushPayload ( t ) } , function ( t ) { throw i . pushData ( a ) , m . lazyRedraw ( ) , t } ) } , e . delete = function ( t , e ) { var n = this ; return void 0 === e && ( e = { } ) , this . exists ? app . request ( Object . assign ( { method : "DELETE" , url : app . forum . attribute ( "apiUrl" ) + this . apiEndpoint ( ) , data : t } , e ) ) . then ( function ( ) { n . exists = ! 1 , n . store . remove ( n ) } ) : m . deferred . resolve ( ) . promise } , e . apiEndpoint = function ( ) { return "/" + this . data . type + ( this . exists ? "/" + this . data . id : "" ) } , e . copyData = function ( ) { return JSON . parse ( JSON . stringify ( this . data ) ) } , t . attribute = function ( t , e ) { return function ( ) { var n = this . data . attributes && this . data . attributes [ t ] ; return e ? e ( n ) : n } } , t . hasOne = function ( t ) { return function ( ) { if ( this . data . relationships ) { var e = this . data . relationships [ t ] ; if ( e ) return app . store . getById ( e . data . type , e . data . id ) } return ! 1 } } , t . hasMany = function ( t ) { return function ( ) { if ( this . data . relationships ) { var e = this . data . relationships [ t ] ; if ( e ) return e . data . map ( function ( t ) { return app . store . getById ( t . type , t . id ) } ) } return ! 1 } } , t . transformDate = function ( t ) { return t ? new Date ( t ) : null } , t . getIdentifier = function ( t ) { return { type : t . data . type , id : t . data . id } } , t } ( ) } , function ( t , e , n ) { "use strict" ; n . d ( e , "a" , function ( ) { return i } ) ; var i = function ( ) { function t ( t , e ) { void 0 === t && ( t = { } ) , void 0 === e && ( e = null ) , e && ( t . children = e ) , this . constructor . initProps ( t ) , this . props = t , this . element = null , this . retain = ! 1 , this . init ( ) } var e = t . prototype ; return e . init = function ( ) { } , e . onunload = function ( ) { } , e . render = function ( ) { var t = this , e = this . retain ? { subtree : "retain" } : this . view ( ) ; e . attrs = e . attrs || { } ; var n = e . attrs . config ; return e . attrs . config = function ( ) { for ( var e = arguments . length , i = new Array ( e ) , o = 0 ; o < e ; o ++ ) i [ o ] = arguments [ o ] ; t . element = i [ 0 ] , t . config . apply ( t , i . slice ( 1 ) ) , n && n . apply ( t , i ) } , e } , e . $ = function ( t ) { function e ( e ) { return t . apply ( this , arguments ) } return
2018-06-20 11:50:31 +08:00
/ * !
* jQuery JavaScript Library v3 . 3.1
* https : //jquery.com/
*
* Includes Sizzle . js
* https : //sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https : //jquery.org/license
*
* Date : 2018 - 01 - 20 T17 : 24 Z
* /
/ * !
* jQuery JavaScript Library v3 . 3.1
* https : //jquery.com/
*
* Includes Sizzle . js
* https : //sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https : //jquery.org/license
*
* Date : 2018 - 01 - 20 T17 : 24 Z
* /
2018-09-17 02:51:11 +08:00
! function ( e , n ) { "use strict" ; "object" == typeof t && "object" == typeof t . exports ? t . exports = e . document ? n ( e , ! 0 ) : function ( t ) { if ( ! t . document ) throw new Error ( "jQuery requires a window with a document" ) ; return n ( t ) } : n ( e ) } ( "undefined" != typeof window ? window : this , function ( n , o ) { "use strict" ; var r = [ ] , s = n . document , a = Object . getPrototypeOf , u = r . slice , c = r . concat , l = r . push , d = r . indexOf , p = { } , h = p . toString , f = p . hasOwnProperty , m = f . toString , v = m . call ( Object ) , g = { } , y = function ( t ) { return "function" == typeof t && "number" != typeof t . nodeType } , b = function ( t ) { return null != t && t === t . window } , w = { type : ! 0 , src : ! 0 , noModule : ! 0 } ; function x ( t , e , n ) { var i , o = ( e = e || s ) . createElement ( "script" ) ; if ( o . text = t , n ) for ( i in w ) n [ i ] && ( o [ i ] = n [ i ] ) ; e . head . appendChild ( o ) . parentNode . removeChild ( o ) } function _ ( t ) { return null == t ? t + "" : "object" == typeof t || "function" == typeof t ? p [ h . call ( t ) ] || "object" : typeof t } var N = function ( t , e ) { return new N . fn . init ( t , e ) } , k = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g ; function T ( t ) { var e = ! ! t && "length" in t && t . length , n = _ ( t ) ; return ! y ( t ) && ! b ( t ) && ( "array" === n || 0 === e || "number" == typeof e && e > 0 && e - 1 in t ) } N . fn = N . prototype = { jquery : "3.3.1" , constructor : N , length : 0 , toArray : function ( ) { return u . call ( this ) } , get : function ( t ) { return null == t ? u . call ( this ) : t < 0 ? this [ t + this . length ] : this [ t ] } , pushStack : function ( t ) { var e = N . merge ( this . constructor ( ) , t ) ; return e . prevObject = this , e } , each : function ( t ) { return N . each ( this , t ) } , map : function ( t ) { return this . pushStack ( N . map ( this , function ( e , n ) { return t . call ( e , n , e ) } ) ) } , slice : function ( ) { return this . pushStack ( u . apply ( this , arguments ) ) } , first : function ( ) { return this . eq ( 0 ) } , last : function ( ) { return this . eq ( - 1 ) } , eq : function ( t ) { var e = this . length , n = + t + ( t < 0 ? e : 0 ) ; return this . pushStack ( n >= 0 && n < e ? [ this [ n ] ] : [ ] ) } , end : function ( ) { return this . prevObject || this . constructor ( ) } , push : l , sort : r . sort , splice : r . splice } , N . extend = N . fn . extend = function ( ) { var t , e , n , i , o , r , s = arguments [ 0 ] || { } , a = 1 , u = arguments . length , c = ! 1 ; for ( "boolean" == typeof s && ( c = s , s = arguments [ a ] || { } , a ++ ) , "object" == typeof s || y ( s ) || ( s = { } ) , a === u && ( s = this , a -- ) ; a < u ; a ++ ) if ( null != ( t = arguments [ a ] ) ) for ( e in t ) n = s [ e ] , s !== ( i = t [ e ] ) && ( c && i && ( N . isPlainObject ( i ) || ( o = Array . isArray ( i ) ) ) ? ( o ? ( o = ! 1 , r = n && Array . isArray ( n ) ? n : [ ] ) : r = n && N . isPlainObject ( n ) ? n : { } , s [ e ] = N . extend ( c , r , i ) ) : void 0 !== i && ( s [ e ] = i ) ) ; return s } , N . extend ( { expando : "jQuery" + ( "3.3.1" + Math . random ( ) ) . replace ( /\D/g , "" ) , isReady : ! 0 , error : function ( t ) { throw new Error ( t ) } , noop : function ( ) { } , isPlainObject : function ( t ) { var e , n ; return ! ( ! t || "[object Object]" !== h . call ( t ) ) && ( ! ( e = a ( t ) ) || "function" == typeof ( n = f . call ( e , "constructor" ) && e . constructor ) && m . call ( n ) === v ) } , isEmptyObject : function ( t ) { var e ; for ( e in t ) return ! 1 ; return ! 0 } , globalEval : function ( t ) { x ( t ) } , each : function ( t , e ) { var n , i = 0 ; if ( T ( t ) ) for ( n = t . length ; i < n && ! 1 !== e . call ( t [ i ] , i , t [ i ] ) ; i ++ ) ; else for ( i in t ) if ( ! 1 === e . call ( t [ i ] , i , t [ i ] ) ) break ; return t } , trim : function ( t ) { return null == t ? "" : ( t + "" ) . replace ( k , "" ) } , makeArray : function ( t , e ) { var n = e || [ ] ; return null != t && ( T ( Object ( t ) ) ? N . merge ( n , "string" == typeof t ? [ t ] : t ) : l . call ( n , t ) ) , n } , inArray : function ( t , e , n ) { return null == e ? - 1 : d . call ( e , t , n ) } , merge : function ( t , e ) { for ( var n = + e . length , i = 0 , o = t . length ; i < n ; i ++ ) t [ o ++ ] = e [ i ] ; return t . length = o , t } , grep : function ( t , e , n ) { for ( var i = [ ] , o = 0 , r = t . length , s = ! n ; o < r ; o ++ ) ! e ( t [ o ] , o ) !== s && i . push ( t [ o ] ) ; return i } , map : function ( t , e , n ) { var i , o , r = 0 , s = [ ] ; if ( T ( t ) ) for ( i = t . length ; r < i ; r ++ ) null != ( o = e ( t [ r ] , r , n ) ) && s . push ( o ) ; else for ( r in t ) null != ( o = e ( t [ r ] , r , n ) ) && s . push ( o ) ; return c . apply ( [ ] , s ) } , guid : 1 , support : g } ) , "function" == typeof Symbol && ( N . fn [ Symbol . iterator ] = r [ Symbol . iterator ] ) , N . each ( "Boolean Number String Function Array Date RegExp Object Error Symbol" . split ( " " ) , function ( t , e ) { p [ "[object " + e + "]" ] = e . toLowerCase ( ) } ) ; var S =
2018-06-20 11:50:31 +08:00
/ * !
* Sizzle CSS Selector Engine v2 . 3.3
* https : //sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http : //jquery.org/license
*
* Date : 2016 - 08 - 08
* /
2018-09-21 10:09:25 +08:00
function ( t ) { var e , n , i , o , r , s , a , u , c , l , d , p , h , f , m , v , g , y , b , w = "sizzle" + 1 * new Date , x = t . document , _ = 0 , N = 0 , k = st ( ) , T = st ( ) , S = st ( ) , O = function ( t , e ) { return t === e && ( d = ! 0 ) , 0 } , C = { } . hasOwnProperty , D = [ ] , j = D . pop , E = D . push , P = D . push , M = D . slice , A = function ( t , e ) { for ( var n = 0 , i = t . length ; n < i ; n ++ ) if ( t [ n ] === e ) return n ; return - 1 } , I = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped" , $ = "[\\x20\\t\\r\\n\\f]" , R = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+" , L = "\\[" + $ + "*(" + R + ")(?:" + $ + "*([*^$|!~]?=)" + $ + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + R + "))|)" + $ + "*\\]" , H = ":(" + R + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + L + ")*)|.*)\\)|)" , B = new RegExp ( $ + "+" , "g" ) , U = new RegExp ( "^" + $ + "+|((?:^|[^\\\\])(?:\\\\.)*)" + $ + "+$" , "g" ) , Y = new RegExp ( "^" + $ + "*," + $ + "*" ) , F = new RegExp ( "^" + $ + "*([>+~]|" + $ + ")" + $ + "*" ) , q = new RegExp ( "=" + $ + "*([^\\]'\"]*?)" + $ + "*\\]" , "g" ) , W = new RegExp ( H ) , z = new RegExp ( "^" + R + "$" ) , G = { ID : new RegExp ( "^#(" + R + ")" ) , CLASS : new RegExp ( "^\\.(" + R + ")" ) , TAG : new RegExp ( "^(" + R + "|[*])" ) , ATTR : new RegExp ( "^" + L ) , PSEUDO : new RegExp ( "^" + H ) , CHILD : new RegExp ( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + $ + "*(even|odd|(([+-]|)(\\d*)n|)" + $ + "*(?:([+-]|)" + $ + "*(\\d+)|))" + $ + "*\\)|)" , "i" ) , bool : new RegExp ( "^(?:" + I + ")$" , "i" ) , needsContext : new RegExp ( "^" + $ + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + $ + "*((?:-\\d)?\\d*)" + $ + "*\\)|)(?=[^-]|$)" , "i" ) } , V = /^(?:input|select|textarea|button)$/i , Z = /^h\d$/i , K = /^[^{]+\{\s*\[native \w/ , X = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/ , J = /[+~]/ , Q = new RegExp ( "\\\\([\\da-f]{1,6}" + $ + "?|(" + $ + ")|.)" , "ig" ) , tt = function ( t , e , n ) { var i = "0x" + e - 65536 ; return i != i || n ? e : i < 0 ? String . fromCharCode ( i + 65536 ) : String . fromCharCode ( i >> 10 | 55296 , 1023 & i | 56320 ) } , et = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g , nt = function ( t , e ) { return e ? "\0" === t ? "<22> " : t . slice ( 0 , - 1 ) + "\\" + t . charCodeAt ( t . length - 1 ) . toString ( 16 ) + " " : "\\" + t } , it = function ( ) { p ( ) } , ot = yt ( function ( t ) { return ! 0 === t . disabled && ( "form" in t || "label" in t ) } , { dir : "parentNode" , next : "legend" } ) ; try { P . apply ( D = M . call ( x . childNodes ) , x . childNodes ) , D [ x . childNodes . length ] . nodeType } catch ( t ) { P = { apply : D . length ? function ( t , e ) { E . apply ( t , M . call ( e ) ) } : function ( t , e ) { for ( var n = t . length , i = 0 ; t [ n ++ ] = e [ i ++ ] ; ) ; t . length = n - 1 } } } function rt ( t , e , i , o ) { var r , a , c , l , d , f , g , y = e && e . ownerDocument , _ = e ? e . nodeType : 9 ; if ( i = i || [ ] , "string" != typeof t || ! t || 1 !== _ && 9 !== _ && 11 !== _ ) return i ; if ( ! o && ( ( e ? e . ownerDocument || e : x ) !== h && p ( e ) , e = e || h , m ) ) { if ( 11 !== _ && ( d = X . exec ( t ) ) ) if ( r = d [ 1 ] ) { if ( 9 === _ ) { if ( ! ( c = e . getElementById ( r ) ) ) return i ; if ( c . id === r ) return i . push ( c ) , i } else if ( y && ( c = y . getElementById ( r ) ) && b ( e , c ) && c . id === r ) return i . push ( c ) , i } else { if ( d [ 2 ] ) return P . apply ( i , e . getElementsByTagName ( t ) ) , i ; if ( ( r = d [ 3 ] ) && n . getElementsByClassName && e . getElementsByClassName ) return P . apply ( i , e . getElementsByClassName ( r ) ) , i } if ( n . qsa && ! S [ t + " " ] && ( ! v || ! v . test ( t ) ) ) { if ( 1 !== _ ) y = e , g = t ; else if ( "object" !== e . nodeName . toLowerCase ( ) ) { for ( ( l = e . getAttribute ( "id" ) ) ? l = l . replace ( et , nt ) : e . setAttribute ( "id" , l = w ) , a = ( f = s ( t ) ) . length ; a -- ; ) f [ a ] = "#" + l + " " + gt ( f [ a ] ) ; g = f . join ( "," ) , y = J . test ( t ) && mt ( e . parentNode ) || e } if ( g ) try { return P . apply ( i , y . querySelectorAll ( g ) ) , i } catch ( t ) { } finally { l === w && e . removeAttribute ( "id" ) } } } return u ( t . replace ( U , "$1" ) , e , i , o ) } function st ( ) { var t = [ ] ; return function e ( n , o ) { return t . push ( n + " " ) > i . cacheLength && delete e [ t . shift ( ) ] , e [ n + " " ] = o } } function at ( t ) { return t [ w ] = ! 0 , t } function ut ( t ) { var e = h . createElement ( "fieldset" ) ; try { return ! ! t ( e ) } catch ( t ) { return ! 1 } finally { e . parentNode && e . parentNode . removeChild ( e ) , e = null } } function ct ( t , e ) { for ( var n = t . split ( "|" ) , o = n . length ; o -- ; ) i . attrHandle [ n [ o ] ] = e } function lt ( t , e ) { var n = e && t , i = n && 1 === t . nodeType && 1 === e . nodeType && t . sourceIndex - e . sourceIndex ; if ( i ) return i ; if ( n ) for ( ; n = n . nextSibling ; ) if ( n === e ) return - 1 ; return t ? 1 : - 1 } function dt ( t ) { return function ( e ) { return "input" === e . nodeName . toLowerCase ( ) && e . type === t } } function pt ( t ) { return function ( e ) { var n = e . nodeName . toLowerCase ( ) ; return ( "input" === n || "button" === n ) && e . type === t } } function ht ( t ) { return function ( e ) { return "form" in e ? e . parentNode && ! 1 === e . disabled ? "label" in e ? "label" in e . parentNode ? e . parentNode . disabled === t : e . disabled === t : e . isDisab
2018-06-20 11:50:31 +08:00
/ * !
* Color Thief v2 . 0
* by Lokesh Dhakar - http : //www.lokeshdhakar.com
*
* Thanks
* -- -- --
* Nick Rabinowitz - For creating quantize . js .
* John Schulz - For clean up and optimization . @ JFSIII
* Nathan Spady - For adding drag and drop support to the demo page .
*
* License
* -- -- -- -
* Copyright 2011 , 2015 Lokesh Dhakar
* Released under the MIT license
* https : //raw.githubusercontent.com/lokesh/color-thief/master/LICENSE
*
* /
var n = function ( t ) { this . canvas = document . createElement ( "canvas" ) , this . context = this . canvas . getContext ( "2d" ) , document . body . appendChild ( this . canvas ) , this . width = this . canvas . width = t . width , this . height = this . canvas . height = t . height , this . context . drawImage ( t , 0 , 0 , this . width , this . height ) } ; n . prototype . clear = function ( ) { this . context . clearRect ( 0 , 0 , this . width , this . height ) } , n . prototype . update = function ( t ) { this . context . putImageData ( t , 0 , 0 ) } , n . prototype . getPixelCount = function ( ) { return this . width * this . height } , n . prototype . getImageData = function ( ) { return this . context . getImageData ( 0 , 0 , this . width , this . height ) } , n . prototype . removeCanvas = function ( ) { this . canvas . parentNode . removeChild ( this . canvas ) } ; var i = function ( ) { } ;
/ * !
* quantize . js Copyright 2008 Nick Rabinowitz .
* Licensed under the MIT license : http : //www.opensource.org/licenses/mit-license.php
* /
/ * !
* Block below copied from Protovis : http : //mbostock.github.com/protovis/
* Copyright 2010 Stanford Visualization Group
* Licensed under the BSD License : http : //www.opensource.org/licenses/bsd-license.php
2018-09-21 10:09:25 +08:00
* / i f ( i . p r o t o t y p e . g e t C o l o r = f u n c t i o n ( t , e ) { r e t u r n t h i s . g e t P a l e t t e ( t , 5 , e ) [ 0 ] } , i . p r o t o t y p e . g e t P a l e t t e = f u n c t i o n ( t , e , i ) { v o i d 0 = = = e & & ( e = 1 0 ) , ( v o i d 0 = = = i | | 1 > i ) & & ( i = 1 0 ) ; f o r ( v a r o , s , a , u , c = n e w n ( t ) , l = c . g e t I m a g e D a t a ( ) . d a t a , d = c . g e t P i x e l C o u n t ( ) , p = [ ] , h = 0 ; d > h ; h + = i ) s = l [ ( o = 4 * h ) + 0 ] , a = l [ o + 1 ] , u = l [ o + 2 ] , l [ o + 3 ] > = 1 2 5 & & ( s > 2 5 0 & & a > 2 5 0 & & u > 2 5 0 | | p . p u s h ( [ s , a , u ] ) ) ; v a r f = r . q u a n t i z e ( p , e ) , m = f ? f . p a l e t t e ( ) : n u l l ; r e t u r n c . r e m o v e C a n v a s ( ) , m } , ! o ) v a r o = { m a p : f u n c t i o n ( t , e ) { v a r n = { } ; r e t u r n e ? t . m a p ( f u n c t i o n ( t , i ) { r e t u r n n . i n d e x = i , e . c a l l ( n , t ) } ) : t . s l i c e ( ) } , n a t u r a l O r d e r : f u n c t i o n ( t , e ) { r e t u r n e > t ? - 1 : t > e ? 1 : 0 } , s u m : f u n c t i o n ( t , e ) { v a r n = { } ; r e t u r n t . r e d u c e ( e ? f u n c t i o n ( t , i , o ) { r e t u r n n . i n d e x = o , t + e . c a l l ( n , i ) } : f u n c t i o n ( t , e ) { r e t u r n t + e } , 0 ) } , m a x : f u n c t i o n ( t , e ) { r e t u r n M a t h . m a x . a p p l y ( n u l l , e ? o . m a p ( t , e ) : t ) } } ; v a r r = f u n c t i o n ( ) { f u n c t i o n t ( t , e , n ) { r e t u r n ( t < < 2 * u ) + ( e < < u ) + n } f u n c t i o n e ( t ) { f u n c t i o n e ( ) { n . s o r t ( t ) , i = ! 0 } v a r n = [ ] , i = ! 1 ; r e t u r n { p u s h : f u n c t i o n ( t ) { n . p u s h ( t ) , i = ! 1 } , p e e k : f u n c t i o n ( t ) { r e t u r n i | | e ( ) , v o i d 0 = = = t & & ( t = n . l e n g t h - 1 ) , n [ t ] } , p o p : f u n c t i o n ( ) { r e t u r n i | | e ( ) , n . p o p ( ) } , s i z e : f u n c t i o n ( ) { r e t u r n n . l e n g t h } , m a p : f u n c t i o n ( t ) { r e t u r n n . m a p ( t ) } , d e b u g : f u n c t i o n ( ) { r e t u r n i | | e ( ) , n } } } f u n c t i o n n ( t , e , n , i , o , r , s ) { v a r a = t h i s ; a . r 1 = t , a . r 2 = e , a . g 1 = n , a . g 2 = i , a . b 1 = o , a . b 2 = r , a . h i s t o = s } f u n c t i o n i ( ) { t h i s . v b o x e s = n e w e ( f u n c t i o n ( t , e ) { r e t u r n o . n a t u r a l O r d e r ( t . v b o x . c o u n t ( ) * t . v b o x . v o l u m e ( ) , e . v b o x . c o u n t ( ) * e . v b o x . v o l u m e ( ) ) } ) } f u n c t i o n r ( e ) { v a r n , i , o , r , s = n e w A r r a y ( 1 < < 3 * u ) ; r e t u r n e . f o r E a c h ( f u n c t i o n ( e ) { i = e [ 0 ] > > c , o = e [ 1 ] > > c , r = e [ 2 ] > > c , n = t ( i , o , r ) , s [ n ] = ( s [ n ] | | 0 ) + 1 } ) , s } f u n c t i o n s ( t , e ) { v a r i , o , r , s = 1 e 6 , a = 0 , u = 1 e 6 , l = 0 , d = 1 e 6 , p = 0 ; r e t u r n t . f o r E a c h ( f u n c t i o n ( t ) { i = t [ 0 ] > > c , o = t [ 1 ] > > c , r = t [ 2 ] > > c , s > i ? s = i : i > a & & ( a = i ) , u > o ? u = o : o > l & & ( l = o ) , d > r ? d = r : r > p & & ( p = r ) } ) , n e w n ( s , a , u , l , d , p , e ) } f u n c t i o n a ( e , n ) { i f ( n . c o u n t ( ) ) { v a r i = n . r 2 - n . r 1 + 1 , r = n . g 2 - n . g 1 + 1 , s = n . b 2 - n . b 1 + 1 , a = o . m a x ( [ i , r , s ] ) ; i f ( 1 = = n . c o u n t ( ) ) r e t u r n [ n . c o p y ( ) ] ; v a r u , c , l , d , p = 0 , h = [ ] , f = [ ] ; i f ( a = = i ) f o r ( u = n . r 1 ; u < = n . r 2 ; u + + ) { f o r ( d = 0 , c = n . g 1 ; c < = n . g 2 ; c + + ) f o r ( l = n . b 1 ; l < = n . b 2 ; l + + ) d + = e [ t ( u , c , l ) ] | | 0 ; p + = d , h [ u ] = p } e l s e i f ( a = = r ) f o r ( u = n . g 1 ; u < = n . g 2 ; u + + ) { f o r ( d = 0 , c = n . r 1 ; c < = n . r 2 ; c + + ) f o r ( l = n . b 1 ; l < = n . b 2 ; l + + ) d + = e [ t ( c , u , l ) ] | | 0 ; p + = d , h [ u ] = p } e l s e f o r ( u = n . b 1 ; u < = n . b 2 ; u + + ) { f o r ( d = 0 , c = n . r 1 ; c < = n . r 2 ; c + + ) f o r ( l = n . g 1 ; l < = n . g 2 ; l + + ) d + = e [ t ( c , l , u ) ] | | 0 ; p + = d , h [ u ] = p } r e t u r n h . f o r E a c h ( f u n c t i o n ( t , e ) { f [ e ] = p - t } ) , f u n c t i o n ( t ) { v a r e , i , o , r , s , a = t + " 1 " , c = t + " 2 " , l = 0 ; f o r ( u = n [ a ] ; u < = n [ c ] ; u + + ) i f ( h [ u ] > p / 2 ) { f o r ( o = n . c o p y ( ) , r = n . c o p y ( ) , e = u - n [ a ] , s = ( i = n [ c ] - u ) > = e ? M a t h . m i n ( n [ c ] - 1 , ~ ~ ( u + i / 2 ) ) : M a t h . m a x ( n [ a ] , ~ ~ ( u - 1 - e / 2 ) ) ; ! h [ s ] ; ) s + + ; f o r ( l = f [ s ] ; ! l & & h [ s - 1 ] ; ) l = f [ - - s ] ; r e t u r n o [ c ] = s , r [ a ] = o [ c ] + 1 , [ o , r ] } } ( a = = i ? " r " : a = = r ? " g " : " b " ) } } v a r u = 5 , c = 8 - u , l = 1 e 3 , d = . 7 5 ; r e t u r n n . p r o t o t y p e = { v o l u m e : f u n c t i o n ( t ) { v a r e = t h i s ; r e t u r n ( ! e . _ v o l u m e | | t ) & & ( e . _ v o l u m e = ( e . r 2 - e . r 1 + 1 ) * ( e . g 2 - e . g 1 + 1 ) * ( e . b 2 - e . b 1 + 1 ) ) , e . _ v o l u m e } , c o u n t : f u n c t i o n ( e ) { v a r n = t h i s , i = n . h i s t o ; i f ( ! n . _ c o u n t _ s e t | | e ) { v a r o , r , s , a = 0 ; f o r ( o = n . r 1 ; o < = n . r 2 ; o + + ) f o r ( r = n . g 1 ; r < = n . g 2 ; r + + ) f o r ( s = n . b 1 ; s < = n . b 2 ; s + + ) i n d e x = t ( o , r , s ) , a + = i [ i n d e x ] | | 0 ; n . _ c o u n t = a , n . _ c o u n t _ s e t = ! 0 } r e t u r n n . _ c o u n t } , c o p y : f u n c t i o n ( ) { v a r t = t h i s ; r e t u r n n e w n ( t . r 1 , t . r 2 , t . g 1 , t . g 2 , t . b 1 , t . b 2 , t . h i s t o ) } , a v g : f u n c t i o n ( e ) { v a r n = t h i s , i = n . h i s t o ; i f ( ! n . _ a v g | | e ) { v a r o , r , s , a , c = 0 , l = 1 < < 8 - u , d = 0 , p = 0 , h = 0 ; f o r ( r = n . r 1 ; r < = n . r 2 ; r + + ) f o r ( s = n . g 1 ; s < = n . g 2 ; s + + ) f o r ( a = n . b 1 ; a < = n . b 2 ; a + + ) c + = o = i [ t ( r , s , a ) ] | | 0 , d + = o * ( r + . 5 ) * l , p + = o * ( s + . 5 ) * l , h + = o * ( a + . 5 ) * l ; n . _ a v g = c ? [ ~ ~ ( d / c ) , ~ ~ ( p / c ) , ~ ~ ( h / c ) ] : [ ~ ~ ( l * ( n . r 1 + n . r 2 + 1 ) / 2 ) , ~ ~ ( l * ( n . g 1 + n . g 2 + 1 ) / 2 ) , ~ ~ ( l * ( n . b 1 + n . b 2 + 1 ) / 2 ) ] } r e t u r n n . _ a v g } , c o n t a i n s : f u n c t i o n ( t ) { v a r e = t h i s , n = t [ 0 ] > > c ; r e t u r n g v a l = t [ 1 ] > > c , b v a l = t [ 2 ] > > c , n > = e . r 1 & & n < = e . r 2 & & g v a l > = e . g 1 & & g v a l < = e . g 2 & & b v a l > = e . b 1 & & b v a l < = e . b 2 } } , i . p r o t o t y p e = { p u s h : f u n c t i o n ( t ) { t h i s . v b o x e s . p u s h ( { v b o x : t , c o l o r : t . a v g ( ) } ) } , p a l e t t e : f u n c t i o n ( ) { r e t u r n t h i s . v b o x e s . m a p ( f u n c t i o n ( t ) { r e t u r n t . c o l o r } ) } , s i z e : f u n c t i o n ( ) { r e t u r n t h i s . v b o x e s . s i z e ( ) } , m a p : f u n c t i o n ( t ) { f o r ( v a r e = t h i s . v b o x e s , n = 0 ; n < e . s i z e ( ) ; n + + ) i f ( e . p e e k ( n ) . v b o x . c o n t a i n s ( t ) ) r e t u r n e . p e e k ( n ) . c o l o r ; r e t u r n t h i s . n e a r e s t ( t ) } , n e a r e s t : f u n c t i o n ( t ) { f o r ( v a r e , n , i , o = t h i s . v b o x e s , r = 0 ; r < o . s i z e ( ) ; r + + ) ( e > ( n = M a t h . s q r t ( M a t h . p o w ( t [ 0 ] - o . p e e k ( r ) . c o l o r [ 0 ] , 2 ) + M a t h . p o w ( t [ 1 ] - o . p e e k ( r ) . c o l o r [ 1 ] , 2 ) + M a t h . p o w ( t [ 2 ] - o . p e e k ( r ) . c o l o r [ 2 ] , 2 ) ) ) | | v o i d 0 = = = e ) & & ( e = n , i = o . p e e k ( r ) . c o l o r ) ; r e t u r n i } , f o r c e b w : f u n c t i o n ( ) { v a r t = t h i s . v b o x e s ; t . s o r t ( f u n c t i o n ( t , e ) { r e t u r n o . n a t u r a l O r d e r ( o . s u m ( t . c o l o r ) , o . s u m ( e . c o l o r ) ) } ) ; v
2018-06-20 11:50:31 +08:00
//# sourceMappingURL=forum.js.map