
 
 >   c l i p t r i m - u i @ 2 . 0 . 0   b u i l d : d l l 
 
 >   c r o s s - e n v   N O D E _ E N V = d e v e l o p m e n t   T S _ N O D E _ T R A N S P I L E _ O N L Y = t r u e   N O D E _ O P T I O N S = " - r   t s - n o d e / r e g i s t e r   - - n o - w a r n i n g s "   w e b p a c k   - - c o n f i g   . / . e r b / c o n f i g s / w e b p a c k . c o n f i g . r e n d e r e r . d e v . d l l . t s 
 
 
 
  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m   i n    [ 1 m . / n o d e _ m o d u l e s / @ t a i l w i n d c s s / o x i d e - w i n 3 2 - x 6 4 - m s v c / t a i l w i n d c s s - o x i d e . w i n 3 2 - x 6 4 - m s v c . n o d e  [ 3 9 m  [ 2 2 m    [ 1 m  [ 3 2 m 1 : 2  [ 3 9 m  [ 2 2 m 
 
  [ 1 m M o d u l e   p a r s e    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m :    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   c h a r a c t e r   ' )"%\%'   ( 1 : 2 ) 
 
 Y o u   m a y   n e e d   a n   a p p r o p r i a t e   l o a d e r   t o   h a n d l e   t h i s   f i l e   t y p e ,   c u r r e n t l y   n o   l o a d e r s   a r e   c o n f i g u r e d   t o   p r o c e s s   t h i s   f i l e .   S e e   h t t p s : / / w e b p a c k . j s . o r g / c o n c e p t s # l o a d e r s 
 
 ( S o u r c e   c o d e   o m i t t e d   f o r   t h i s   b i n a r y   f i l e )  [ 3 9 m  [ 2 2 m 
 
   @   . / n o d e _ m o d u l e s / @ t a i l w i n d c s s / o x i d e / i n d e x . j s   1 3 1 : 2 4 - 6 8 
 
   @   . / n o d e _ m o d u l e s / @ t a i l w i n d c s s / p o s t c s s / d i s t / i n d e x . m j s   1 : 1 0 2 8 - 1 0 7 4   1 0 : 4 8 4 9 - 4 8 5 1 
 
   @   d l l   r e n d e r e r   r e n d e r e r [ 1 0 ] 
 
 
 
  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m   i n    [ 1 m . / n o d e _ m o d u l e s / l i g h t n i n g c s s / n o d e / i n d e x . j s  [ 3 9 m  [ 2 2 m    [ 1 m  [ 3 2 m 1 7 : 2 - 3 6  [ 3 9 m  [ 2 2 m 
 
  [ 1 m M o d u l e    [ 1 m  [ 3 1 m n o t   f o u n d  [ 3 9 m  [ 2 2 m  [ 1 m :    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m :   C a n ' t   r e s o l v e   ' . . / p k g '   i n   ' C : \ U s e r s \ m i c k l \ D e s k t o p \ c l i p t r i m - u i \ C l i p T r i m A p p \ e l e c t r o n - u i \ n o d e _ m o d u l e s \ l i g h t n i n g c s s \ n o d e '  [ 3 9 m  [ 2 2 m 
 
   @   . / n o d e _ m o d u l e s / l i g h t n i n g c s s / n o d e / i n d e x . m j s   1 : 0 - 3 1   3 : 1 1 8 - 1 2 3 
 
   @   . / n o d e _ m o d u l e s / @ t a i l w i n d c s s / n o d e / d i s t / i n d e x . m j s   1 5 : 1 8 0 - 2 3 6   1 5 : 3 4 5 - 3 4 7   1 5 : 4 8 8 - 4 9 7   1 5 : 4 9 8 - 5 1 2   1 5 : 5 2 1 - 5 4 0   1 5 : 5 4 1 - 5 5 4   1 5 : 5 5 5 - 5 6 6 
 
   @   . / n o d e _ m o d u l e s / @ t a i l w i n d c s s / p o s t c s s / d i s t / i n d e x . m j s   1 : 8 3 3 - 9 5 9   1 0 : 2 5 5 9 - 2 5 6 7   1 0 : 3 1 3 5 - 3 1 3 7   1 0 : 3 8 5 6 - 3 8 5 8   1 0 : 3 9 6 1 - 3 9 6 7   1 0 : 3 9 6 8 - 3 9 8 1   1 0 : 3 9 8 2 - 3 9 8 8   1 0 : 4 1 0 9 - 4 1 1 6   1 0 : 4 9 4 2 - 4 9 5 4   1 0 : 5 0 2 1 - 5 0 3 3   1 0 : 5 8 0 1 - 5 8 0 3   1 0 : 1 8 3 7 - 1 8 8 8   1 0 : 2 3 1 6 - 2 3 1 8   1 0 : 2 3 5 4 - 2 3 5 6 
 
   @   d l l   r e n d e r e r   r e n d e r e r [ 1 0 ] 
 
 
 
  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m   i n    [ 1 m . / n o d e _ m o d u l e s / s o c k e t i o / n o d e _ m o d u l e s / s o c k e t . i o - c l i e n t / d i s t / s o c k e t . i o . j s . m a p  [ 3 9 m  [ 2 2 m    [ 1 m  [ 3 2 m 1 : 1 0  [ 3 9 m  [ 2 2 m 
 
  [ 1 m M o d u l e   p a r s e    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m :    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   t o k e n   ( 1 : 1 0 ) 
 
 Y o u   m a y   n e e d   a n   a p p r o p r i a t e   l o a d e r   t o   h a n d l e   t h i s   f i l e   t y p e ,   c u r r e n t l y   n o   l o a d e r s   a r e   c o n f i g u r e d   t o   p r o c e s s   t h i s   f i l e .   S e e   h t t p s : / / w e b p a c k . j s . o r g / c o n c e p t s # l o a d e r s 
 
 >   { " v e r s i o n " : 3 , " f i l e " : " s o c k e t . i o . j s " , " s o u r c e s " : [ " w e b p a c k : / / / w e b p a c k / u n i v e r s a l M o d u l e D e f i n i t i o n " , " w e b p a c k : / / / w e b p a c k / b o o t s t r a p   1 2 f 6 3 9 6 a 1 5 c 6 0 a 1 e 9 6 b 0 " , " w e b p a c k : / / / l i b / i n d e x . j s " , " w e b p a c k : / / / l i b / u r l . j s " , " w e b p a c k : / / / . / ~ / p a r s e u r i / i n d e x . j s " , " w e b p a c k : / / / . / ~ / d e b u g / b r o w s e r . j s " , " w e b p a c k : / / / . / ~ / p r o c e s s / b r o w s e r . j s " , " w e b p a c k : / / / . / ~ / d e b u g / d e b u g . j s " , " w e b p a c k : / / / . / ~ / m s / i n d e x . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / i n d e x . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / b r o w s e r . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / d e b u g . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / ~ / m s / i n d e x . j s " , " w e b p a c k : / / / . / ~ / j s o n 3 / l i b / j s o n 3 . j s " , " w e b p a c k : / / / ( w e b p a c k ) / b u i l d i n / m o d u l e . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / ~ / c o m p o n e n t - e m i t t e r / i n d e x . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / b i n a r y . j s " , " w e b p a c k : / / / . / ~ / i s a r r a y / i n d e x . j s " , " w e b p a c k : / / / . / ~ / s o c k e t . i o - p a r s e r / i s - b u f f e r . j s " , " w e b p a c k : / / / l i b / m a n a g e r . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / i n d e x . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / i n d e x . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / s o c k e t . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / i n d e x . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / x m l h t t p r e q u e s t . j s " , " w e b p a c k : / / / . / ~ / h a s - c o r s / i n d e x . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g - x h r . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - p a r s e r / l i b / b r o w s e r . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - p a r s e r / l i b / k e y s . j s " , " w e b p a c k : / / / . / ~ / h a s - b i n a r y / i n d e x . j s " , " w e b p a c k : / / / . / ~ / a r r a y b u f f e r . s l i c e / i n d e x . j s " , " w e b p a c k : / / / . / ~ / a f t e r / i n d e x . j s " , " w e b p a c k : / / / . / ~ / w t f - 8 / w t f - 8 . j s " , " w e b p a c k : / / / . / ~ / b a s e 6 4 - a r r a y b u f f e r / l i b / b a s e 6 4 - a r r a y b u f f e r . j s " , " w e b p a c k : / / / . / ~ / b l o b / i n d e x . j s " , " w e b p a c k : / / / . / ~ / c o m p o n e n t - e m i t t e r / i n d e x . j s " , " w e b p a c k : / / / . / ~ / p a r s e q s / i n d e x . j s " , " w e b p a c k : / / / . / ~ / c o m p o n e n t - i n h e r i t / i n d e x . j s " , " w e b p a c k : / / / . / ~ / y e a s t / i n d e x . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g - j s o n p . j s " , " w e b p a c k : / / / . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / w e b s o c k e t . j s " , " w e b p a c k : / / / w s   ( i g n o r e d ) " , " w e b p a c k : / / / . / ~ / i n d e x o f / i n d e x . j s " , " w e b p a c k : / / / . / ~ / p a r s e j s o n / i n d e x . j s " , " w e b p a c k : / / / l i b / s o c k e t . j s " , " w e b p a c k : / / / . / ~ / t o - a r r a y / i n d e x . j s " , " w e b p a c k : / / / l i b / o n . j s " , " w e b p a c k : / / / . / ~ / c o m p o n e n t - b i n d / i n d e x . j s " , " w e b p a c k : / / / . / ~ / b a c k o 2 / i n d e x . j s " ] , " s o u r c e s C o n t e n t " : [ " ( f u n c t i o n   w e b p a c k U n i v e r s a l M o d u l e D e f i n i t i o n ( r o o t ,   f a c t o r y )   { \ n \ t i f ( t y p e o f   e x p o r t s   = = =   ' o b j e c t '   & &   t y p e o f   m o d u l e   = = =   ' o b j e c t ' ) \ n \ t \ t m o d u l e . e x p o r t s   =   f a c t o r y ( ) ; \ n \ t e l s e   i f ( t y p e o f   d e f i n e   = = =   ' f u n c t i o n '   & &   d e f i n e . a m d ) \ n \ t \ t d e f i n e ( [ ] ,   f a c t o r y ) ; \ n \ t e l s e   i f ( t y p e o f   e x p o r t s   = = =   ' o b j e c t ' ) \ n \ t \ t e x p o r t s [ \ " i o \ " ]   =   f a c t o r y ( ) ; \ n \ t e l s e \ n \ t \ t r o o t [ \ " i o \ " ]   =   f a c t o r y ( ) ; \ n } ) ( t h i s ,   f u n c t i o n ( )   { \ n r e t u r n   \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   w e b p a c k / u n i v e r s a l M o d u l e D e f i n i t i o n " , "   \ t / /   T h e   m o d u l e   c a c h e \ n   \ t v a r   i n s t a l l e d M o d u l e s   =   { } ; \ n \ n   \ t / /   T h e   r e q u i r e   f u n c t i o n \ n   \ t f u n c t i o n   _ _ w e b p a c k _ r e q u i r e _ _ ( m o d u l e I d )   { \ n \ n   \ t \ t / /   C h e c k   i f   m o d u l e   i s   i n   c a c h e \ n   \ t \ t i f ( i n s t a l l e d M o d u l e s [ m o d u l e I d ] ) \ n   \ t \ t \ t r e t u r n   i n s t a l l e d M o d u l e s [ m o d u l e I d ] . e x p o r t s ; \ n \ n   \ t \ t / /   C r e a t e   a   n e w   m o d u l e   ( a n d   p u t   i t   i n t o   t h e   c a c h e ) \ n   \ t \ t v a r   m o d u l e   =   i n s t a l l e d M o d u l e s [ m o d u l e I d ]   =   { \ n   \ t \ t \ t e x p o r t s :   { } , \ n   \ t \ t \ t i d :   m o d u l e I d , \ n   \ t \ t \ t l o a d e d :   f a l s e \ n   \ t \ t } ; \ n \ n   \ t \ t / /   E x e c u t e   t h e   m o d u l e   f u n c t i o n \ n   \ t \ t m o d u l e s [ m o d u l e I d ] . c a l l ( m o d u l e . e x p o r t s ,   m o d u l e ,   m o d u l e . e x p o r t s ,   _ _ w e b p a c k _ r e q u i r e _ _ ) ; \ n \ n   \ t \ t / /   F l a g   t h e   m o d u l e   a s   l o a d e d \ n   \ t \ t m o d u l e . l o a d e d   =   t r u e ; \ n \ n   \ t \ t / /   R e t u r n   t h e   e x p o r t s   o f   t h e   m o d u l e \ n   \ t \ t r e t u r n   m o d u l e . e x p o r t s ; \ n   \ t } \ n \ n \ n   \ t / /   e x p o s e   t h e   m o d u l e s   o b j e c t   ( _ _ w e b p a c k _ m o d u l e s _ _ ) \ n   \ t _ _ w e b p a c k _ r e q u i r e _ _ . m   =   m o d u l e s ; \ n \ n   \ t / /   e x p o s e   t h e   m o d u l e   c a c h e \ n   \ t _ _ w e b p a c k _ r e q u i r e _ _ . c   =   i n s t a l l e d M o d u l e s ; \ n \ n   \ t / /   _ _ w e b p a c k _ p u b l i c _ p a t h _ _ \ n   \ t _ _ w e b p a c k _ r e q u i r e _ _ . p   =   \ " \ " ; \ n \ n   \ t / /   L o a d   e n t r y   m o d u l e   a n d   r e t u r n   e x p o r t s \ n   \ t r e t u r n   _ _ w e b p a c k _ r e q u i r e _ _ ( 0 ) ; \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   w e b p a c k / b o o t s t r a p   1 2 f 6 3 9 6 a 1 5 c 6 0 a 1 e 9 6 b 0 " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   u r l   =   r e q u i r e ( ' . / u r l ' ) ; \ n v a r   p a r s e r   =   r e q u i r e ( ' s o c k e t . i o - p a r s e r ' ) ; \ n v a r   M a n a g e r   =   r e q u i r e ( ' . / m a n a g e r ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - c l i e n t ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   e x p o r t s   =   l o o k u p ; \ n \ n / * * \ n   *   M a n a g e r s   c a c h e . \ n   * / \ n \ n v a r   c a c h e   =   e x p o r t s . m a n a g e r s   =   { } ; \ n \ n / * * \ n   *   L o o k s   u p   a n   e x i s t i n g   ` M a n a g e r `   f o r   m u l t i p l e x i n g . \ n   *   I f   t h e   u s e r   s u m m o n s : \ n   * \ n   *       ` i o ( ' h t t p : / / l o c a l h o s t / a ' ) ; ` \ n   *       ` i o ( ' h t t p : / / l o c a l h o s t / b ' ) ; ` \ n   * \ n   *   W e   r e  [ 1 m  [ 3 3 m u s e   t h e   e x i s t i n g   i n s t a n c e   b a s e d   o n   s a m e   s c h e m e / p o r t / h o s t , \ n   *   a n d   w e   i n i t i a l i z e   s o c k e t s   f o r   e a c h   n a m e s p a c e . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o o k u p   ( u r i ,   o p t s )   { \ n     i f   ( t y p e o f   u r i   = = =   ' o b j e c t ' )   { \ n         o p t s   =   u r i ; \ n         u r i   =   u n d e f i n e d ; \ n     } \ n \ n     o p t s   =   o p t s   | |   { } ; \ n \ n     v a r   p a r s e d   =   u r l ( u r i ) ; \ n     v a r   s o u r c e   =   p a r s e d . s o u r c e ; \ n     v a r   i d   =   p a r s e d . i d ; \ n     v a r   p a t h   =   p a r s e d . p a t h ; \ n     v a r   s a m e N a m e s p a c e   =   c a c h e [ i d ]   & &   p a t h   i n   c a c h e [ i d ] . n s p s ; \ n     v a r   n e w C o n n e c t i o n   =   o p t s . f o r c e N e w   | |   o p t s [ ' f o r c e   n e w   c o n n e c t i o n ' ]   | | \ n                                             f a l s e   = = =   o p t s . m u l t i p l e x   | |   s a m e N a m e s p a c e ; \ n \ n     v a r   i o ; \ n \ n     i f   ( n e w C o n n e c t i o n )   { \ n         d e b u g ( ' i g n o r i n g   s o c k e t   c a c h e   f o r   % s ' ,   s o u r c e ) ; \ n         i o   =   M a n a g e r ( s o u r c e ,   o p t s ) ; \ n     }   e l s e   { \ n         i f   ( ! c a c h e [ i d ] )   { \ n             d e b u g ( ' n e w   i o   i n s t a n c e   f o r   % s ' ,   s o u r c e ) ; \ n             c a c h e [ i d ]   =   M a n a g e r ( s o u r c e ,   o p t s ) ; \ n         } \ n         i o   =   c a c h e [ i d ] ; \ n     } \ n     i f   ( p a r s e d . q u e r y   & &   ! o p t s . q u e r y )   { \ n         o p t s . q u e r y   =   p a r s e d . q u e r y ; \ n     }   e l s e   i f   ( o p t s   & &   ' o b j e c t '   = = =   t y p e o f   o p t s . q u e r y )   { \ n         o p t s . q u e r y   =   e n c o d e Q u e r y S t r i n g ( o p t s . q u e r y ) ; \ n     } \ n     r e t u r n   i o . s o c k e t ( p a r s e d . p a t h ,   o p t s ) ; \ n } \ n / * * \ n   *     H e l p e r   m e t h o d   t o   p a r s e   q u e r y   o b j e c t s   t o   s t r i n g . \ n   *   @ p a r a m   { o b j e c t }   q u e r y \ n   *   @ r e t u r n s   { s t r i n g } \ n   * / \ n f u n c t i o n   e n c o d e Q u e r y S t r i n g   ( o b j )   { \ n     v a r   s t r   =   [ ] ; \ n     f o r   ( v a r   p   i n   o b j )   { \ n         i f   ( o b j . h a s O w n P r o p e r t y ( p ) )   { \ n             s t r . p u s h ( e n c o d e U R I C o m p o n e n t ( p )   +   ' = '   +   e n c o d e U R I C o m p o n e n t ( o b j [ p ] ) ) ; \ n         } \ n     } \ n     r e t u r n   s t r . j o i n ( ' & ' ) ; \ n } \ n / * * \ n   *   P r o t o c o l   v e r s i o n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . p r o t o c o l   =   p a r s e r . p r o t o c o l ; \ n \ n / * * \ n   *   ` c o n n e c t ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   u r i \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . c o n n e c t   =   l o o k u p ; \ n \ n / * * \ n   *   E x p o s e   c o n s t r u c t o r s   f o r   s t a n d a l o n e   b u i l d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . M a n a g e r   =   r e q u i r e ( ' . / m a n a g e r ' ) ; \ n e x p o r t s . S o c k e t   =   r e q u i r e ( ' . / s o c k e t ' ) ; \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / i n d e x . j s " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   p a r s e u r i   =   r e q u i r e ( ' p a r s e u r i ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - c l i e n t : u r l ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   u r l ; \ n \ n / * * \ n   *   U R L   p a r s e r . \ n   * \ n   *   @ p a r a m   { S t r i n g }   u r l \ n   *   @ p a r a m   { O b j e c t }   A n   o b j e c t   m e a n t   t o   m i m i c   w i n d o w . l o c a t i o n . \ n   *                                   D e f a u l t s   t o   w i n d o w . l o c a t i o n . \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   u r l   ( u r i ,   l o c )   { \ n     v a r   o b j   =   u r i ; \ n \ n     / /   d e f a u l t   t o   w i n d o w . l o c a t i o n \ n     l o c   =   l o c   | |   g l o b a l . l o c a t i o n ; \ n     i f   ( n u l l   = =   u r i )   u r i   =   l o c . p r o t o c o l   +   ' / / '   +   l o c . h o s t ; \ n \ n     / /   r e l a t i v e   p a t h   s u p p o r t \ n     i f   ( ' s t r i n g '   = = =   t y p e o f   u r i )   { \ n         i f   ( ' / '   = = =   u r i . c h a r A t ( 0 ) )   { \ n             i f   ( ' / '   = = =   u r i . c h a r A t ( 1 ) )   { \ n                 u r i   =   l o c . p r o t o c o l   +   u r i ; \ n             }   e l s e   { \ n                 u r i   =   l o c . h o s t   +   u r i ; \ n             } \ n         } \ n \ n         i f   ( ! / ^ ( h t t p s ? | w s s ? ) : \ \ / \ \ / / . t e s t ( u r i ) )   { \ n             d e b u g ( ' p r o t o c o l - l e s s   u r l   % s ' ,   u r i ) ; \ n             i f   ( ' u n d e f i n e d '   ! = =   t y p e o f   l o c )   { \ n                 u r i   =   l o c . p r o t o c o l   +   ' / / '   +   u r i ; \ n             }   e l s e   { \ n                 u r i   =   ' h t t p s : / / '   +   u r i ; \ n             } \ n         } \ n \ n         / /   p a r s e \ n         d e b u g ( ' p a r s e   % s ' ,   u r i ) ; \ n         o b j   =   p a r s e u r i ( u r i ) ; \ n     } \ n \ n     / /   m a k e   s u r e   w e   t r e a t   ` l o c a l h o s t : 8 0 `   a n d   ` l o c a l h o s t `   e q u a l l y \ n     i f   ( ! o b j . p o r t )   { \ n         i f   ( / ^ ( h t t p | w s ) $ / . t e s t ( o b j . p r o t o c o l ) )   { \ n             o b j . p o r t   =   ' 8 0 ' ; \ n         }   e l s e   i f   ( / ^ ( h t t p | w s ) s $ / . t e s t ( o b j . p r o t o c o l ) )   { \ n             o b j . p o r t   =   ' 4 4 3 ' ; \ n         } \ n     } \ n \ n     o b j . p a t h   =   o b j . p a t h   | |   ' / ' ; \ n \ n     v a r   i p v 6   =   o b j . h o s t . i n d e x O f ( ' : ' )   ! = =   - 1 ; \ n     v a r   h o s t   =   i p v 6   ?   ' [ '   +   o b j . h o s t   +   ' ] '   :   o b j . h o s t ; \ n \ n     / /   d e f i n e   u n i q u e   i d \ n     o b j . i d   =   o b j . p r o t o c o l   +   ' : / / '   +   h o s t   +   ' : '   +   o b j . p o r t ; \ n     / /   d e f i n e   h r e f \ n     o b j . h r e f   =   o b j . p r o t o c o l   +   ' : / / '   +   h o s t   +   ( l o c   & &   l o c . p o r t   = = =   o b j . p o r t   ?   ' '   :   ( ' : '   +   o b j . p o r t ) ) ; \ n \ n     r e t u r n   o b j ; \ n } \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / u r l . j s " , " / * * \ r \ n   *   P a r s e s   a n   U R I \ r \ n   * \ r \ n   *   @ a u t h o r   S t e v e n   L e v i t h a n   < s t e v e n l e v i t h a n . c o m >   ( M I T   l i c e n s e ) \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n v a r   r e   =   / ^ ( ? : ( ? ! [ ^ : @ ] + : [ ^ : @ \ \ / ] * @ ) ( h t t p | h t t p s | w s | w s s ) : \ \ / \ \ / ) ? ( ( ? : ( ( [ ^ : @ ] * ) ( ? : : ( [ ^ : @ ] * ) ) ? ) ? @ ) ? ( ( ? : [ a - f 0 - 9 ] { 0 , 4 } : ) { 2 , 7 } [ a - f 0 - 9 ] { 0 , 4 } | [ ^ : \ \ / ? # ] * ) ( ? : : ( \ \ d * ) ) ? ) ( ( ( \ \ / ( ? : [ ^ ? # ] ( ? ! [ ^ ? # \ \ / ] * \ \ . [ ^ ? # \ \ / . ] + ( ? : [ ? # ] | $ ) ) ) * \ \ / ? ) ? ( [ ^ ? # \ \ / ] * ) ) ( ? : \ \ ? ( [ ^ # ] * ) ) ? ( ? : # ( . * ) ) ? ) / ; \ r \ n \ r \ n v a r   p a r t s   =   [ \ r \ n         ' s o u r c e ' ,   ' p r o t o c o l ' ,   ' a u t h o r i t y ' ,   ' u s e r I n f o ' ,   ' u s e r ' ,   ' p a s s w o r d ' ,   ' h o s t ' ,   ' p o r t ' ,   ' r e l a t i v e ' ,   ' p a t h ' ,   ' d i r e c t o r y ' ,   ' f i l e ' ,   ' q u e r y ' ,   ' a n c h o r ' \ r \ n ] ; \ r \ n \ r \ n m o d u l e . e x p o r t s   =   f u n c t i o n   p a r s e u r i ( s t r )   { \ r \ n         v a r   s r c   =   s t r , \ r \ n                 b   =   s t r . i n d e x O f ( ' [ ' ) , \ r \ n                 e   =   s t r . i n d e x O f ( ' ] ' ) ; \ r \ n \ r \ n         i f   ( b   ! =   - 1   & &   e   ! =   - 1 )   { \ r \ n                 s t r   =   s t r . s u b s t r i n g ( 0 ,   b )   +   s t r . s u b s t r i n g ( b ,   e ) . r e p l a c e ( / : / g ,   ' ; ' )   +   s t r . s u b s t r i n g ( e ,   s t r . l e n g t h ) ; \ r \ n         } \ r \ n \ r \ n         v a r   m   =   r e . e x e c ( s t r   | |   ' ' ) , \ r \ n                 u r i   =   { } , \ r \ n                 i   =   1 4 ; \ r \ n \ r \ n         w h i l e   ( i - - )   { \ r \ n                 u r i [ p a r t s [ i ] ]   =   m [ i ]   | |   ' ' ; \ r \ n         } \ r \ n \ r \ n         i f   ( b   ! =   - 1   & &   e   ! =   - 1 )   { \ r \ n                 u r i . s o u r c e   =   s r c ; \ r \ n                 u r i . h o s t   =   u r i . h o s t . s u b s t r i n g ( 1 ,   u r i . h o s t . l e n g t h   -   1 ) . r e p l a c e ( / ; / g ,   ' : ' ) ; \ r \ n                 u r i . a u t h o r i t y   =   u r i . a u t h o r i t y . r e p l a c e ( ' [ ' ,   ' ' ) . r e p l a c e ( ' ] ' ,   ' ' ) . r e p l a c e ( / ; / g ,   ' : ' ) ; \ r \ n                 u r i . i p v 6 u r i   =   t r u e ; \ r \ n         } \ r \ n \ r \ n         r e t u r n   u r i ; \ r \ n } ; \ r \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p a r s e u r i / i n d e x . j s \ n / /   m o d u l e   i d   =   2 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   w e b   b r o w s e r   i m p l e m e n t a t i o n   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / d e b u g ' ) ; \ n e x p o r t s . l o g   =   l o g ; \ n e x p o r t s . f o r m a t A r g s   =   f o r m a t A r g s ; \ n e x p o r t s . s a v e   =   s a v e ; \ n e x p o r t s . l o a d   =   l o a d ; \ n e x p o r t s . u s e C o l o r s   =   u s e C o l o r s ; \ n e x p o r t s . s t o r a g e   =   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e \ n                               & &   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e . s t o r a g e \ n                                     ?   c h r o m e . s t o r a g e . l o c a l \ n                                     :   l o c a l s t o r a g e ( ) ; \ n \ n / * * \ n   *   C o l o r s . \ n   * / \ n \ n e x p o r t s . c o l o r s   =   [ \ n     ' l i g h t s e a g r e e n ' , \ n     ' f o r e s t g r e e n ' , \ n     ' g o l d e n r o d ' , \ n     ' d o d g e r b l u e ' , \ n     ' d a r k o r c h i d ' , \ n     ' c r i m s o n ' \ n ] ; \ n \ n / * * \ n   *   C u r r e n t l y   o n l y   W e b K i t - b a s e d   W e b   I n s p e c t o r s ,   F i r e f o x   > =   v 3 1 , \ n   *   a n d   t h e   F i r e b u g   e x t e n s i o n   ( a n y   F i r e f o x   v e r s i o n )   a r e   k n o w n \ n   *   t o   s u p p o r t   \ " % c \ "   C S S   c u s t o m i z a t i o n s . \ n   * \ n   *   T O D O :   a d d   a   ` l o c a l S t o r a g e `   v a r i a b l e   t o   e x p l i c i t l y   e n a b l e / d i s a b l e   c o l o r s \ n   * / \ n \ n f u n c t i o n   u s e C o l o r s ( )   { \ n     / /   i s   w e b k i t ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 1 6 4 5 9 6 0 6 / 3 7 6 7 7 3 \ n     / /   d o c u m e n t   i s   u n d e f i n e d   i n   r e a c t - n a t i v e :   h t t p s : / / g i t h u b . c o m / f a c e b o o k / r e a c t - n a t i v e / p u l l / 1 6 3 2 \ n     r e t u r n   ( t y p e o f   d o c u m e n t   ! = =   ' u n d e f i n e d '   & &   ' W e b k i t A p p e a r a n c e '   i n   d o c u m e n t . d o c u m e n t E l e m e n t . s t y l e )   | | \ n         / /   i s   f i r e b u g ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 3 9 8 1 2 0 / 3 7 6 7 7 3 \ n         ( w i n d o w . c o n s o l e   & &   ( c o n s o l e . f i r e b u g   | |   ( c o n s o l e . e x c e p t i o n   & &   c o n s o l e . t a b l e ) ) )   | | \ n         / /   i s   f i r e f o x   > =   v 3 1 ? \ n         / /   h t t p s : / / d e v e l o p e r . m o z i l l a . o r g / e n - U S / d o c s / T o o l s / W e b _ C o n s o l e # S t y l i n g _ m e s s a g e s \ n         ( n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) . m a t c h ( / f i r e f o x \ \ / ( \ \ d + ) / )   & &   p a r s e I n t ( R e g E x p . $ 1 ,   1 0 )   > =   3 1 ) ; \ n } \ n \ n / * * \ n   *   M a p   % j   t o   ` J S O N . s t r i n g i f y ( ) ` ,   s i n c e   n o   W e b   I n s p e c t o r s   d o   t h a t   b y   d e f a u l t . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s . j   =   f u n c t i o n ( v )   { \ n     t r y   { \ n         r e t u r n   J S O N . s t r i n g i f y ( v ) ; \ n     }   c a t c h   ( e r r )   { \ n         r e t u r n   ' [ U n e x p e c t e d J S O N P a r s e E r r o r ] :   '   +   e r r . m e s s a g e ; \ n     } \ n } ; \ n \ n \ n / * * \ n   *   C o l o r i z e   l o g   a r g u m e n t s   i f   e n a b l e d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   f o r m a t A r g s ( )   { \ n     v a r   a r g s   =   a r g u m e n t s ; \ n     v a r   u s e C o l o r s   =   t h i s . u s e C o l o r s ; \ n \ n     a r g s [ 0 ]   =   ( u s e C o l o r s   ?   ' % c '   :   ' ' ) \ n         +   t h i s . n a m e s p a c e \ n         +   ( u s e C o l o r s   ?   '   % c '   :   '   ' ) \ n         +   a r g s [ 0 ] \ n         +   ( u s e C o l o r s   ?   ' % c   '   :   '   ' ) \ n         +   ' + '   +   e x p o r t s . h u m a n i z e ( t h i s . d i f f ) ; \ n \ n     i f   ( ! u s e C o l o r s )   r e t u r n   a r g s ; \ n \ n     v a r   c   =   ' c o l o r :   '   +   t h i s . c o l o r ; \ n     a r g s   =   [ a r g s [ 0 ] ,   c ,   ' c o l o r :   i n h e r i t ' ] . c o n c a t ( A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g s ,   1 ) ) ; \ n \ n     / /   t h e   f i n a l   \ " % c \ "   i s   s o m e w h a t   t r i c k y ,   b e c a u s e   t h e r e   c o u l d   b e   o t h e r \ n     / /   a r g u m e n t s   p a s s e d   e i t h e r   b e f o r e   o r   a f t e r   t h e   % c ,   s o   w e   n e e d   t o \ n     / /   f i g u r e   o u t   t h e   c o r r e c t   i n d e x   t o   i n s e r t   t h e   C S S   i n t o \ n     v a r   i n d e x   =   0 ; \ n     v a r   l a s t C   =   0 ; \ n     a r g s [ 0 ] . r e p l a c e ( / % [ a - z % ] / g ,   f u n c t i o n ( m a t c h )   { \ n         i f   ( ' % % '   = = =   m a t c h )   r e t u r n ; \ n         i n d e x + + ; \ n         i f   ( ' % c '   = = =   m a t c h )   { \ n             / /   w e   o n l y   a r e   i n t e r e s t e d   i n   t h e   * l a s t *   % c \ n             / /   ( t h e   u s e r   m a y   h a v e   p r o v i d e d   t h e i r   o w n ) \ n             l a s t C   =   i n d e x ; \ n         } \ n     } ) ; \ n \ n     a r g s . s p l i c e ( l a s t C ,   0 ,   c ) ; \ n     r e t u r n   a r g s ; \ n } \ n \ n / * * \ n   *   I n v o k e s   ` c o n s o l e . l o g ( ) `   w h e n   a v a i l a b l e . \ n   *   N o - o p   w h e n   ` c o n s o l e . l o g `   i s   n o t   a   \ " f u n c t i o n \ " . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o g ( )   { \ n     / /   t h i s   h a c k e r y   i s    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   f o r   I E 8 / 9 ,   w h e r e \ n     / /   t h e   ` c o n s o l e . l o g `   f u n c t i o n   d o e s n ' t   h a v e   ' a p p l y ' \ n     r e t u r n   ' o b j e c t '   = = =   t y p e o f   c o n s o l e \ n         & &   c o n s o l e . l o g \ n         & &   F u n c t i o n . p r o t o t y p e . a p p l y . c a l l ( c o n s o l e . l o g ,   c o n s o l e ,   a r g u m e n t s ) ; \ n } \ n \ n / * * \ n   *   S a v e   ` n a m e s p a c e s ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s a v e ( n a m e s p a c e s )   { \ n     t r y   { \ n         i f   ( n u l l   = =   n a m e s p a c e s )   { \ n             e x p o r t s . s t o r a g e . r e m o v e I t e m ( ' d e b u g ' ) ; \ n         }   e l s e   { \ n             e x p o r t s . s t o r a g e . d e b u g   =   n a m e s p a c e s ; \ n         } \ n     }   c a t c h ( e )   { } \ n } \ n \ n / * * \ n   *   L o a d   ` n a m e s p a c e s ` . \ n   * \ n   *   @ r e t u r n   { S t r i n g }   r e t u r n s   t h e   p r e v i o u s l y   p e r s i s t e d   d e b u g   m o d e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o a d ( )   { \ n     v a r   r ; \ n     t r y   { \ n         r e t u r n   e x p o r t s . s t o r a g e . d e b u g ; \ n     }   c a t c h ( e )   { } \ n \ n     / /   I f   d e b u g   i s n ' t   s e t   i n   L S ,   a n d   w e ' r e   i n   E l e c t r o n ,   t r y   t o   l o a d   $ D E B U G \ n     i f   ( t y p e o f   p r o c e s s   ! = =   ' u n d e f i n e d '   & &   ' e n v '   i n   p r o c e s s )   { \ n         r e t u r n   p r o c e s s . e n v . D E B U G ; \ n     } \ n } \ n \ n / * * \ n   *   E n a b l e   n a m e s p a c e s   l i s t e d   i n   ` l o c a l S t o r a g e . d e b u g `   i n i t i a l l y . \ n   * / \ n \ n e x p o r t s . e n a b l e ( l o a d ( ) ) ; \ n \ n / * * \ n   *   L o c a l s t o r a g e   a t t e m p t s   t o   r e t u r n   t h e   l o c a l s t o r a g e . \ n   * \ n   *   T h i s   i s   n e c e s s a r y   b e c a u s e   s a f a r i   t h r o w s \ n   *   w h e n   a   u s e r   d i s a b l e s   c o o k i e s / l o c a l s t o r a g e \ n   *   a n d   y o u   a t t e m p t   t o   a c c e s s   i t . \ n   * \ n   *   @ r e t u r n   { L o c a l S t o r a g e } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o c a l s t o r a g e ( ) { \ n     t r y   { \ n         r e t u r n   w i n d o w . l o c a l S t o r a g e ; \ n     }   c a t c h   ( e )   { } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / d e b u g / b r o w s e r . j s \ n / /   m o d u l e   i d   =   3 \ n / /   m o d u l e   c h u n k s   =   0 " , " / /   s h i m   f o r   u s i n g   p r o c e s s   i n   b r o w s e r \ n v a r   p r o c e s s   =   m o d u l e . e x p o r t s   =   { } ; \ n \ n / /   c a c h e d   f r o m   w h a t e v e r   g l o b a l   i s   p r e s e n t   s o   t h a t   t e s t   r u n n e r s   t h a t   s t u b   i t \ n / /   d o n ' t   b r e a k   t h i n g s .     B u t   w e   n e e d   t o   w r a p   i t   i n   a   t r y   c a t c h   i n   c a s e   i t   i s \ n / /   w r a p p e d   i n   s t r i c t   m o d e   c o d e   w h i c h   d o e s n ' t   d e f i n e   a n y   g l o b a l s .     I t ' s   i n s i d e   a \ n / /   f u n c t i o n   b e c a u s e   t r y / c a t c h e s   d e o p t i m i z e   i n   c e r t a i n   e n g i n e s . \ n \ n v a r   c a c h e d S e t T i m e o u t ; \ n v a r   c a c h e d C l e a r T i m e o u t ; \ n \ n f u n c t i o n   d e f a u l t S e t T i m o u t ( )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' s e t T i m e o u t   h a s   n o t   b e e n   d e f i n e d ' ) ; \ n } \ n f u n c t i o n   d e f a u l t C l e a r T i m e o u t   ( )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' c l e a r T i m e o u t   h a s   n o t   b e e n   d e f i n e d ' ) ; \ n } \ n ( f u n c t i o n   ( )   { \ n         t r y   { \ n                 i f   ( t y p e o f   s e t T i m e o u t   = = =   ' f u n c t i o n ' )   { \ n                         c a c h e d S e t T i m e o u t   =   s e t T i m e o u t ; \ n                 }   e l s e   { \ n                         c a c h e d S e t T i m e o u t   =   d e f a u l t S e t T i m o u t ; \ n                 } \ n         }   c a t c h   ( e )   { \ n                 c a c h e d S e t T i m e o u t   =   d e f a u l t S e t T i m o u t ; \ n         } \ n         t r y   { \ n                 i f   ( t y p e o f   c l e a r T i m e o u t   = = =   ' f u n c t i o n ' )   { \ n                         c a c h e d C l e a r T i m e o u t   =   c l e a r T i m e o u t ; \ n                 }   e l s e   { \ n                         c a c h e d C l e a r T i m e o u t   =   d e f a u l t C l e a r T i m e o u t ; \ n                 } \ n         }   c a t c h   ( e )   { \ n                 c a c h e d C l e a r T i m e o u t   =   d e f a u l t C l e a r T i m e o u t ; \ n         } \ n }   ( ) ) \ n f u n c t i o n   r u n T i m e o u t ( f u n )   { \ n         i f   ( c a c h e d S e t T i m e o u t   = = =   s e t T i m e o u t )   { \ n                 / / n o r m a l   e n v i r o m e n t s   i n   s a n e   s i t u a t i o n s \ n                 r e t u r n   s e t T i m e o u t ( f u n ,   0 ) ; \ n         } \ n         / /   i f   s e t T i m e o u t   w a s n ' t   a v a i l a b l e   b u t   w a s   l a t t e r   d e f i n e d \ n         i f   ( ( c a c h e d S e t T i m e o u t   = = =   d e f a u l t S e t T i m o u t   | |   ! c a c h e d S e t T i m e o u t )   & &   s e t T i m e o u t )   { \ n                 c a c h e d S e t T i m e o u t   =   s e t T i m e o u t ; \ n                 r e t u r n   s e t T i m e o u t ( f u n ,   0 ) ; \ n         } \ n         t r y   { \ n                 / /   w h e n   w h e n   s o m e b o d y   h a s   s c r e w e d   w i t h   s e t T i m e o u t   b u t   n o   I . E .   m a d d n e s s \ n                 r e t u r n   c a c h e d S e t T i m e o u t ( f u n ,   0 ) ; \ n         }   c a t c h ( e ) { \ n                 t r y   { \ n                         / /   W h e n   w e   a r e   i n   I . E .   b u t   t h e   s c r i p t   h a s   b e e n   e v a l e d   s o   I . E .   d o e s n ' t   t r u s t   t h e   g l o b a l   o b j e c t   w h e n   c a l l e d   n o r m a l l y \ n                         r e t u r n   c a c h e d S e t T i m e o u t . c a l l ( n u l l ,   f u n ,   0 ) ; \ n                 }   c a t c h ( e ) { \ n                         / /   s a m e   a s   a b o v e   b u t   w h e n   i t ' s   a   v e r s i o n   o f   I . E .   t h a t    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   h a v e   t h e   g l o b a l   o b j e c t   f o r   ' t h i s ' ,   h o p f u l l y   o u r   c o n t e x t   c o r r e c t   o t h e r w i s e   i t   w i l l   t h r o w   a   g l o b a l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m \ n                         r e t u r n   c a c h e d S e t T i m e o u t . c a l l ( t h i s ,   f u n ,   0 ) ; \ n                 } \ n         } \ n \ n \ n } \ n f u n c t i o n   r u n C l e a r T i m e o u t ( m a r k e r )   { \ n         i f   ( c a c h e d C l e a r T i m e o u t   = = =   c l e a r T i m e o u t )   { \ n                 / / n o r m a l   e n v i r o m e n t s   i n   s a n e   s i t u a t i o n s \ n                 r e t u r n   c l e a r T i m e o u t ( m a r k e r ) ; \ n         } \ n         / /   i f   c l e a r T i m e o u t   w a s n ' t   a v a i l a b l e   b u t   w a s   l a t t e r   d e f i n e d \ n         i f   ( ( c a c h e d C l e a r T i m e o u t   = = =   d e f a u l t C l e a r T i m e o u t   | |   ! c a c h e d C l e a r T i m e o u t )   & &   c l e a r T i m e o u t )   { \ n                 c a c h e d C l e a r T i m e o u t   =   c l e a r T i m e o u t ; \ n                 r e t u r n   c l e a r T i m e o u t ( m a r k e r ) ; \ n         } \ n         t r y   { \ n                 / /   w h e n   w h e n   s o m e b o d y   h a s   s c r e w e d   w i t h   s e t T i m e o u t   b u t   n o   I . E .   m a d d n e s s \ n                 r e t u r n   c a c h e d C l e a r T i m e o u t ( m a r k e r ) ; \ n         }   c a t c h   ( e ) { \ n                 t r y   { \ n                         / /   W h e n   w e   a r e   i n   I . E .   b u t   t h e   s c r i p t   h a s   b e e n   e v a l e d   s o   I . E .   d o e s n ' t     t r u s t   t h e   g l o b a l   o b j e c t   w h e n   c a l l e d   n o r m a l l y \ n                         r e t u r n   c a c h e d C l e a r T i m e o u t . c a l l ( n u l l ,   m a r k e r ) ; \ n                 }   c a t c h   ( e ) { \ n                         / /   s a m e   a s   a b o v e   b u t   w h e n   i t ' s   a   v e r s i o n   o f   I . E .   t h a t    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   h a v e   t h e   g l o b a l   o b j e c t   f o r   ' t h i s ' ,   h o p f u l l y   o u r   c o n t e x t   c o r r e c t   o t h e r w i s e   i t   w i l l   t h r o w   a   g l o b a l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . \ n                         / /   S o m e   v e r s i o n s   o f   I . E .   h a v e   d i f f e r e n t   r u l e s   f o r   c l e a r T i m e o u t   v s   s e t T i m e o u t \ n                         r e t u r n   c a c h e d C l e a r T i m e o u t . c a l l ( t h i s ,   m a r k e r ) ; \ n                 } \ n         } \ n \ n \ n \ n } \ n v a r   q u e u e   =   [ ] ; \ n v a r   d r a i n i n g   =   f a l s e ; \ n v a r   c u r r e n t Q u e u e ; \ n v a r   q u e u e I n d e x   =   - 1 ; \ n \ n f u n c t i o n   c l e a n U p N e x t T i c k ( )   { \ n         i f   ( ! d r a i n i n g   | |   ! c u r r e n t Q u e u e )   { \ n                 r e t u r n ; \ n         } \ n         d r a i n i n g   =   f a l s e ; \ n         i f   ( c u r r e n t Q u e u e . l e n g t h )   { \ n                 q u e u e   =   c u r r e n t Q u e u e . c o n c a t ( q u e u e ) ; \ n         }   e l s e   { \ n                 q u e u e I n d e x   =   - 1 ; \ n         } \ n         i f   ( q u e u e . l e n g t h )   { \ n                 d r a i n Q u e u e ( ) ; \ n         } \ n } \ n \ n f u n c t i o n   d r a i n Q u e u e ( )   { \ n         i f   ( d r a i n i n g )   { \ n                 r e t u r n ; \ n         } \ n         v a r   t i m e o u t   =   r u n T i m e o u t ( c l e a n U p N e x t T i c k ) ; \ n         d r a i n i n g   =   t r u e ; \ n \ n         v a r   l e n   =   q u e u e . l e n g t h ; \ n         w h i l e ( l e n )   { \ n                 c u r r e n t Q u e u e   =   q u e u e ; \ n                 q u e u e   =   [ ] ; \ n                 w h i l e   ( + + q u e u e I n d e x   <   l e n )   { \ n                         i f   ( c u r r e n t Q u e u e )   { \ n                                 c u r r e n t Q u e u e [ q u e u e I n d e x ] . r u n ( ) ; \ n                         } \ n                 } \ n                 q u e u e I n d e x   =   - 1 ; \ n                 l e n   =   q u e u e . l e n g t h ; \ n         } \ n         c u r r e n t Q u e u e   =   n u l l ; \ n         d r a i n i n g   =   f a l s e ; \ n         r u n C l e a r T i m e o u t ( t i m e o u t ) ; \ n } \ n \ n p r o c e s s . n e x t T i c k   =   f u n c t i o n   ( f u n )   { \ n         v a r   a r g s   =   n e w   A r r a y ( a r g u m e n t s . l e n g t h   -   1 ) ; \ n         i f   ( a r g u m e n t s . l e n g t h   >   1 )   { \ n                 f o r   ( v a r   i   =   1 ;   i   <   a r g u m e n t s . l e n g t h ;   i + + )   { \ n                         a r g s [ i   -   1 ]   =   a r g u m e n t s [ i ] ; \ n                 } \ n         } \ n         q u e u e . p u s h ( n e w   I t e m ( f u n ,   a r g s ) ) ; \ n         i f   ( q u e u e . l e n g t h   = = =   1   & &   ! d r a i n i n g )   { \ n                 r u n T i m e o u t ( d r a i n Q u e u e ) ; \ n         } \ n } ; \ n \ n / /   v 8   l i k e s   p r e d i c t i b l e   o b j e c t s \ n f u n c t i o n   I t e m ( f u n ,   a r r a y )   { \ n         t h i s . f u n   =   f u n ; \ n         t h i s . a r r a y   =   a r r a y ; \ n } \ n I t e m . p r o t o t y p e . r u n   =   f u n c t i o n   ( )   { \ n         t h i s . f u n . a p p l y ( n u l l ,   t h i s . a r r a y ) ; \ n } ; \ n p r o c e s s . t i t l e   =   ' b r o w s e r ' ; \ n p r o c e s s . b r o w s e r   =   t r u e ; \ n p r o c e s s . e n v   =   { } ; \ n p r o c e s s . a r g v   =   [ ] ; \ n p r o c e s s . v e r s i o n   =   ' ' ;   / /   e m p t y   s t r i n g   t o   a v o i d   r e g e x p   i s s u e s \ n p r o c e s s . v e r s i o n s   =   { } ; \ n \ n f u n c t i o n   n o o p ( )   { } \ n \ n p r o c e s s . o n   =   n o o p ; \ n p r o c e s s . a d d L i s t e n e r   =   n o o p ; \ n p r o c e s s . o n c e   =   n o o p ; \ n p r o c e s s . o f f   =   n o o p ; \ n p r o c e s s . r e m o v e L i s t e n e r   =   n o o p ; \ n p r o c e s s . r e m o v e A l l L i s t e n e r s   =   n o o p ; \ n p r o c e s s . e m i t   =   n o o p ; \ n \ n p r o c e s s . b i n d i n g   =   f u n c t i o n   ( n a m e )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o c e s s . b i n d i n g   i s    [ 1 m  [ 3 1 m n o t   s u p p o r t e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n } ; \ n \ n p r o c e s s . c w d   =   f u n c t i o n   ( )   {   r e t u r n   ' / '   } ; \ n p r o c e s s . c h d i r   =   f u n c t i o n   ( d i r )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o c e s s . c h d i r   i s    [ 1 m  [ 3 1 m n o t   s u p p o r t e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n } ; \ n p r o c e s s . u m a s k   =   f u n c t i o n ( )   {   r e t u r n   0 ;   } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p r o c e s s / b r o w s e r . j s \ n / /   m o d u l e   i d   =   4 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   c o m m o n   l o g i c   f o r   b o t h   t h e   N o d e . j s   a n d   w e b   b r o w s e r \ n   *   i m p l e m e n t a t i o n s   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   d e b u g . d e b u g   =   d e b u g ; \ n e x p o r t s . c o e r c e   =   c o e r c e ; \ n e x p o r t s . d i s a b l e   =   d i s a b l e ; \ n e x p o r t s . e n a b l e   =   e n a b l e ; \ n e x p o r t s . e n a b l e d   =   e n a b l e d ; \ n e x p o r t s . h u m a n i z e   =   r e q u i r e ( ' m s ' ) ; \ n \ n / * * \ n   *   T h e   c u r r e n t l y   a c t i v e   d e b u g   m o d e   n a m e s ,   a n d   n a m e s   t o   s k i p . \ n   * / \ n \ n e x p o r t s . n a m e s   =   [ ] ; \ n e x p o r t s . s k i p s   =   [ ] ; \ n \ n / * * \ n   *   M a p   o f   s p e c i a l   \ " % n \ "   h a n d l i n g   f u n c t i o n s ,   f o r   t h e   d e b u g   \ " f o r m a t \ "   a r g u m e n t . \ n   * \ n   *   V a l i d   k e y   n a m e s   a r e   a   s i n g l e ,   l o w e r c a s e d   l e t t e r ,   i . e .   \ " n \ " . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s   =   { } ; \ n \ n / * * \ n   *   P r e v i o u s l y   a s s i g n e d   c o l o r . \ n   * / \ n \ n v a r   p r e v C o l o r   =   0 ; \ n \ n / * * \ n   *   P r e v i o u s   l o g   t i m e s t a m p . \ n   * / \ n \ n v a r   p r e v T i m e ; \ n \ n / * * \ n   *   S e l e c t   a   c o l o r . \ n   * \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s e l e c t C o l o r ( )   { \ n     r e t u r n   e x p o r t s . c o l o r s [ p r e v C o l o r + +   %   e x p o r t s . c o l o r s . l e n g t h ] ; \ n } \ n \ n / * * \ n   *   C r e a t e   a   d e b u g g e r   w i t h   t h e   g i v e n   ` n a m e s p a c e ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e \ n   *   @ r e t u r n   { F u n c t i o n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d e b u g ( n a m e s p a c e )   { \ n \ n     / /   d e f i n e   t h e   ` d i s a b l e d `   v e r s i o n \ n     f u n c t i o n   d i s a b l e d ( )   { \ n     } \ n     d i s a b l e d . e n a b l e d   =   f a l s e ; \ n \ n     / /   d e f i n e   t h e   ` e n a b l e d `   v e r s i o n \ n     f u n c t i o n   e n a b l e d ( )   { \ n \ n         v a r   s e l f   =   e n a b l e d ; \ n \ n         / /   s e t   ` d i f f `   t i m e s t a m p \ n         v a r   c u r r   =   + n e w   D a t e ( ) ; \ n         v a r   m s   =   c u r r   -   ( p r e v T i m e   | |   c u r r ) ; \ n         s e l f . d i f f   =   m s ; \ n         s e l f . p r e v   =   p r e v T i m e ; \ n         s e l f . c u r r   =   c u r r ; \ n         p r e v T i m e   =   c u r r ; \ n \ n         / /   a d d   t h e   ` c o l o r `   i f   n o t   s e t \ n         i f   ( n u l l   = =   s e l f . u s e C o l o r s )   s e l f . u s e C o l o r s   =   e x p o r t s . u s e C o l o r s ( ) ; \ n         i f   ( n u l l   = =   s e l f . c o l o r   & &   s e l f . u s e C o l o r s )   s e l f . c o l o r   =   s e l e c t C o l o r ( ) ; \ n \ n         v a r   a r g s   =   n e w   A r r a y ( a r g u m e n t s . l e n g t h ) ; \ n         f o r   ( v a r   i   =   0 ;   i   <   a r g s . l e n g t h ;   i + + )   { \ n             a r g s [ i ]   =   a r g u m e n t s [ i ] ; \ n         } \ n \ n         a r g s [ 0 ]   =   e x p o r t s . c o e r c e ( a r g s [ 0 ] ) ; \ n \ n         i f   ( ' s t r i n g '   ! = =   t y p e o f   a r g s [ 0 ] )   { \ n             / /   a n y t h i n g   e l s e   l e t ' s   i n s p e c t   w i t h   % o \ n             a r g s   =   [ ' % o ' ] . c o n c a t ( a r g s ) ; \ n         } \ n \ n         / /   a p p l y   a n y   ` f o r m a t t e r s `   t r a n s f o r m a t i o n s \ n         v a r   i n d e x   =   0 ; \ n         a r g s [ 0 ]   =   a r g s [ 0 ] . r e p l a c e ( / % ( [ a - z % ] ) / g ,   f u n c t i o n ( m a t c h ,   f o r m a t )   { \ n             / /   i f   w e   e n c o u n t e r   a n   e s c a p e d   %   t h e n   d o n ' t   i n c r e a s e   t h e   a r r a y   i n d e x \ n             i f   ( m a t c h   = = =   ' % % ' )   r e t u r n   m a t c h ; \ n             i n d e x + + ; \ n             v a r   f o r m a t t e r   =   e x p o r t s . f o r m a t t e r s [ f o r m a t ] ; \ n             i f   ( ' f u n c t i o n '   = = =   t y p e o f   f o r m a t t e r )   { \ n                 v a r   v a l   =   a r g s [ i n d e x ] ; \ n                 m a t c h   =   f o r m a t t e r . c a l l ( s e l f ,   v a l ) ; \ n \ n                 / /   n o w   w e   n e e d   t o   r e m o v e   ` a r g s [ i n d e x ] `   s i n c e   i t ' s   i n l i n e d   i n   t h e   ` f o r m a t ` \ n                 a r g s . s p l i c e ( i n d e x ,   1 ) ; \ n                 i n d e x - - ; \ n             } \ n             r e t u r n   m a t c h ; \ n         } ) ; \ n \ n         / /   a p p l y   e n v - s p e c i f i c   f o r m a t t i n g \ n         a r g s   =   e x p o r t s . f o r m a t A r g s . a p p l y ( s e l f ,   a r g s ) ; \ n \ n         v a r   l o g F n   =   e n a b l e d . l o g   | |   e x p o r t s . l o g   | |   c o n s o l e . l o g . b i n d ( c o n s o l e ) ; \ n         l o g F n . a p p l y ( s e l f ,   a r g s ) ; \ n     } \ n     e n a b l e d . e n a b l e d   =   t r u e ; \ n \ n     v a r   f n   =   e x p o r t s . e n a b l e d ( n a m e s p a c e )   ?   e n a b l e d   :   d i s a b l e d ; \ n \ n     f n . n a m e s p a c e   =   n a m e s p a c e ; \ n \ n     r e t u r n   f n ; \ n } \ n \ n / * * \ n   *   E n a b l e s   a   d e b u g   m o d e   b y   n a m e s p a c e s .   T h i s   c a n   i n c l u d e   m o d e s \ n   *   s e p a r a t e d   b y   a   c o l o n   a n d   w i l d c a r d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e ( n a m e s p a c e s )   { \ n     e x p o r t s . s a v e ( n a m e s p a c e s ) ; \ n \ n     v a r   s p l i t   =   ( n a m e s p a c e s   | |   ' ' ) . s p l i t ( / [ \ \ s , ] + / ) ; \ n     v a r   l e n   =   s p l i t . l e n g t h ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   l e n ;   i + + )   { \ n         i f   ( ! s p l i t [ i ] )   c o n t i n u e ;   / /   i g n o r e   e m p t y   s t r i n g s \ n         n a m e s p a c e s   =   s p l i t [ i ] . r e p l a c e ( / [ \ \ \ \ ^ $ + ? . ( ) | [ \ \ ] { } ] / g ,   ' \ \ \ \ u s e   t h e   e x i s t i n g   i n s t a n c e   b a s e d   o n   s a m e   s c h e m e / p o r t / h o s t , \ n   *   a n d   w e   i n i t i a l i z e   s o c k e t s   f o r   e a c h   n a m e s p a c e . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o o k u p   ( u r i ,   o p t s )   { \ n     i f   ( t y p e o f   u r i   = = =   ' o b j e c t ' )   { \ n         o p t s   =   u r i ; \ n         u r i   =   u n d e f i n e d ; \ n     } \ n \ n     o p t s   =   o p t s   | |   { } ; \ n \ n     v a r   p a r s e d   =   u r l ( u r i ) ; \ n     v a r   s o u r c e   =   p a r s e d . s o u r c e ; \ n     v a r   i d   =   p a r s e d . i d ; \ n     v a r   p a t h   =   p a r s e d . p a t h ; \ n     v a r   s a m e N a m e s p a c e   =   c a c h e [ i d ]   & &   p a t h   i n   c a c h e [ i d ] . n s p s ; \ n     v a r   n e w C o n n e c t i o n   =   o p t s . f o r c e N e w   | |   o p t s [ ' f o r c e   n e w   c o n n e c t i o n ' ]   | | \ n                                             f a l s e   = = =   o p t s . m u l t i p l e x   | |   s a m e N a m e s p a c e ; \ n \ n     v a r   i o ; \ n \ n     i f   ( n e w C o n n e c t i o n )   { \ n         d e b u g ( ' i g n o r i n g   s o c k e t   c a c h e   f o r   % s ' ,   s o u r c e ) ; \ n         i o   =   M a n a g e r ( s o u r c e ,   o p t s ) ; \ n     }   e l s e   { \ n         i f   ( ! c a c h e [ i d ] )   { \ n             d e b u g ( ' n e w   i o   i n s t a n c e   f o r   % s ' ,   s o u r c e ) ; \ n             c a c h e [ i d ]   =   M a n a g e r ( s o u r c e ,   o p t s ) ; \ n         } \ n         i o   =   c a c h e [ i d ] ; \ n     } \ n     i f   ( p a r s e d . q u e r y   & &   ! o p t s . q u e r y )   { \ n         o p t s . q u e r y   =   p a r s e d . q u e r y ; \ n     }   e l s e   i f   ( o p t s   & &   ' o b j e c t '   = = =   t y p e o f   o p t s . q u e r y )   { \ n         o p t s . q u e r y   =   e n c o d e Q u e r y S t r i n g ( o p t s . q u e r y ) ; \ n     } \ n     r e t u r n   i o . s o c k e t ( p a r s e d . p a t h ,   o p t s ) ; \ n } \ n / * * \ n   *     H e l p e r   m e t h o d   t o   p a r s e   q u e r y   o b j e c t s   t o   s t r i n g . \ n   *   @ p a r a m   { o b j e c t }   q u e r y \ n   *   @ r e t u r n s   { s t r i n g } \ n   * / \ n f u n c t i o n   e n c o d e Q u e r y S t r i n g   ( o b j )   { \ n     v a r   s t r   =   [ ] ; \ n     f o r   ( v a r   p   i n   o b j )   { \ n         i f   ( o b j . h a s O w n P r o p e r t y ( p ) )   { \ n             s t r . p u s h ( e n c o d e U R I C o m p o n e n t ( p )   +   ' = '   +   e n c o d e U R I C o m p o n e n t ( o b j [ p ] ) ) ; \ n         } \ n     } \ n     r e t u r n   s t r . j o i n ( ' & ' ) ; \ n } \ n / * * \ n   *   P r o t o c o l   v e r s i o n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . p r o t o c o l   =   p a r s e r . p r o t o c o l ; \ n \ n / * * \ n   *   ` c o n n e c t ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   u r i \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . c o n n e c t   =   l o o k u p ; \ n \ n / * * \ n   *   E x p o s e   c o n s t r u c t o r s   f o r   s t a n d a l o n e   b u i l d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . M a n a g e r   =   r e q u i r e ( ' . / m a n a g e r ' ) ; \ n e x p o r t s . S o c k e t   =   r e q u i r e ( ' . / s o c k e t ' ) ; \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / i n d e x . j s " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   p a r s e u r i   =   r e q u i r e ( ' p a r s e u r i ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - c l i e n t : u r l ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   u r l ; \ n \ n / * * \ n   *   U R L   p a r s e r . \ n   * \ n   *   @ p a r a m   { S t r i n g }   u r l \ n   *   @ p a r a m   { O b j e c t }   A n   o b j e c t   m e a n t   t o   m i m i c   w i n d o w . l o c a t i o n . \ n   *                                   D e f a u l t s   t o   w i n d o w . l o c a t i o n . \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   u r l   ( u r i ,   l o c )   { \ n     v a r   o b j   =   u r i ; \ n \ n     / /   d e f a u l t   t o   w i n d o w . l o c a t i o n \ n     l o c   =   l o c   | |   g l o b a l . l o c a t i o n ; \ n     i f   ( n u l l   = =   u r i )   u r i   =   l o c . p r o t o c o l   +   ' / / '   +   l o c . h o s t ; \ n \ n     / /   r e l a t i v e   p a t h   s u p p o r t \ n     i f   ( ' s t r i n g '   = = =   t y p e o f   u r i )   { \ n         i f   ( ' / '   = = =   u r i . c h a r A t ( 0 ) )   { \ n             i f   ( ' / '   = = =   u r i . c h a r A t ( 1 ) )   { \ n                 u r i   =   l o c . p r o t o c o l   +   u r i ; \ n             }   e l s e   { \ n                 u r i   =   l o c . h o s t   +   u r i ; \ n             } \ n         } \ n \ n         i f   ( ! / ^ ( h t t p s ? | w s s ? ) : \ \ / \ \ / / . t e s t ( u r i ) )   { \ n             d e b u g ( ' p r o t o c o l - l e s s   u r l   % s ' ,   u r i ) ; \ n             i f   ( ' u n d e f i n e d '   ! = =   t y p e o f   l o c )   { \ n                 u r i   =   l o c . p r o t o c o l   +   ' / / '   +   u r i ; \ n             }   e l s e   { \ n                 u r i   =   ' h t t p s : / / '   +   u r i ; \ n             } \ n         } \ n \ n         / /   p a r s e \ n         d e b u g ( ' p a r s e   % s ' ,   u r i ) ; \ n         o b j   =   p a r s e u r i ( u r i ) ; \ n     } \ n \ n     / /   m a k e   s u r e   w e   t r e a t   ` l o c a l h o s t : 8 0 `   a n d   ` l o c a l h o s t `   e q u a l l y \ n     i f   ( ! o b j . p o r t )   { \ n         i f   ( / ^ ( h t t p | w s ) $ / . t e s t ( o b j . p r o t o c o l ) )   { \ n             o b j . p o r t   =   ' 8 0 ' ; \ n         }   e l s e   i f   ( / ^ ( h t t p | w s ) s $ / . t e s t ( o b j . p r o t o c o l ) )   { \ n             o b j . p o r t   =   ' 4 4 3 ' ; \ n         } \ n     } \ n \ n     o b j . p a t h   =   o b j . p a t h   | |   ' / ' ; \ n \ n     v a r   i p v 6   =   o b j . h o s t . i n d e x O f ( ' : ' )   ! = =   - 1 ; \ n     v a r   h o s t   =   i p v 6   ?   ' [ '   +   o b j . h o s t   +   ' ] '   :   o b j . h o s t ; \ n \ n     / /   d e f i n e   u n i q u e   i d \ n     o b j . i d   =   o b j . p r o t o c o l   +   ' : / / '   +   h o s t   +   ' : '   +   o b j . p o r t ; \ n     / /   d e f i n e   h r e f \ n     o b j . h r e f   =   o b j . p r o t o c o l   +   ' : / / '   +   h o s t   +   ( l o c   & &   l o c . p o r t   = = =   o b j . p o r t   ?   ' '   :   ( ' : '   +   o b j . p o r t ) ) ; \ n \ n     r e t u r n   o b j ; \ n } \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / u r l . j s " , " / * * \ r \ n   *   P a r s e s   a n   U R I \ r \ n   * \ r \ n   *   @ a u t h o r   S t e v e n   L e v i t h a n   < s t e v e n l e v i t h a n . c o m >   ( M I T   l i c e n s e ) \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n v a r   r e   =   / ^ ( ? : ( ? ! [ ^ : @ ] + : [ ^ : @ \ \ / ] * @ ) ( h t t p | h t t p s | w s | w s s ) : \ \ / \ \ / ) ? ( ( ? : ( ( [ ^ : @ ] * ) ( ? : : ( [ ^ : @ ] * ) ) ? ) ? @ ) ? ( ( ? : [ a - f 0 - 9 ] { 0 , 4 } : ) { 2 , 7 } [ a - f 0 - 9 ] { 0 , 4 } | [ ^ : \ \ / ? # ] * ) ( ? : : ( \ \ d * ) ) ? ) ( ( ( \ \ / ( ? : [ ^ ? # ] ( ? ! [ ^ ? # \ \ / ] * \ \ . [ ^ ? # \ \ / . ] + ( ? : [ ? # ] | $ ) ) ) * \ \ / ? ) ? ( [ ^ ? # \ \ / ] * ) ) ( ? : \ \ ? ( [ ^ # ] * ) ) ? ( ? : # ( . * ) ) ? ) / ; \ r \ n \ r \ n v a r   p a r t s   =   [ \ r \ n         ' s o u r c e ' ,   ' p r o t o c o l ' ,   ' a u t h o r i t y ' ,   ' u s e r I n f o ' ,   ' u s e r ' ,   ' p a s s w o r d ' ,   ' h o s t ' ,   ' p o r t ' ,   ' r e l a t i v e ' ,   ' p a t h ' ,   ' d i r e c t o r y ' ,   ' f i l e ' ,   ' q u e r y ' ,   ' a n c h o r ' \ r \ n ] ; \ r \ n \ r \ n m o d u l e . e x p o r t s   =   f u n c t i o n   p a r s e u r i ( s t r )   { \ r \ n         v a r   s r c   =   s t r , \ r \ n                 b   =   s t r . i n d e x O f ( ' [ ' ) , \ r \ n                 e   =   s t r . i n d e x O f ( ' ] ' ) ; \ r \ n \ r \ n         i f   ( b   ! =   - 1   & &   e   ! =   - 1 )   { \ r \ n                 s t r   =   s t r . s u b s t r i n g ( 0 ,   b )   +   s t r . s u b s t r i n g ( b ,   e ) . r e p l a c e ( / : / g ,   ' ; ' )   +   s t r . s u b s t r i n g ( e ,   s t r . l e n g t h ) ; \ r \ n         } \ r \ n \ r \ n         v a r   m   =   r e . e x e c ( s t r   | |   ' ' ) , \ r \ n                 u r i   =   { } , \ r \ n                 i   =   1 4 ; \ r \ n \ r \ n         w h i l e   ( i - - )   { \ r \ n                 u r i [ p a r t s [ i ] ]   =   m [ i ]   | |   ' ' ; \ r \ n         } \ r \ n \ r \ n         i f   ( b   ! =   - 1   & &   e   ! =   - 1 )   { \ r \ n                 u r i . s o u r c e   =   s r c ; \ r \ n                 u r i . h o s t   =   u r i . h o s t . s u b s t r i n g ( 1 ,   u r i . h o s t . l e n g t h   -   1 ) . r e p l a c e ( / ; / g ,   ' : ' ) ; \ r \ n                 u r i . a u t h o r i t y   =   u r i . a u t h o r i t y . r e p l a c e ( ' [ ' ,   ' ' ) . r e p l a c e ( ' ] ' ,   ' ' ) . r e p l a c e ( / ; / g ,   ' : ' ) ; \ r \ n                 u r i . i p v 6 u r i   =   t r u e ; \ r \ n         } \ r \ n \ r \ n         r e t u r n   u r i ; \ r \ n } ; \ r \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p a r s e u r i / i n d e x . j s \ n / /   m o d u l e   i d   =   2 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   w e b   b r o w s e r   i m p l e m e n t a t i o n   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / d e b u g ' ) ; \ n e x p o r t s . l o g   =   l o g ; \ n e x p o r t s . f o r m a t A r g s   =   f o r m a t A r g s ; \ n e x p o r t s . s a v e   =   s a v e ; \ n e x p o r t s . l o a d   =   l o a d ; \ n e x p o r t s . u s e C o l o r s   =   u s e C o l o r s ; \ n e x p o r t s . s t o r a g e   =   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e \ n                               & &   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e . s t o r a g e \ n                                     ?   c h r o m e . s t o r a g e . l o c a l \ n                                     :   l o c a l s t o r a g e ( ) ; \ n \ n / * * \ n   *   C o l o r s . \ n   * / \ n \ n e x p o r t s . c o l o r s   =   [ \ n     ' l i g h t s e a g r e e n ' , \ n     ' f o r e s t g r e e n ' , \ n     ' g o l d e n r o d ' , \ n     ' d o d g e r b l u e ' , \ n     ' d a r k o r c h i d ' , \ n     ' c r i m s o n ' \ n ] ; \ n \ n / * * \ n   *   C u r r e n t l y   o n l y   W e b K i t - b a s e d   W e b   I n s p e c t o r s ,   F i r e f o x   > =   v 3 1 , \ n   *   a n d   t h e   F i r e b u g   e x t e n s i o n   ( a n y   F i r e f o x   v e r s i o n )   a r e   k n o w n \ n   *   t o   s u p p o r t   \ " % c \ "   C S S   c u s t o m i z a t i o n s . \ n   * \ n   *   T O D O :   a d d   a   ` l o c a l S t o r a g e `   v a r i a b l e   t o   e x p l i c i t l y   e n a b l e / d i s a b l e   c o l o r s \ n   * / \ n \ n f u n c t i o n   u s e C o l o r s ( )   { \ n     / /   i s   w e b k i t ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 1 6 4 5 9 6 0 6 / 3 7 6 7 7 3 \ n     / /   d o c u m e n t   i s   u n d e f i n e d   i n   r e a c t - n a t i v e :   h t t p s : / / g i t h u b . c o m / f a c e b o o k / r e a c t - n a t i v e / p u l l / 1 6 3 2 \ n     r e t u r n   ( t y p e o f   d o c u m e n t   ! = =   ' u n d e f i n e d '   & &   ' W e b k i t A p p e a r a n c e '   i n   d o c u m e n t . d o c u m e n t E l e m e n t . s t y l e )   | | \ n         / /   i s   f i r e b u g ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 3 9 8 1 2 0 / 3 7 6 7 7 3 \ n         ( w i n d o w . c o n s o l e   & &   ( c o n s o l e . f i r e b u g   | |   ( c o n s o l e . e x c e p t i o n   & &   c o n s o l e . t a b l e ) ) )   | | \ n         / /   i s   f i r e f o x   > =   v 3 1 ? \ n         / /   h t t p s : / / d e v e l o p e r . m o z i l l a . o r g / e n - U S / d o c s / T o o l s / W e b _ C o n s o l e # S t y l i n g _ m e s s a g e s \ n         ( n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) . m a t c h ( / f i r e f o x \ \ / ( \ \ d + ) / )   & &   p a r s e I n t ( R e g E x p . $ 1 ,   1 0 )   > =   3 1 ) ; \ n } \ n \ n / * * \ n   *   M a p   % j   t o   ` J S O N . s t r i n g i f y ( ) ` ,   s i n c e   n o   W e b   I n s p e c t o r s   d o   t h a t   b y   d e f a u l t . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s . j   =   f u n c t i o n ( v )   { \ n     t r y   { \ n         r e t u r n   J S O N . s t r i n g i f y ( v ) ; \ n     }   c a t c h   ( e r r )   { \ n         r e t u r n   ' [ U n e x p e c t e d J S O N P a r s e E r r o r ] :   '   +   e r r . m e s s a g e ; \ n     } \ n } ; \ n \ n \ n / * * \ n   *   C o l o r i z e   l o g   a r g u m e n t s   i f   e n a b l e d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   f o r m a t A r g s ( )   { \ n     v a r   a r g s   =   a r g u m e n t s ; \ n     v a r   u s e C o l o r s   =   t h i s . u s e C o l o r s ; \ n \ n     a r g s [ 0 ]   =   ( u s e C o l o r s   ?   ' % c '   :   ' ' ) \ n         +   t h i s . n a m e s p a c e \ n         +   ( u s e C o l o r s   ?   '   % c '   :   '   ' ) \ n         +   a r g s [ 0 ] \ n         +   ( u s e C o l o r s   ?   ' % c   '   :   '   ' ) \ n         +   ' + '   +   e x p o r t s . h u m a n i z e ( t h i s . d i f f ) ; \ n \ n     i f   ( ! u s e C o l o r s )   r e t u r n   a r g s ; \ n \ n     v a r   c   =   ' c o l o r :   '   +   t h i s . c o l o r ; \ n     a r g s   =   [ a r g s [ 0 ] ,   c ,   ' c o l o r :   i n h e r i t ' ] . c o n c a t ( A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g s ,   1 ) ) ; \ n \ n     / /   t h e   f i n a l   \ " % c \ "   i s   s o m e w h a t   t r i c k y ,   b e c a u s e   t h e r e   c o u l d   b e   o t h e r \ n     / /   a r g u m e n t s   p a s s e d   e i t h e r   b e f o r e   o r   a f t e r   t h e   % c ,   s o   w e   n e e d   t o \ n     / /   f i g u r e   o u t   t h e   c o r r e c t   i n d e x   t o   i n s e r t   t h e   C S S   i n t o \ n     v a r   i n d e x   =   0 ; \ n     v a r   l a s t C   =   0 ; \ n     a r g s [ 0 ] . r e p l a c e ( / % [ a - z % ] / g ,   f u n c t i o n ( m a t c h )   { \ n         i f   ( ' % % '   = = =   m a t c h )   r e t u r n ; \ n         i n d e x + + ; \ n         i f   ( ' % c '   = = =   m a t c h )   { \ n             / /   w e   o n l y   a r e   i n t e r e s t e d   i n   t h e   * l a s t *   % c \ n             / /   ( t h e   u s e r   m a y   h a v e   p r o v i d e d   t h e i r   o w n ) \ n             l a s t C   =   i n d e x ; \ n         } \ n     } ) ; \ n \ n     a r g s . s p l i c e ( l a s t C ,   0 ,   c ) ; \ n     r e t u r n   a r g s ; \ n } \ n \ n / * * \ n   *   I n v o k e s   ` c o n s o l e . l o g ( ) `   w h e n   a v a i l a b l e . \ n   *   N o - o p   w h e n   ` c o n s o l e . l o g `   i s   n o t   a   \ " f u n c t i o n \ " . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o g ( )   { \ n     / /   t h i s   h a c k e r y   i s    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   f o r   I E 8 / 9 ,   w h e r e \ n     / /   t h e   ` c o n s o l e . l o g `   f u n c t i o n   d o e s n ' t   h a v e   ' a p p l y ' \ n     r e t u r n   ' o b j e c t '   = = =   t y p e o f   c o n s o l e \ n         & &   c o n s o l e . l o g \ n         & &   F u n c t i o n . p r o t o t y p e . a p p l y . c a l l ( c o n s o l e . l o g ,   c o n s o l e ,   a r g u m e n t s ) ; \ n } \ n \ n / * * \ n   *   S a v e   ` n a m e s p a c e s ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s a v e ( n a m e s p a c e s )   { \ n     t r y   { \ n         i f   ( n u l l   = =   n a m e s p a c e s )   { \ n             e x p o r t s . s t o r a g e . r e m o v e I t e m ( ' d e b u g ' ) ; \ n         }   e l s e   { \ n             e x p o r t s . s t o r a g e . d e b u g   =   n a m e s p a c e s ; \ n         } \ n     }   c a t c h ( e )   { } \ n } \ n \ n / * * \ n   *   L o a d   ` n a m e s p a c e s ` . \ n   * \ n   *   @ r e t u r n   { S t r i n g }   r e t u r n s   t h e   p r e v i o u s l y   p e r s i s t e d   d e b u g   m o d e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o a d ( )   { \ n     v a r   r ; \ n     t r y   { \ n         r e t u r n   e x p o r t s . s t o r a g e . d e b u g ; \ n     }   c a t c h ( e )   { } \ n \ n     / /   I f   d e b u g   i s n ' t   s e t   i n   L S ,   a n d   w e ' r e   i n   E l e c t r o n ,   t r y   t o   l o a d   $ D E B U G \ n     i f   ( t y p e o f   p r o c e s s   ! = =   ' u n d e f i n e d '   & &   ' e n v '   i n   p r o c e s s )   { \ n         r e t u r n   p r o c e s s . e n v . D E B U G ; \ n     } \ n } \ n \ n / * * \ n   *   E n a b l e   n a m e s p a c e s   l i s t e d   i n   ` l o c a l S t o r a g e . d e b u g `   i n i t i a l l y . \ n   * / \ n \ n e x p o r t s . e n a b l e ( l o a d ( ) ) ; \ n \ n / * * \ n   *   L o c a l s t o r a g e   a t t e m p t s   t o   r e t u r n   t h e   l o c a l s t o r a g e . \ n   * \ n   *   T h i s   i s   n e c e s s a r y   b e c a u s e   s a f a r i   t h r o w s \ n   *   w h e n   a   u s e r   d i s a b l e s   c o o k i e s / l o c a l s t o r a g e \ n   *   a n d   y o u   a t t e m p t   t o   a c c e s s   i t . \ n   * \ n   *   @ r e t u r n   { L o c a l S t o r a g e } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o c a l s t o r a g e ( ) { \ n     t r y   { \ n         r e t u r n   w i n d o w . l o c a l S t o r a g e ; \ n     }   c a t c h   ( e )   { } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / d e b u g / b r o w s e r . j s \ n / /   m o d u l e   i d   =   3 \ n / /   m o d u l e   c h u n k s   =   0 " , " / /   s h i m   f o r   u s i n g   p r o c e s s   i n   b r o w s e r \ n v a r   p r o c e s s   =   m o d u l e . e x p o r t s   =   { } ; \ n \ n / /   c a c h e d   f r o m   w h a t e v e r   g l o b a l   i s   p r e s e n t   s o   t h a t   t e s t   r u n n e r s   t h a t   s t u b   i t \ n / /   d o n ' t   b r e a k   t h i n g s .     B u t   w e   n e e d   t o   w r a p   i t   i n   a   t r y   c a t c h   i n   c a s e   i t   i s \ n / /   w r a p p e d   i n   s t r i c t   m o d e   c o d e   w h i c h   d o e s n ' t   d e f i n e   a n y   g l o b a l s .     I t ' s   i n s i d e   a \ n / /   f u n c t i o n   b e c a u s e   t r y / c a t c h e s   d e o p t i m i z e   i n   c e r t a i n   e n g i n e s . \ n \ n v a r   c a c h e d S e t T i m e o u t ; \ n v a r   c a c h e d C l e a r T i m e o u t ; \ n \ n f u n c t i o n   d e f a u l t S e t T i m o u t ( )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' s e t T i m e o u t   h a s   n o t   b e e n   d e f i n e d ' ) ; \ n } \ n f u n c t i o n   d e f a u l t C l e a r T i m e o u t   ( )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' c l e a r T i m e o u t   h a s   n o t   b e e n   d e f i n e d ' ) ; \ n } \ n ( f u n c t i o n   ( )   { \ n         t r y   { \ n                 i f   ( t y p e o f   s e t T i m e o u t   = = =   ' f u n c t i o n ' )   { \ n                         c a c h e d S e t T i m e o u t   =   s e t T i m e o u t ; \ n                 }   e l s e   { \ n                         c a c h e d S e t T i m e o u t   =   d e f a u l t S e t T i m o u t ; \ n                 } \ n         }   c a t c h   ( e )   { \ n                 c a c h e d S e t T i m e o u t   =   d e f a u l t S e t T i m o u t ; \ n         } \ n         t r y   { \ n                 i f   ( t y p e o f   c l e a r T i m e o u t   = = =   ' f u n c t i o n ' )   { \ n                         c a c h e d C l e a r T i m e o u t   =   c l e a r T i m e o u t ; \ n                 }   e l s e   { \ n                         c a c h e d C l e a r T i m e o u t   =   d e f a u l t C l e a r T i m e o u t ; \ n                 } \ n         }   c a t c h   ( e )   { \ n                 c a c h e d C l e a r T i m e o u t   =   d e f a u l t C l e a r T i m e o u t ; \ n         } \ n }   ( ) ) \ n f u n c t i o n   r u n T i m e o u t ( f u n )   { \ n         i f   ( c a c h e d S e t T i m e o u t   = = =   s e t T i m e o u t )   { \ n                 / / n o r m a l   e n v i r o m e n t s   i n   s a n e   s i t u a t i o n s \ n                 r e t u r n   s e t T i m e o u t ( f u n ,   0 ) ; \ n         } \ n         / /   i f   s e t T i m e o u t   w a s n ' t   a v a i l a b l e   b u t   w a s   l a t t e r   d e f i n e d \ n         i f   ( ( c a c h e d S e t T i m e o u t   = = =   d e f a u l t S e t T i m o u t   | |   ! c a c h e d S e t T i m e o u t )   & &   s e t T i m e o u t )   { \ n                 c a c h e d S e t T i m e o u t   =   s e t T i m e o u t ; \ n                 r e t u r n   s e t T i m e o u t ( f u n ,   0 ) ; \ n         } \ n         t r y   { \ n                 / /   w h e n   w h e n   s o m e b o d y   h a s   s c r e w e d   w i t h   s e t T i m e o u t   b u t   n o   I . E .   m a d d n e s s \ n                 r e t u r n   c a c h e d S e t T i m e o u t ( f u n ,   0 ) ; \ n         }   c a t c h ( e ) { \ n                 t r y   { \ n                         / /   W h e n   w e   a r e   i n   I . E .   b u t   t h e   s c r i p t   h a s   b e e n   e v a l e d   s o   I . E .   d o e s n ' t   t r u s t   t h e   g l o b a l   o b j e c t   w h e n   c a l l e d   n o r m a l l y \ n                         r e t u r n   c a c h e d S e t T i m e o u t . c a l l ( n u l l ,   f u n ,   0 ) ; \ n                 }   c a t c h ( e ) { \ n                         / /   s a m e   a s   a b o v e   b u t   w h e n   i t ' s   a   v e r s i o n   o f   I . E .   t h a t    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   h a v e   t h e   g l o b a l   o b j e c t   f o r   ' t h i s ' ,   h o p f u l l y   o u r   c o n t e x t   c o r r e c t   o t h e r w i s e   i t   w i l l   t h r o w   a   g l o b a l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m \ n                         r e t u r n   c a c h e d S e t T i m e o u t . c a l l ( t h i s ,   f u n ,   0 ) ; \ n                 } \ n         } \ n \ n \ n } \ n f u n c t i o n   r u n C l e a r T i m e o u t ( m a r k e r )   { \ n         i f   ( c a c h e d C l e a r T i m e o u t   = = =   c l e a r T i m e o u t )   { \ n                 / / n o r m a l   e n v i r o m e n t s   i n   s a n e   s i t u a t i o n s \ n                 r e t u r n   c l e a r T i m e o u t ( m a r k e r ) ; \ n         } \ n         / /   i f   c l e a r T i m e o u t   w a s n ' t   a v a i l a b l e   b u t   w a s   l a t t e r   d e f i n e d \ n         i f   ( ( c a c h e d C l e a r T i m e o u t   = = =   d e f a u l t C l e a r T i m e o u t   | |   ! c a c h e d C l e a r T i m e o u t )   & &   c l e a r T i m e o u t )   { \ n                 c a c h e d C l e a r T i m e o u t   =   c l e a r T i m e o u t ; \ n                 r e t u r n   c l e a r T i m e o u t ( m a r k e r ) ; \ n         } \ n         t r y   { \ n                 / /   w h e n   w h e n   s o m e b o d y   h a s   s c r e w e d   w i t h   s e t T i m e o u t   b u t   n o   I . E .   m a d d n e s s \ n                 r e t u r n   c a c h e d C l e a r T i m e o u t ( m a r k e r ) ; \ n         }   c a t c h   ( e ) { \ n                 t r y   { \ n                         / /   W h e n   w e   a r e   i n   I . E .   b u t   t h e   s c r i p t   h a s   b e e n   e v a l e d   s o   I . E .   d o e s n ' t     t r u s t   t h e   g l o b a l   o b j e c t   w h e n   c a l l e d   n o r m a l l y \ n                         r e t u r n   c a c h e d C l e a r T i m e o u t . c a l l ( n u l l ,   m a r k e r ) ; \ n                 }   c a t c h   ( e ) { \ n                         / /   s a m e   a s   a b o v e   b u t   w h e n   i t ' s   a   v e r s i o n   o f   I . E .   t h a t    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   h a v e   t h e   g l o b a l   o b j e c t   f o r   ' t h i s ' ,   h o p f u l l y   o u r   c o n t e x t   c o r r e c t   o t h e r w i s e   i t   w i l l   t h r o w   a   g l o b a l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . \ n                         / /   S o m e   v e r s i o n s   o f   I . E .   h a v e   d i f f e r e n t   r u l e s   f o r   c l e a r T i m e o u t   v s   s e t T i m e o u t \ n                         r e t u r n   c a c h e d C l e a r T i m e o u t . c a l l ( t h i s ,   m a r k e r ) ; \ n                 } \ n         } \ n \ n \ n \ n } \ n v a r   q u e u e   =   [ ] ; \ n v a r   d r a i n i n g   =   f a l s e ; \ n v a r   c u r r e n t Q u e u e ; \ n v a r   q u e u e I n d e x   =   - 1 ; \ n \ n f u n c t i o n   c l e a n U p N e x t T i c k ( )   { \ n         i f   ( ! d r a i n i n g   | |   ! c u r r e n t Q u e u e )   { \ n                 r e t u r n ; \ n         } \ n         d r a i n i n g   =   f a l s e ; \ n         i f   ( c u r r e n t Q u e u e . l e n g t h )   { \ n                 q u e u e   =   c u r r e n t Q u e u e . c o n c a t ( q u e u e ) ; \ n         }   e l s e   { \ n                 q u e u e I n d e x   =   - 1 ; \ n         } \ n         i f   ( q u e u e . l e n g t h )   { \ n                 d r a i n Q u e u e ( ) ; \ n         } \ n } \ n \ n f u n c t i o n   d r a i n Q u e u e ( )   { \ n         i f   ( d r a i n i n g )   { \ n                 r e t u r n ; \ n         } \ n         v a r   t i m e o u t   =   r u n T i m e o u t ( c l e a n U p N e x t T i c k ) ; \ n         d r a i n i n g   =   t r u e ; \ n \ n         v a r   l e n   =   q u e u e . l e n g t h ; \ n         w h i l e ( l e n )   { \ n                 c u r r e n t Q u e u e   =   q u e u e ; \ n                 q u e u e   =   [ ] ; \ n                 w h i l e   ( + + q u e u e I n d e x   <   l e n )   { \ n                         i f   ( c u r r e n t Q u e u e )   { \ n                                 c u r r e n t Q u e u e [ q u e u e I n d e x ] . r u n ( ) ; \ n                         } \ n                 } \ n                 q u e u e I n d e x   =   - 1 ; \ n                 l e n   =   q u e u e . l e n g t h ; \ n         } \ n         c u r r e n t Q u e u e   =   n u l l ; \ n         d r a i n i n g   =   f a l s e ; \ n         r u n C l e a r T i m e o u t ( t i m e o u t ) ; \ n } \ n \ n p r o c e s s . n e x t T i c k   =   f u n c t i o n   ( f u n )   { \ n         v a r   a r g s   =   n e w   A r r a y ( a r g u m e n t s . l e n g t h   -   1 ) ; \ n         i f   ( a r g u m e n t s . l e n g t h   >   1 )   { \ n                 f o r   ( v a r   i   =   1 ;   i   <   a r g u m e n t s . l e n g t h ;   i + + )   { \ n                         a r g s [ i   -   1 ]   =   a r g u m e n t s [ i ] ; \ n                 } \ n         } \ n         q u e u e . p u s h ( n e w   I t e m ( f u n ,   a r g s ) ) ; \ n         i f   ( q u e u e . l e n g t h   = = =   1   & &   ! d r a i n i n g )   { \ n                 r u n T i m e o u t ( d r a i n Q u e u e ) ; \ n         } \ n } ; \ n \ n / /   v 8   l i k e s   p r e d i c t i b l e   o b j e c t s \ n f u n c t i o n   I t e m ( f u n ,   a r r a y )   { \ n         t h i s . f u n   =   f u n ; \ n         t h i s . a r r a y   =   a r r a y ; \ n } \ n I t e m . p r o t o t y p e . r u n   =   f u n c t i o n   ( )   { \ n         t h i s . f u n . a p p l y ( n u l l ,   t h i s . a r r a y ) ; \ n } ; \ n p r o c e s s . t i t l e   =   ' b r o w s e r ' ; \ n p r o c e s s . b r o w s e r   =   t r u e ; \ n p r o c e s s . e n v   =   { } ; \ n p r o c e s s . a r g v   =   [ ] ; \ n p r o c e s s . v e r s i o n   =   ' ' ;   / /   e m p t y   s t r i n g   t o   a v o i d   r e g e x p   i s s u e s \ n p r o c e s s . v e r s i o n s   =   { } ; \ n \ n f u n c t i o n   n o o p ( )   { } \ n \ n p r o c e s s . o n   =   n o o p ; \ n p r o c e s s . a d d L i s t e n e r   =   n o o p ; \ n p r o c e s s . o n c e   =   n o o p ; \ n p r o c e s s . o f f   =   n o o p ; \ n p r o c e s s . r e m o v e L i s t e n e r   =   n o o p ; \ n p r o c e s s . r e m o v e A l l L i s t e n e r s   =   n o o p ; \ n p r o c e s s . e m i t   =   n o o p ; \ n \ n p r o c e s s . b i n d i n g   =   f u n c t i o n   ( n a m e )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o c e s s . b i n d i n g   i s    [ 1 m  [ 3 1 m n o t   s u p p o r t e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n } ; \ n \ n p r o c e s s . c w d   =   f u n c t i o n   ( )   {   r e t u r n   ' / '   } ; \ n p r o c e s s . c h d i r   =   f u n c t i o n   ( d i r )   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o c e s s . c h d i r   i s    [ 1 m  [ 3 1 m n o t   s u p p o r t e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n } ; \ n p r o c e s s . u m a s k   =   f u n c t i o n ( )   {   r e t u r n   0 ;   } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p r o c e s s / b r o w s e r . j s \ n / /   m o d u l e   i d   =   4 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   c o m m o n   l o g i c   f o r   b o t h   t h e   N o d e . j s   a n d   w e b   b r o w s e r \ n   *   i m p l e m e n t a t i o n s   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   d e b u g . d e b u g   =   d e b u g ; \ n e x p o r t s . c o e r c e   =   c o e r c e ; \ n e x p o r t s . d i s a b l e   =   d i s a b l e ; \ n e x p o r t s . e n a b l e   =   e n a b l e ; \ n e x p o r t s . e n a b l e d   =   e n a b l e d ; \ n e x p o r t s . h u m a n i z e   =   r e q u i r e ( ' m s ' ) ; \ n \ n / * * \ n   *   T h e   c u r r e n t l y   a c t i v e   d e b u g   m o d e   n a m e s ,   a n d   n a m e s   t o   s k i p . \ n   * / \ n \ n e x p o r t s . n a m e s   =   [ ] ; \ n e x p o r t s . s k i p s   =   [ ] ; \ n \ n / * * \ n   *   M a p   o f   s p e c i a l   \ " % n \ "   h a n d l i n g   f u n c t i o n s ,   f o r   t h e   d e b u g   \ " f o r m a t \ "   a r g u m e n t . \ n   * \ n   *   V a l i d   k e y   n a m e s   a r e   a   s i n g l e ,   l o w e r c a s e d   l e t t e r ,   i . e .   \ " n \ " . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s   =   { } ; \ n \ n / * * \ n   *   P r e v i o u s l y   a s s i g n e d   c o l o r . \ n   * / \ n \ n v a r   p r e v C o l o r   =   0 ; \ n \ n / * * \ n   *   P r e v i o u s   l o g   t i m e s t a m p . \ n   * / \ n \ n v a r   p r e v T i m e ; \ n \ n / * * \ n   *   S e l e c t   a   c o l o r . \ n   * \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s e l e c t C o l o r ( )   { \ n     r e t u r n   e x p o r t s . c o l o r s [ p r e v C o l o r + +   %   e x p o r t s . c o l o r s . l e n g t h ] ; \ n } \ n \ n / * * \ n   *   C r e a t e   a   d e b u g g e r   w i t h   t h e   g i v e n   ` n a m e s p a c e ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e \ n   *   @ r e t u r n   { F u n c t i o n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d e b u g ( n a m e s p a c e )   { \ n \ n     / /   d e f i n e   t h e   ` d i s a b l e d `   v e r s i o n \ n     f u n c t i o n   d i s a b l e d ( )   { \ n     } \ n     d i s a b l e d . e n a b l e d   =   f a l s e ; \ n \ n     / /   d e f i n e   t h e   ` e n a b l e d `   v e r s i o n \ n     f u n c t i o n   e n a b l e d ( )   { \ n \ n         v a r   s e l f   =   e n a b l e d ; \ n \ n         / /   s e t   ` d i f f `   t i m e s t a m p \ n         v a r   c u r r   =   + n e w   D a t e ( ) ; \ n         v a r   m s   =   c u r r   -   ( p r e v T i m e   | |   c u r r ) ; \ n         s e l f . d i f f   =   m s ; \ n         s e l f . p r e v   =   p r e v T i m e ; \ n         s e l f . c u r r   =   c u r r ; \ n         p r e v T i m e   =   c u r r ; \ n \ n         / /   a d d   t h e   ` c o l o r `   i f   n o t   s e t \ n         i f   ( n u l l   = =   s e l f . u s e C o l o r s )   s e l f . u s e C o l o r s   =   e x p o r t s . u s e C o l o r s ( ) ; \ n         i f   ( n u l l   = =   s e l f . c o l o r   & &   s e l f . u s e C o l o r s )   s e l f . c o l o r   =   s e l e c t C o l o r ( ) ; \ n \ n         v a r   a r g s   =   n e w   A r r a y ( a r g u m e n t s . l e n g t h ) ; \ n         f o r   ( v a r   i   =   0 ;   i   <   a r g s . l e n g t h ;   i + + )   { \ n             a r g s [ i ]   =   a r g u m e n t s [ i ] ; \ n         } \ n \ n         a r g s [ 0 ]   =   e x p o r t s . c o e r c e ( a r g s [ 0 ] ) ; \ n \ n         i f   ( ' s t r i n g '   ! = =   t y p e o f   a r g s [ 0 ] )   { \ n             / /   a n y t h i n g   e l s e   l e t ' s   i n s p e c t   w i t h   % o \ n             a r g s   =   [ ' % o ' ] . c o n c a t ( a r g s ) ; \ n         } \ n \ n         / /   a p p l y   a n y   ` f o r m a t t e r s `   t r a n s f o r m a t i o n s \ n         v a r   i n d e x   =   0 ; \ n         a r g s [ 0 ]   =   a r g s [ 0 ] . r e p l a c e ( / % ( [ a - z % ] ) / g ,   f u n c t i o n ( m a t c h ,   f o r m a t )   { \ n             / /   i f   w e   e n c o u n t e r   a n   e s c a p e d   %   t h e n   d o n ' t   i n c r e a s e   t h e   a r r a y   i n d e x \ n             i f   ( m a t c h   = = =   ' % % ' )   r e t u r n   m a t c h ; \ n             i n d e x + + ; \ n             v a r   f o r m a t t e r   =   e x p o r t s . f o r m a t t e r s [ f o r m a t ] ; \ n             i f   ( ' f u n c t i o n '   = = =   t y p e o f   f o r m a t t e r )   { \ n                 v a r   v a l   =   a r g s [ i n d e x ] ; \ n                 m a t c h   =   f o r m a t t e r . c a l l ( s e l f ,   v a l ) ; \ n \ n                 / /   n o w   w e   n e e d   t o   r e m o v e   ` a r g s [ i n d e x ] `   s i n c e   i t ' s   i n l i n e d   i n   t h e   ` f o r m a t ` \ n                 a r g s . s p l i c e ( i n d e x ,   1 ) ; \ n                 i n d e x - - ; \ n             } \ n             r e t u r n   m a t c h ; \ n         } ) ; \ n \ n         / /   a p p l y   e n v - s p e c i f i c   f o r m a t t i n g \ n         a r g s   =   e x p o r t s . f o r m a t A r g s . a p p l y ( s e l f ,   a r g s ) ; \ n \ n         v a r   l o g F n   =   e n a b l e d . l o g   | |   e x p o r t s . l o g   | |   c o n s o l e . l o g . b i n d ( c o n s o l e ) ; \ n         l o g F n . a p p l y ( s e l f ,   a r g s ) ; \ n     } \ n     e n a b l e d . e n a b l e d   =   t r u e ; \ n \ n     v a r   f n   =   e x p o r t s . e n a b l e d ( n a m e s p a c e )   ?   e n a b l e d   :   d i s a b l e d ; \ n \ n     f n . n a m e s p a c e   =   n a m e s p a c e ; \ n \ n     r e t u r n   f n ; \ n } \ n \ n / * * \ n   *   E n a b l e s   a   d e b u g   m o d e   b y   n a m e s p a c e s .   T h i s   c a n   i n c l u d e   m o d e s \ n   *   s e p a r a t e d   b y   a   c o l o n   a n d   w i l d c a r d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e ( n a m e s p a c e s )   { \ n     e x p o r t s . s a v e ( n a m e s p a c e s ) ; \ n \ n     v a r   s p l i t   =   ( n a m e s p a c e s   | |   ' ' ) . s p l i t ( / [ \ \ s , ] + / ) ; \ n     v a r   l e n   =   s p l i t . l e n g t h ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   l e n ;   i + + )   { \ n         i f   ( ! s p l i t [ i ] )   c o n t i n u e ;   / /   i g n o r e   e m p t y   s t r i n g s \ n         n a m e s p a c e s   =   s p l i t [ i ] . r e p l a c e ( / [ \ \ \ \ ^ $ + ? . ( ) | [ \ \ ] { } ] / g ,   ' \ \ \ \ $ & ' ) . r e p l a c e ( / \ \ * / g ,   ' . * ? ' ) ; \ n         i f   ( n a m e s p a c e s [ 0 ]   = = =   ' - ' )   { \ n             e x p o r t s . s k i p s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s . s u b s t r ( 1 )   +   ' $ ' ) ) ; \ n         }   e l s e   { \ n             e x p o r t s . n a m e s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s   +   ' $ ' ) ) ; \ n         } \ n     } \ n } \ n \ n / * * \ n   *   D i s a b l e   d e b u g   o u t p u t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d i s a b l e ( )   { \ n     e x p o r t s . e n a b l e ( ' ' ) ; \ n } \ n \ n / * * \ n   *   R e t u r n s   t r u e   i f   t h e   g i v e n   m o d e   n a m e   i s   e n a b l e d ,   f a l s e   o t h e r w i s e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e \ n   *   @ r e t u r n   { B o o l e a n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e d ( n a m e )   { \ n     v a r   i ,   l e n ; \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . s k i p s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . s k i p s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   f a l s e ; \ n         } \ n     } \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . n a m e s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . n a m e s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   t r u e ; \ n         } \ n     } \ n     r e t u r n   f a l s e ; \ n } \ n \ n / * * \ n   *   C o e r c e   ` v a l ` . \ n   * \ n   *   @ p a r a m   { M i x e d }   v a l \ n   *   @ r e t u r n   { M i x e d } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   c o e r c e ( v a l )   { \ n     i f   ( v a l   i n s t a n c e o f    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n   v a l . s t a c k   | |   v a l . m e s s a g e ; \ n     r e t u r n   v a l ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / d e b u g / d e b u g . j s \ n / /   m o d u l e   i d   =   5 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   H e l p e r s . \ n   * / \ n \ n v a r   s   =   1 0 0 0 \ n v a r   m   =   s   *   6 0 \ n v a r   h   =   m   *   6 0 \ n v a r   d   =   h   *   2 4 \ n v a r   y   =   d   *   3 6 5 . 2 5 \ n \ n / * * \ n   *   P a r s e   o r   f o r m a t   t h e   g i v e n   ` v a l ` . \ n   * \ n   *   O p t i o n s : \ n   * \ n   *     -   ` l o n g `   v e r b o s e   f o r m a t t i n g   [ f a l s e ] \ n   * \ n   *   @ p a r a m   { S t r i n g | N u m b e r }   v a l \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ t h r o w s   {  [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m }   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   v a l   i s   n o t   a   n o n - e m p t y   s t r i n g   o r   a   n u m b e r \ n   *   @ r e t u r n   { S t r i n g | N u m b e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n   ( v a l ,   o p t i o n s )   { \ n     o p t i o n s   =   o p t i o n s   | |   { } \ n     v a r   t y p e   =   t y p e o f   v a l \ n     i f   ( t y p e   = = =   ' s t r i n g '   & &   v a l . l e n g t h   >   0 )   { \ n         r e t u r n   p a r s e ( v a l ) \ n     }   e l s e   i f   ( t y p e   = = =   ' n u m b e r '   & &   i s N a N ( v a l )   = = =   f a l s e )   { \ n         r e t u r n   o p t i o n s . l o n g   ? \ n \ t \ t \ t f m t L o n g ( v a l )   : \ n \ t \ t \ t f m t S h o r t ( v a l ) \ n     } \ n     t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' v a l   i s   n o t   a   n o n - e m p t y   s t r i n g   o r   a   v a l i d   n u m b e r .   v a l = '   +   J S O N . s t r i n g i f y ( v a l ) ) \ n } \ n \ n / * * \ n   *   P a r s e   t h e   g i v e n   ` s t r `   a n d   r e t u r n   m i l l i s e c o n d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   p a r s e ( s t r )   { \ n     s t r   =   S t r i n g ( s t r ) \ n     i f   ( s t r . l e n g t h   >   1 0 0 0 0 )   { \ n         r e t u r n \ n     } \ n     v a r   m a t c h   =   / ^ ( ( ? : \ \ d + ) ? \ \ . ? \ \ d + )   * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | y e a r s ? | y r s ? | y ) ? $ / i . e x e c ( s t r ) \ n     i f   ( ! m a t c h )   { \ n         r e t u r n \ n     } \ n     v a r   n   =   p a r s e F l o a t ( m a t c h [ 1 ] ) \ n     v a r   t y p e   =   ( m a t c h [ 2 ]   | |   ' m s ' ) . t o L o w e r C a s e ( ) \ n     s w i t c h   ( t y p e )   { \ n         c a s e   ' y e a r s ' : \ n         c a s e   ' y e a r ' : \ n         c a s e   ' y r s ' : \ n         c a s e   ' y r ' : \ n         c a s e   ' y ' : \ n             r e t u r n   n   *   y \ n         c a s e   ' d a y s ' : \ n         c a s e   ' d a y ' : \ n         c a s e   ' d ' : \ n             r e t u r n   n   *   d \ n         c a s e   ' h o u r s ' : \ n         c a s e   ' h o u r ' : \ n         c a s e   ' h r s ' : \ n         c a s e   ' h r ' : \ n         c a s e   ' h ' : \ n             r e t u r n   n   *   h \ n         c a s e   ' m i n u t e s ' : \ n         c a s e   ' m i n u t e ' : \ n         c a s e   ' m i n s ' : \ n         c a s e   ' m i n ' : \ n         c a s e   ' m ' : \ n             r e t u r n   n   *   m \ n         c a s e   ' s e c o n d s ' : \ n         c a s e   ' s e c o n d ' : \ n         c a s e   ' s e c s ' : \ n         c a s e   ' s e c ' : \ n         c a s e   ' s ' : \ n             r e t u r n   n   *   s \ n         c a s e   ' m i l l i s e c o n d s ' : \ n         c a s e   ' m i l l i s e c o n d ' : \ n         c a s e   ' m s e c s ' : \ n         c a s e   ' m s e c ' : \ n         c a s e   ' m s ' : \ n             r e t u r n   n \ n         d e f a u l t : \ n             r e t u r n   u n d e f i n e d \ n     } \ n } \ n \ n / * * \ n   *   S h o r t   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   f m t S h o r t ( m s )   { \ n     i f   ( m s   > =   d )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   d )   +   ' d ' \ n     } \ n     i f   ( m s   > =   h )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   h )   +   ' h ' \ n     } \ n     i f   ( m s   > =   m )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   m )   +   ' m ' \ n     } \ n     i f   ( m s   > =   s )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   s )   +   ' s ' \ n     } \ n     r e t u r n   m s   +   ' m s ' \ n } \ n \ n / * * \ n   *   L o n g   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   f m t L o n g ( m s )   { \ n     r e t u r n   p l u r a l ( m s ,   d ,   ' d a y ' )   | | \ n         p l u r a l ( m s ,   h ,   ' h o u r ' )   | | \ n         p l u r a l ( m s ,   m ,   ' m i n u t e ' )   | | \ n         p l u r a l ( m s ,   s ,   ' s e c o n d ' )   | | \ n         m s   +   '   m s ' \ n } \ n \ n / * * \ n   *   P l u r a l i z a t i o n   h e l p e r . \ n   * / \ n \ n f u n c t i o n   p l u r a l ( m s ,   n ,   n a m e )   { \ n     i f   ( m s   <   n )   { \ n         r e t u r n \ n     } \ n     i f   ( m s   <   n   *   1 . 5 )   { \ n         r e t u r n   M a t h . f l o o r ( m s   /   n )   +   '   '   +   n a m e \ n     } \ n     r e t u r n   M a t h . c e i l ( m s   /   n )   +   '   '   +   n a m e   +   ' s ' \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / m s / i n d e x . j s \ n / /   m o d u l e   i d   =   6 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - p a r s e r ' ) ; \ n v a r   j s o n   =   r e q u i r e ( ' j s o n 3 ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   b i n a r y   =   r e q u i r e ( ' . / b i n a r y ' ) ; \ n v a r   i s B u f   =   r e q u i r e ( ' . / i s - b u f f e r ' ) ; \ n \ n / * * \ n   *   P r o t o c o l   v e r s i o n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . p r o t o c o l   =   4 ; \ n \ n / * * \ n   *   P a c k e t   t y p e s . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . t y p e s   =   [ \ n     ' C O N N E C T ' , \ n     ' D I S C O N N E C T ' , \ n     ' E V E N T ' , \ n     ' A C K ' , \ n     '  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m ' , \ n     ' B I N A R Y _ E V E N T ' , \ n     ' B I N A R Y _ A C K ' \ n ] ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` c o n n e c t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . C O N N E C T   =   0 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` d i s c o n n e c t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . D I S C O N N E C T   =   1 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` e v e n t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . E V E N T   =   2 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` a c k ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . A C K   =   3 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   `  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s .  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m   =   4 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ' b i n a r y   e v e n t ' \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . B I N A R Y _ E V E N T   =   5 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` b i n a r y   a c k ` .   F o r   a c k s   w i t h   b i n a r y   a r g u m e n t s . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . B I N A R Y _ A C K   =   6 ; \ n \ n / * * \ n   *   E n c o d e r   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . E n c o d e r   =   E n c o d e r ; \ n \ n / * * \ n   *   D e c o d e r   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . D e c o d e r   =   D e c o d e r ; \ n \ n / * * \ n   *   A   s o c k e t . i o   E n c o d e r   i n s t a n c e \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   E n c o d e r ( )   { } \ n \ n / * * \ n   *   E n c o d e   a   p a c k e t   a s   a   s i n g l e   s t r i n g   i f   n o n - b i n a r y ,   o r   a s   a \ n   *   b u f f e r   s e q u e n c e ,   d e p e n d i n g   o n   p a c k e t   t y p e . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o b j   -   p a c k e t   o b j e c t \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k   -   f u n c t i o n   t o   h a n d l e   e n c o d i n g s   ( l i k e l y   e n g i n e . w r i t e ) \ n   *   @ r e t u r n   C a l l s   c a l l b a c k   w i t h   A r r a y   o f   e n c o d i n g s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E n c o d e r . p r o t o t y p e . e n c o d e   =   f u n c t i o n ( o b j ,   c a l l b a c k ) { \ n     d e b u g ( ' e n c o d i n g   p a c k e t   % j ' ,   o b j ) ; \ n \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   o b j . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   o b j . t y p e )   { \ n         e n c o d e A s B i n a r y ( o b j ,   c a l l b a c k ) ; \ n     } \ n     e l s e   { \ n         v a r   e n c o d i n g   =   e n c o d e A s S t r i n g ( o b j ) ; \ n         c a l l b a c k ( [ e n c o d i n g ] ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   E n c o d e   p a c k e t   a s   s t r i n g . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { S t r i n g }   e n c o d e d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   e n c o d e A s S t r i n g ( o b j )   { \ n     v a r   s t r   =   ' ' ; \ n     v a r   n s p   =   f a l s e ; \ n \ n     / /   f i r s t   i s   t y p e \ n     s t r   + =   o b j . t y p e ; \ n \ n     / /   a t t a c h m e n t s   i f   w e   h a v e   t h e m \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   o b j . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   o b j . t y p e )   { \ n         s t r   + =   o b j . a t t a c h m e n t s ; \ n         s t r   + =   ' - ' ; \ n     } \ n \ n     / /   i f   w e   h a v e   a   n a m e s p a c e   o t h e r   t h a n   ` / ` \ n     / /   w e   a p p e n d   i t   f o l l o w e d   b y   a   c o m m a   ` , ` \ n     i f   ( o b j . n s p   & &   ' / '   ! =   o b j . n s p )   { \ n         n s p   =   t r u e ; \ n         s t r   + =   o b j . n s p ; \ n     } \ n \ n     / /   i m m e d i a t e l y   f o l l o w e d   b y   t h e   i d \ n     i f   ( n u l l   ! =   o b j . i d )   { \ n         i f   ( n s p )   { \ n             s t r   + =   ' , ' ; \ n             n s p   =   f a l s e ; \ n         } \ n         s t r   + =   o b j . i d ; \ n     } \ n \ n     / /   j s o n   d a t a \ n     i f   ( n u l l   ! =   o b j . d a t a )   { \ n         i f   ( n s p )   s t r   + =   ' , ' ; \ n         s t r   + =   j s o n . s t r i n g i f y ( o b j . d a t a ) ; \ n     } \ n \ n     d e b u g ( ' e n c o d e d   % j   a s   % s ' ,   o b j ,   s t r ) ; \ n     r e t u r n   s t r ; \ n } \ n \ n / * * \ n   *   E n c o d e   p a c k e t   a s   ' b u f f e r   s e q u e n c e '   b y   r e m o v i n g   b l o b s ,   a n d \ n   *   d e c o n s t r u c t i n g   p a c k e t   i n t o   o b j e c t   w i t h   p l a c e h o l d e r s   a n d \ n   *   a   l i s t   o f   b u f f e r s . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { B u f f e r }   e n c o d e d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   e n c o d e A s B i n a r y ( o b j ,   c a l l b a c k )   { \ n \ n     f u n c t i o n   w r i t e E n c o d i n g ( b l o b l e s s D a t a )   { \ n         v a r   d e c o n s t r u c t i o n   =   b i n a r y . d e c o n s t r u c t P a c k e t ( b l o b l e s s D a t a ) ; \ n         v a r   p a c k   =   e n c o d e A s S t r i n g ( d e c o n s t r u c t i o n . p a c k e t ) ; \ n         v a r   b u f f e r s   =   d e c o n s t r u c t i o n . b u f f e r s ; \ n \ n         b u f f e r s . u n s h i f t ( p a c k ) ;   / /   a d d   p a c k e t   i n f o   t o   b e g i n n i n g   o f   d a t a   l i s t \ n         c a l l b a c k ( b u f f e r s ) ;   / /   w r i t e   a l l   t h e   b u f f e r s \ n     } \ n \ n     b i n a r y . r e m o v e B l o b s ( o b j ,   w r i t e E n c o d i n g ) ; \ n } \ n \ n / * * \ n   *   A   s o c k e t . i o   D e c o d e r   i n s t a n c e \ n   * \ n   *   @ r e t u r n   { O b j e c t }   d e c o d e r \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   D e c o d e r ( )   { \ n     t h i s . r e c o n s t r u c t o r   =   n u l l ; \ n } \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r `   w i t h   D e c o d e r . \ n   * / \ n \ n E m i t t e r ( D e c o d e r . p r o t o t y p e ) ; \ n \ n / * * \ n   *   D e c o d e s   a n   e c o d e d   p a c k e t   s t r i n g   i n t o   p a c k e t   J S O N . \ n   * \ n   *   @ p a r a m   { S t r i n g }   o b j   -   e n c o d e d   p a c k e t \ n   *   @ r e t u r n   { O b j e c t }   p a c k e t \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n D e c o d e r . p r o t o t y p e . a d d   =   f u n c t i o n ( o b j )   { \ n     v a r   p a c k e t ; \ n     i f   ( ' s t r i n g '   = =   t y p e o f   o b j )   { \ n         p a c k e t   =   d e c o d e S t r i n g ( o b j ) ; \ n         i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   p a c k e t . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   p a c k e t . t y p e )   {   / /   b i n a r y   p a c k e t ' s   j s o n \ n             t h i s . r e c o n s t r u c t o r   =   n e w   B i n a r y R e c o n s t r u c t o r ( p a c k e t ) ; \ n \ n             / /   n o   a t t a c h m e n t s ,   l a b e l e d   b i n a r y   b u t   n o   b i n a r y   d a t a   t o   f o l l o w \ n             i f   ( t h i s . r e c o n s t r u c t o r . r e c o n P a c k . a t t a c h m e n t s   = = =   0 )   { \ n                 t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n             } \ n         }   e l s e   {   / /   n o n - b i n a r y   f u l l   p a c k e t \ n             t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n         } \ n     } \ n     e l s e   i f   ( i s B u f ( o b j )   | |   o b j . b a s e 6 4 )   {   / /   r a w   b i n a r y   d a t a \ n         i f   ( ! t h i s . r e c o n s t r u c t o r )   { \ n             t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' g o t   b i n a r y   d a t a   w h e n   n o t   r e c o n s t r u c t i n g   a   p a c k e t ' ) ; \ n         }   e l s e   { \ n             p a c k e t   =   t h i s . r e c o n s t r u c t o r . t a k e B i n a r y D a t a ( o b j ) ; \ n             i f   ( p a c k e t )   {   / /   r e c e i v e d   f i n a l   b u f f e r \ n                 t h i s . r e c o n s t r u c t o r   =   n u l l ; \ n                 t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n             } \ n         } \ n     } \ n     e l s e   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' U n k n o w n   t y p e :   '   +   o b j ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   D e c o d e   a   p a c k e t   S t r i n g   ( J S O N   d a t a ) \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   d e c o d e S t r i n g ( s t r )   { \ n     v a r   p   =   { } ; \ n     v a r   i   =   0 ; \ n \ n     / /   l o o k   u p   t y p e \ n     p . t y p e   =   N u m b e r ( s t r . c h a r A t ( 0 ) ) ; \ n     i f   ( n u l l   = =   e x p o r t s . t y p e s [ p . t y p e ] )   r e t u r n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ) ; \ n \ n     / /   l o o k   u p   a t t a c h m e n t s   i f   t y p e   b i n a r y \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   p . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   p . t y p e )   { \ n         v a r   b u f   =   ' ' ; \ n         w h i l e   ( s t r . c h a r A t ( + + i )   ! =   ' - ' )   { \ n             b u f   + =   s t r . c h a r A t ( i ) ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n         i f   ( b u f   ! =   N u m b e r ( b u f )   | |   s t r . c h a r A t ( i )   ! =   ' - ' )   { \ n             t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' I l l e g a l   a t t a c h m e n t s ' ) ; \ n         } \ n         p . a t t a c h m e n t s   =   N u m b e r ( b u f ) ; \ n     } \ n \ n     / /   l o o k   u p   n a m e s p a c e   ( i f   a n y ) \ n     i f   ( ' / '   = =   s t r . c h a r A t ( i   +   1 ) )   { \ n         p . n s p   =   ' ' ; \ n         w h i l e   ( + + i )   { \ n             v a r   c   =   s t r . c h a r A t ( i ) ; \ n             i f   ( ' , '   = =   c )   b r e a k ; \ n             p . n s p   + =   c ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n     }   e l s e   { \ n         p . n s p   =   ' / ' ; \ n     } \ n \ n     / /   l o o k   u p   i d \ n     v a r   n e x t   =   s t r . c h a r A t ( i   +   1 ) ; \ n     i f   ( ' '   ! = =   n e x t   & &   N u m b e r ( n e x t )   = =   n e x t )   { \ n         p . i d   =   ' ' ; \ n         w h i l e   ( + + i )   { \ n             v a r   c   =   s t r . c h a r A t ( i ) ; \ n             i f   ( n u l l   = =   c   | |   N u m b e r ( c )   ! =   c )   { \ n                 - - i ; \ n                 b r e a k ; \ n             } \ n             p . i d   + =   s t r . c h a r A t ( i ) ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n         p . i d   =   N u m b e r ( p . i d ) ; \ n     } \ n \ n     / /   l o o k   u p   j s o n   d a t a \ n     i f   ( s t r . c h a r A t ( + + i ) )   { \ n         p   =   t r y P a r s e ( p ,   s t r . s u b s t r ( i ) ) ; \ n     } \ n \ n     d e b u g ( ' d e c o d e d   % s   a s   % j ' ,   s t r ,   p ) ; \ n     r e t u r n   p ; \ n } \ n \ n f u n c t i o n   t r y P a r s e ( p ,   s t r )   { \ n     t r y   { \ n         p . d a t a   =   j s o n . p a r s e ( s t r ) ; \ n     }   c a t c h ( e ) { \ n         r e t u r n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ) ; \ n     } \ n     r e t u r n   p ;   \ n } ; \ n \ n / * * \ n   *   D e a l l o c a t e s   a   p a r s e r ' s   r e s o u r c e s \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n D e c o d e r . p r o t o t y p e . d e s t r o y   =   f u n c t i o n ( )   { \ n     i f   ( t h i s . r e c o n s t r u c t o r )   { \ n         t h i s . r e c o n s t r u c t o r . f i n i s h e d R e c o n s t r u c t i o n ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   A   m a n a g e r   o f   a   b i n a r y   e v e n t ' s   ' b u f f e r   s e q u e n c e ' .   S h o u l d \ n   *   b e   c o n s t r u c t e d   w h e n e v e r   a   p a c k e t   o f   t y p e   B I N A R Y _ E V E N T   i s \ n   *   d e c o d e d . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { B i n a r y R e c o n s t r u c t o r }   i n i t i a l i z e d   r e c o n s t r u c t o r \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   B i n a r y R e c o n s t r u c t o r ( p a c k e t )   { \ n     t h i s . r e c o n P a c k   =   p a c k e t ; \ n     t h i s . b u f f e r s   =   [ ] ; \ n } \ n \ n / * * \ n   *   M e t h o d   t o   b e   c a l l e d   w h e n   b i n a r y   d a t a   r e c e i v e d   f r o m   c o n n e c t i o n \ n   *   a f t e r   a   B I N A R Y _ E V E N T   p a c k e t . \ n   * \ n   *   @ p a r a m   { B u f f e r   |   A r r a y B u f f e r }   b i n D a t a   -   t h e   r a w   b i n a r y   d a t a   r e c e i v e d \ n   *   @ r e t u r n   { n u l l   |   O b j e c t }   r e t u r n s   n u l l   i f   m o r e   b i n a r y   d a t a   i s   e x p e c t e d   o r \ n   *       a   r e c o n s t r u c t e d   p a c k e t   o b j e c t   i f   a l l   b u f f e r s   h a v e   b e e n   r e c e i v e d . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n B i n a r y R e c o n s t r u c t o r . p r o t o t y p e . t a k e B i n a r y D a t a   =   f u n c t i o n ( b i n D a t a )   { \ n     t h i s . b u f f e r s . p u s h ( b i n D a t a ) ; \ n     i f   ( t h i s . b u f f e r s . l e n g t h   = =   t h i s . r e c o n P a c k . a t t a c h m e n t s )   {   / /   d o n e   w i t h   b u f f e r   l i s t \ n         v a r   p a c k e t   =   b i n a r y . r e c o n s t r u c t P a c k e t ( t h i s . r e c o n P a c k ,   t h i s . b u f f e r s ) ; \ n         t h i s . f i n i s h e d R e c o n s t r u c t i o n ( ) ; \ n         r e t u r n   p a c k e t ; \ n     } \ n     r e t u r n   n u l l ; \ n } ; \ n \ n / * * \ n   *   C l e a n s   u p   b i n a r y   p a c k e t   r e c o n s t r u c t i o n   v a r i a b l e s . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n B i n a r y R e c o n s t r u c t o r . p r o t o t y p e . f i n i s h e d R e c o n s t r u c t i o n   =   f u n c t i o n ( )   { \ n     t h i s . r e c o n P a c k   =   n u l l ; \ n     t h i s . b u f f e r s   =   [ ] ; \ n } ; \ n \ n f u n c t i o n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( d a t a ) { \ n     r e t u r n   { \ n         t y p e :   e x p o r t s .  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m , \ n         d a t a :   ' p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' \ n     } ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / i n d e x . j s \ n / /   m o d u l e   i d   =   7 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   w e b   b r o w s e r   i m p l e m e n t a t i o n   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / d e b u g ' ) ; \ n e x p o r t s . l o g   =   l o g ; \ n e x p o r t s . f o r m a t A r g s   =   f o r m a t A r g s ; \ n e x p o r t s . s a v e   =   s a v e ; \ n e x p o r t s . l o a d   =   l o a d ; \ n e x p o r t s . u s e C o l o r s   =   u s e C o l o r s ; \ n e x p o r t s . s t o r a g e   =   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e \ n                               & &   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e . s t o r a g e \ n                                     ?   c h r o m e . s t o r a g e . l o c a l \ n                                     :   l o c a l s t o r a g e ( ) ; \ n \ n / * * \ n   *   C o l o r s . \ n   * / \ n \ n e x p o r t s . c o l o r s   =   [ \ n     ' l i g h t s e a g r e e n ' , \ n     ' f o r e s t g r e e n ' , \ n     ' g o l d e n r o d ' , \ n     ' d o d g e r b l u e ' , \ n     ' d a r k o r c h i d ' , \ n     ' c r i m s o n ' \ n ] ; \ n \ n / * * \ n   *   C u r r e n t l y   o n l y   W e b K i t - b a s e d   W e b   I n s p e c t o r s ,   F i r e f o x   > =   v 3 1 , \ n   *   a n d   t h e   F i r e b u g   e x t e n s i o n   ( a n y   F i r e f o x   v e r s i o n )   a r e   k n o w n \ n   *   t o   s u p p o r t   \ " % c \ "   C S S   c u s t o m i z a t i o n s . \ n   * \ n   *   T O D O :   a d d   a   ` l o c a l S t o r a g e `   v a r i a b l e   t o   e x p l i c i t l y   e n a b l e / d i s a b l e   c o l o r s \ n   * / \ n \ n f u n c t i o n   u s e C o l o r s ( )   { \ n     / /   i s   w e b k i t ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 1 6 4 5 9 6 0 6 / 3 7 6 7 7 3 \ n     r e t u r n   ( ' W e b k i t A p p e a r a n c e '   i n   d o c u m e n t . d o c u m e n t E l e m e n t . s t y l e )   | | \ n         / /   i s   f i r e b u g ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 3 9 8 1 2 0 / 3 7 6 7 7 3 \ n         ( w i n d o w . c o n s o l e   & &   ( c o n s o l e . f i r e b u g   | |   ( c o n s o l e . e x c e p t i o n   & &   c o n s o l e . t a b l e ) ) )   | | \ n         / /   i s   f i r e f o x   > =   v 3 1 ? \ n         / /   h t t p s : / / d e v e l o p e r . m o z i l l a . o r g / e n - U S / d o c s / T o o l s / W e b _ C o n s o l e # S t y l i n g _ m e s s a g e s \ n         ( n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) . m a t c h ( / f i r e f o x \ \ / ( \ \ d + ) / )   & &   p a r s e I n t ( R e g E x p . $ 1 ,   1 0 )   > =   3 1 ) ; \ n } \ n \ n / * * \ n   *   M a p   % j   t o   ` J S O N . s t r i n g i f y ( ) ` ,   s i n c e   n o   W e b   I n s p e c t o r s   d o   t h a t   b y   d e f a u l t . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s . j   =   f u n c t i o n ( v )   { \ n     r e t u r n   J S O N . s t r i n g i f y ( v ) ; \ n } ; \ n \ n \ n / * * \ n   *   C o l o r i z e   l o g   a r g u m e n t s   i f   e n a b l e d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   f o r m a t A r g s ( )   { \ n     v a r   a r g s   =   a r g u m e n t s ; \ n     v a r   u s e C o l o r s   =   t h i s . u s e C o l o r s ; \ n \ n     a r g s [ 0 ]   =   ( u s e C o l o r s   ?   ' % c '   :   ' ' ) \ n         +   t h i s . n a m e s p a c e \ n         +   ( u s e C o l o r s   ?   '   % c '   :   '   ' ) \ n         +   a r g s [ 0 ] \ n         +   ( u s e C o l o r s   ?   ' % c   '   :   '   ' ) \ n         +   ' + '   +   e x p o r t s . h u m a n i z e ( t h i s . d i f f ) ; \ n \ n     i f   ( ! u s e C o l o r s )   r e t u r n   a r g s ; \ n \ n     v a r   c   =   ' c o l o r :   '   +   t h i s . c o l o r ; \ n     a r g s   =   [ a r g s [ 0 ] ,   c ,   ' c o l o r :   i n h e r i t ' ] . c o n c a t ( A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g s ,   1 ) ) ; \ n \ n     / /   t h e   f i n a l   \ " % c \ "   i s   s o m e w h a t   t r i c k y ,   b e c a u s e   t h e r e   c o u l d   b e   o t h e r \ n     / /   a r g u m e n t s   p a s s e d   e i t h e r   b e f o r e   o r   a f t e r   t h e   % c ,   s o   w e   n e e d   t o \ n     / /   f i g u r e   o u t   t h e   c o r r e c t   i n d e x   t o   i n s e r t   t h e   C S S   i n t o \ n     v a r   i n d e x   =   0 ; \ n     v a r   l a s t C   =   0 ; \ n     a r g s [ 0 ] . r e p l a c e ( / % [ a - z % ] / g ,   f u n c t i o n ( m a t c h )   { \ n         i f   ( ' % % '   = = =   m a t c h )   r e t u r n ; \ n         i n d e x + + ; \ n         i f   ( ' % c '   = = =   m a t c h )   { \ n             / /   w e   o n l y   a r e   i n t e r e s t e d   i n   t h e   * l a s t *   % c \ n             / /   ( t h e   u s e r   m a y   h a v e   p r o v i d e d   t h e i r   o w n ) \ n             l a s t C   =   i n d e x ; \ n         } \ n     } ) ; \ n \ n     a r g s . s p l i c e ( l a s t C ,   0 ,   c ) ; \ n     r e t u r n   a r g s ; \ n } \ n \ n / * * \ n   *   I n v o k e s   ` c o n s o l e . l o g ( ) `   w h e n   a v a i l a b l e . \ n   *   N o - o p   w h e n   ` c o n s o l e . l o g `   i s   n o t   a   \ " f u n c t i o n \ " . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o g ( )   { \ n     / /   t h i s   h a c k e r y   i s    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   f o r   I E 8 / 9 ,   w h e r e \ n     / /   t h e   ` c o n s o l e . l o g `   f u n c t i o n   d o e s n ' t   h a v e   ' a p p l y ' \ n     r e t u r n   ' o b j e c t '   = = =   t y p e o f   c o n s o l e \ n         & &   c o n s o l e . l o g \ n         & &   F u n c t i o n . p r o t o t y p e . a p p l y . c a l l ( c o n s o l e . l o g ,   c o n s o l e ,   a r g u m e n t s ) ; \ n } \ n \ n / * * \ n   *   S a v e   ` n a m e s p a c e s ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s a v e ( n a m e s p a c e s )   { \ n     t r y   { \ n         i f   ( n u l l   = =   n a m e s p a c e s )   { \ n             e x p o r t s . s t o r a g e . r e m o v e I t e m ( ' d e b u g ' ) ; \ n         }   e l s e   { \ n             e x p o r t s . s t o r a g e . d e b u g   =   n a m e s p a c e s ; \ n         } \ n     }   c a t c h ( e )   { } \ n } \ n \ n / * * \ n   *   L o a d   ` n a m e s p a c e s ` . \ n   * \ n   *   @ r e t u r n   { S t r i n g }   r e t u r n s   t h e   p r e v i o u s l y   p e r s i s t e d   d e b u g   m o d e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o a d ( )   { \ n     v a r   r ; \ n     t r y   { \ n         r   =   e x p o r t s . s t o r a g e . d e b u g ; \ n     }   c a t c h ( e )   { } \ n     r e t u r n   r ; \ n } \ n \ n / * * \ n   *   E n a b l e   n a m e s p a c e s   l i s t e d   i n   ` l o c a l S t o r a g e . d e b u g `   i n i t i a l l y . \ n   * / \ n \ n e x p o r t s . e n a b l e ( l o a d ( ) ) ; \ n \ n / * * \ n   *   L o c a l s t o r a g e   a t t e m p t s   t o   r e t u r n   t h e   l o c a l s t o r a g e . \ n   * \ n   *   T h i s   i s   n e c e s s a r y   b e c a u s e   s a f a r i   t h r o w s \ n   *   w h e n   a   u s e r   d i s a b l e s   c o o k i e s / l o c a l s t o r a g e \ n   *   a n d   y o u   a t t e m p t   t o   a c c e s s   i t . \ n   * \ n   *   @ r e t u r n   { L o c a l S t o r a g e } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o c a l s t o r a g e ( ) { \ n     t r y   { \ n         r e t u r n   w i n d o w . l o c a l S t o r a g e ; \ n     }   c a t c h   ( e )   { } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / b r o w s e r . j s \ n / /   m o d u l e   i d   =   8 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   c o m m o n   l o g i c   f o r   b o t h   t h e   N o d e . j s   a n d   w e b   b r o w s e r \ n   *   i m p l e m e n t a t i o n s   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   d e b u g ; \ n e x p o r t s . c o e r c e   =   c o e r c e ; \ n e x p o r t s . d i s a b l e   =   d i s a b l e ; \ n e x p o r t s . e n a b l e   =   e n a b l e ; \ n e x p o r t s . e n a b l e d   =   e n a b l e d ; \ n e x p o r t s . h u m a n i z e   =   r e q u i r e ( ' m s ' ) ; \ n \ n / * * \ n   *   T h e   c u r r e n t l y   a c t i v e   d e b u g   m o d e   n a m e s ,   a n d   n a m e s   t o   s k i p . \ n   * / \ n \ n e x p o r t s . n a m e s   =   [ ] ; \ n e x p o r t s . s k i p s   =   [ ] ; \ n \ n / * * \ n   *   M a p   o f   s p e c i a l   \ " % n \ "   h a n d l i n g   f u n c t i o n s ,   f o r   t h e   d e b u g   \ " f o r m a t \ "   a r g u m e n t . \ n   * \ n   *   V a l i d   k e y   n a m e s   a r e   a   s i n g l e ,   l o w e r c a s e d   l e t t e r ,   i . e .   \ " n \ " . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s   =   { } ; \ n \ n / * * \ n   *   P r e v i o u s l y   a s s i g n e d   c o l o r . \ n   * / \ n \ n v a r   p r e v C o l o r   =   0 ; \ n \ n / * * \ n   *   P r e v i o u s   l o g   t i m e s t a m p . \ n   * / \ n \ n v a r   p r e v T i m e ; \ n \ n / * * \ n   *   S e l e c t   a   c o l o r . \ n   * \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s e l e c t C o l o r ( )   { \ n     r e t u r n   e x p o r t s . c o l o r s [ p r e v C o l o r + +   %   e x p o r t s . c o l o r s . l e n g t h ] ; \ n } \ n \ n / * * \ n   *   C r e a t e   a   d e b u g g e r   w i t h   t h e   g i v e n   ` n a m e s p a c e ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e \ n   *   @ r e t u r n   { F u n c t i o n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d e b u g ( n a m e s p a c e )   { \ n \ n     / /   d e f i n e   t h e   ` d i s a b l e d `   v e r s i o n \ n     f u n c t i o n   d i s a b l e d ( )   { \ n     } \ n     d i s a b l e d . e n a b l e d   =   f a l s e ; \ n \ n     / /   d e f i n e   t h e   ` e n a b l e d `   v e r s i o n \ n     f u n c t i o n   e n a b l e d ( )   { \ n \ n         v a r   s e l f   =   e n a b l e d ; \ n \ n         / /   s e t   ` d i f f `   t i m e s t a m p \ n         v a r   c u r r   =   + n e w   D a t e ( ) ; \ n         v a r   m s   =   c u r r   -   ( p r e v T i m e   | |   c u r r ) ; \ n         s e l f . d i f f   =   m s ; \ n         s e l f . p r e v   =   p r e v T i m e ; \ n         s e l f . c u r r   =   c u r r ; \ n         p r e v T i m e   =   c u r r ; \ n \ n         / /   a d d   t h e   ` c o l o r `   i f   n o t   s e t \ n         i f   ( n u l l   = =   s e l f . u s e C o l o r s )   s e l f . u s e C o l o r s   =   e x p o r t s . u s e C o l o r s ( ) ; \ n         i f   ( n u l l   = =   s e l f . c o l o r   & &   s e l f . u s e C o l o r s )   s e l f . c o l o r   =   s e l e c t C o l o r ( ) ; \ n \ n         v a r   a r g s   =   A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ) ; \ n \ n         a r g s [ 0 ]   =   e x p o r t s . c o e r c e ( a r g s [ 0 ] ) ; \ n \ n         i f   ( ' s t r i n g '   ! = =   t y p e o f   a r g s [ 0 ] )   { \ n             / /   a n y t h i n g   e l s e   l e t ' s   i n s p e c t   w i t h   % o \ n             a r g s   =   [ ' % o ' ] . c o n c a t ( a r g s ) ; \ n         } \ n \ n         / /   a p p l y   a n y   ` f o r m a t t e r s `   t r a n s f o r m a t i o n s \ n         v a r   i n d e x   =   0 ; \ n         a r g s [ 0 ]   =   a r g s [ 0 ] . r e p l a c e ( / % ( [ a - z % ] ) / g ,   f u n c t i o n ( m a t c h ,   f o r m a t )   { \ n             / /   i f   w e   e n c o u n t e r   a n   e s c a p e d   %   t h e n   d o n ' t   i n c r e a s e   t h e   a r r a y   i n d e x \ n             i f   ( m a t c h   = = =   ' % % ' )   r e t u r n   m a t c h ; \ n             i n d e x + + ; \ n             v a r   f o r m a t t e r   =   e x p o r t s . f o r m a t t e r s [ f o r m a t ] ; \ n             i f   ( ' f u n c t i o n '   = = =   t y p e o f   f o r m a t t e r )   { \ n                 v a r   v a l   =   a r g s [ i n d e x ] ; \ n                 m a t c h   =   f o r m a t t e r . c a l l ( s e l f ,   v a l ) ; \ n \ n                 / /   n o w   w e   n e e d   t o   r e m o v e   ` a r g s [ i n d e x ] `   s i n c e   i t ' s   i n l i n e d   i n   t h e   ` f o r m a t ` \ n                 a r g s . s p l i c e ( i n d e x ,   1 ) ; \ n                 i n d e x - - ; \ n             } \ n             r e t u r n   m a t c h ; \ n         } ) ; \ n \ n         i f   ( ' f u n c t i o n '   = = =   t y p e o f   e x p o r t s . f o r m a t A r g s )   { \ n             a r g s   =   e x p o r t s . f o r m a t A r g s . a p p l y ( s e l f ,   a r g s ) ; \ n         } \ n         v a r   l o g F n   =   e n a b l e d . l o g   | |   e x p o r t s . l o g   | |   c o n s o l e . l o g . b i n d ( c o n s o l e ) ; \ n         l o g F n . a p p l y ( s e l f ,   a r g s ) ; \ n     } \ n     e n a b l e d . e n a b l e d   =   t r u e ; \ n \ n     v a r   f n   =   e x p o r t s . e n a b l e d ( n a m e s p a c e )   ?   e n a b l e d   :   d i s a b l e d ; \ n \ n     f n . n a m e s p a c e   =   n a m e s p a c e ; \ n \ n     r e t u r n   f n ; \ n } \ n \ n / * * \ n   *   E n a b l e s   a   d e b u g   m o d e   b y   n a m e s p a c e s .   T h i s   c a n   i n c l u d e   m o d e s \ n   *   s e p a r a t e d   b y   a   c o l o n   a n d   w i l d c a r d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e ( n a m e s p a c e s )   { \ n     e x p o r t s . s a v e ( n a m e s p a c e s ) ; \ n \ n     v a r   s p l i t   =   ( n a m e s p a c e s   | |   ' ' ) . s p l i t ( / [ \ \ s , ] + / ) ; \ n     v a r   l e n   =   s p l i t . l e n g t h ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   l e n ;   i + + )   { \ n         i f   ( ! s p l i t [ i ] )   c o n t i n u e ;   / /   i g n o r e   e m p t y   s t r i n g s \ n         n a m e s p a c e s   =   s p l i t [ i ] . r e p l a c e ( / \ \ * / g ,   ' . * ? ' ) ; \ n         i f   ( n a m e s p a c e s [ 0 ]   = = =   ' - ' )   { \ n             e x p o r t s . s k i p s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s . s u b s t r ( 1 )   +   ' $ ' ) ) ; \ n         }   e l s e   { \ n             e x p o r t s . n a m e s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s   +   ' $ ' ) ) ; \ n         } \ n     } \ n } \ n \ n / * * \ n   *   D i s a b l e   d e b u g   o u t p u t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d i s a b l e ( )   { \ n     e x p o r t s . e n a b l e ( ' ' ) ; \ n } \ n \ n / * * \ n   *   R e t u r n s   t r u e   i f   t h e   g i v e n   m o d e   n a m e   i s   e n a b l e d ,   f a l s e   o t h e r w i s e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e \ n   *   @ r e t u r n   { B o o l e a n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e d ( n a m e )   { \ n     v a r   i ,   l e n ; \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . s k i p s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . s k i p s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   f a l s e ; \ n         } \ n     } \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . n a m e s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . n a m e s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   t r u e ; \ n         } \ n     } \ n     r e t u r n   f a l s e ; \ n } \ n \ n / * * \ n   *   C o e r c e   ` v a l ` . \ n   * \ n   *   @ p a r a m   { M i x e d }   v a l \ n   *   @ r e t u r n   { M i x e d } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   c o e r c e ( v a l )   { \ n     i f   ( v a l   i n s t a n c e o f    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n   v a l . s t a c k   | |   v a l . m e s s a g e ; \ n     r e t u r n   v a l ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / d e b u g . j s \ n / /   m o d u l e   i d   =   9 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   H e l p e r s . \ n   * / \ n \ n v a r   s   =   1 0 0 0 ; \ n v a r   m   =   s   *   6 0 ; \ n v a r   h   =   m   *   6 0 ; \ n v a r   d   =   h   *   2 4 ; \ n v a r   y   =   d   *   3 6 5 . 2 5 ; \ n \ n / * * \ n   *   P a r s e   o r   f o r m a t   t h e   g i v e n   ` v a l ` . \ n   * \ n   *   O p t i o n s : \ n   * \ n   *     -   ` l o n g `   v e r b o s e   f o r m a t t i n g   [ f a l s e ] \ n   * \ n   *   @ p a r a m   { S t r i n g | N u m b e r }   v a l \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ r e t u r n   { S t r i n g | N u m b e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( v a l ,   o p t i o n s ) { \ n     o p t i o n s   =   o p t i o n s   | |   { } ; \ n     i f   ( ' s t r i n g '   = =   t y p e o f   v a l )   r e t u r n   p a r s e ( v a l ) ; \ n     r e t u r n   o p t i o n s . l o n g \ n         ?   l o n g ( v a l ) \ n         :   s h o r t ( v a l ) ; \ n } ; \ n \ n / * * \ n   *   P a r s e   t h e   g i v e n   ` s t r `   a n d   r e t u r n   m i l l i s e c o n d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   p a r s e ( s t r )   { \ n     s t r   =   ' '   +   s t r ; \ n     i f   ( s t r . l e n g t h   >   1 0 0 0 0 )   r e t u r n ; \ n     v a r   m a t c h   =   / ^ ( ( ? : \ \ d + ) ? \ \ . ? \ \ d + )   * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | y e a r s ? | y r s ? | y ) ? $ / i . e x e c ( s t r ) ; \ n     i f   ( ! m a t c h )   r e t u r n ; \ n     v a r   n   =   p a r s e F l o a t ( m a t c h [ 1 ] ) ; \ n     v a r   t y p e   =   ( m a t c h [ 2 ]   | |   ' m s ' ) . t o L o w e r C a s e ( ) ; \ n     s w i t c h   ( t y p e )   { \ n         c a s e   ' y e a r s ' : \ n         c a s e   ' y e a r ' : \ n         c a s e   ' y r s ' : \ n         c a s e   ' y r ' : \ n         c a s e   ' y ' : \ n             r e t u r n   n   *   y ; \ n         c a s e   ' d a y s ' : \ n         c a s e   ' d a y ' : \ n         c a s e   ' d ' : \ n             r e t u r n   n   *   d ; \ n         c a s e   ' h o u r s ' : \ n         c a s e   ' h o u r ' : \ n         c a s e   ' h r s ' : \ n         c a s e   ' h r ' : \ n         c a s e   ' h ' : \ n             r e t u r n   n   *   h ; \ n         c a s e   ' m i n u t e s ' : \ n         c a s e   ' m i n u t e ' : \ n         c a s e   ' m i n s ' : \ n         c a s e   ' m i n ' : \ n         c a s e   ' m ' : \ n             r e t u r n   n   *   m ; \ n         c a s e   ' s e c o n d s ' : \ n         c a s e   ' s e c o n d ' : \ n         c a s e   ' s e c s ' : \ n         c a s e   ' s e c ' : \ n         c a s e   ' s ' : \ n             r e t u r n   n   *   s ; \ n         c a s e   ' m i l l i s e c o n d s ' : \ n         c a s e   ' m i l l i s e c o n d ' : \ n         c a s e   ' m s e c s ' : \ n         c a s e   ' m s e c ' : \ n         c a s e   ' m s ' : \ n             r e t u r n   n ; \ n     } \ n } \ n \ n / * * \ n   *   S h o r t   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s h o r t ( m s )   { \ n     i f   ( m s   > =   d )   r e t u r n   M a t h . r o u n d ( m s   /   d )   +   ' d ' ; \ n     i f   ( m s   > =   h )   r e t u r n   M a t h . r o u n d ( m s   /   h )   +   ' h ' ; \ n     i f   ( m s   > =   m )   r e t u r n   M a t h . r o u n d ( m s   /   m )   +   ' m ' ; \ n     i f   ( m s   > =   s )   r e t u r n   M a t h . r o u n d ( m s   /   s )   +   ' s ' ; \ n     r e t u r n   m s   +   ' m s ' ; \ n } \ n \ n / * * \ n   *   L o n g   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o n g ( m s )   { \ n     r e t u r n   p l u r a l ( m s ,   d ,   ' d a y ' ) \ n         | |   p l u r a l ( m s ,   h ,   ' h o u r ' ) \ n         | |   p l u r a l ( m s ,   m ,   ' m i n u t e ' ) \ n         | |   p l u r a l ( m s ,   s ,   ' s e c o n d ' ) \ n         | |   m s   +   '   m s ' ; \ n } \ n \ n / * * \ n   *   P l u r a l i z a t i o n   h e l p e r . \ n   * / \ n \ n f u n c t i o n   p l u r a l ( m s ,   n ,   n a m e )   { \ n     i f   ( m s   <   n )   r e t u r n ; \ n     i f   ( m s   <   n   *   1 . 5 )   r e t u r n   M a t h . f l o o r ( m s   /   n )   +   '   '   +   n a m e ; \ n     r e t u r n   M a t h . c e i l ( m s   /   n )   +   '   '   +   n a m e   +   ' s ' ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / m s / i n d e x . j s \ n / /   m o d u l e   i d   =   1 0 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * *   I M P O R T S   F R O M   i m p o r t s - l o a d e r   * * * / \ n v a r   d e f i n e   =   f a l s e ; \ n \ n / * !   J S O N   v 3 . 3 . 2   |   h t t p : / / b e s t i e j s . g i t h u b . i o / j s o n 3   |   C o p y r i g h t   2 0 1 2 - 2 0 1 4 ,   K i t   C a m b r i d g e   |   h t t p : / / k i t . m i t - l i c e n s e . o r g   * / \ n ; ( f u n c t i o n   ( )   { \ n     / /   D e t e c t   t h e   ` d e f i n e `   f u n c t i o n   e x p o s e d   b y   a s y n c h r o n o u s   m o d u l e   l o a d e r s .   T h e \ n     / /   s t r i c t   ` d e f i n e `   c h e c k   i s   n e c e s s a r y   f o r   c o m p a t i b i l i t y   w i t h   ` r . j s ` . \ n     v a r   i s L o a d e r   =   t y p e o f   d e f i n e   = = =   \ " f u n c t i o n \ "   & &   d e f i n e . a m d ; \ n \ n     / /   A   s e t   o f   t y p e s   u s e d   t o   d i s t i n g u i s h   o b j e c t s   f r o m   p r i m i t i v e s . \ n     v a r   o b j e c t T y p e s   =   { \ n         \ " f u n c t i o n \ " :   t r u e , \ n         \ " o b j e c t \ " :   t r u e \ n     } ; \ n \ n     / /   D e t e c t   t h e   ` e x p o r t s `   o b j e c t   e x p o s e d   b y   C o m m o n J S   i m p l e m e n t a t i o n s . \ n     v a r   f r e e E x p o r t s   =   o b j e c t T y p e s [ t y p e o f   e x p o r t s ]   & &   e x p o r t s   & &   ! e x p o r t s . n o d e T y p e   & &   e x p o r t s ; \ n \ n     / /   U s e   t h e   ` g l o b a l `   o b j e c t   e x p o s e d   b y   N o d e   ( i n c l u d i n g   B r o w s e r i f y   v i a \ n     / /   ` i n s e r t - m o d u l e - g l o b a l s ` ) ,   N a r w h a l ,   a n d   R i n g o   a s   t h e   d e f a u l t   c o n t e x t , \ n     / /   a n d   t h e   ` w i n d o w `   o b j e c t   i n   b r o w s e r s .   R h i n o   e x p o r t s   a   ` g l o b a l `   f u n c t i o n \ n     / /   i n s t e a d . \ n     v a r   r o o t   =   o b j e c t T y p e s [ t y p e o f   w i n d o w ]   & &   w i n d o w   | |   t h i s , \ n             f r e e G l o b a l   =   f r e e E x p o r t s   & &   o b j e c t T y p e s [ t y p e o f   m o d u l e ]   & &   m o d u l e   & &   ! m o d u l e . n o d e T y p e   & &   t y p e o f   g l o b a l   = =   \ " o b j e c t \ "   & &   g l o b a l ; \ n \ n     i f   ( f r e e G l o b a l   & &   ( f r e e G l o b a l [ \ " g l o b a l \ " ]   = = =   f r e e G l o b a l   | |   f r e e G l o b a l [ \ " w i n d o w \ " ]   = = =   f r e e G l o b a l   | |   f r e e G l o b a l [ \ " s e l f \ " ]   = = =   f r e e G l o b a l ) )   { \ n         r o o t   =   f r e e G l o b a l ; \ n     } \ n \ n     / /   P u b l i c :   I n i t i a l i z e s   J S O N   3   u s i n g   t h e   g i v e n   ` c o n t e x t `   o b j e c t ,   a t t a c h i n g   t h e \ n     / /   ` s t r i n g i f y `   a n d   ` p a r s e `   f u n c t i o n s   t o   t h e   s p e c i f i e d   ` e x p o r t s `   o b j e c t . \ n     f u n c t i o n   r u n I n C o n t e x t ( c o n t e x t ,   e x p o r t s )   { \ n         c o n t e x t   | |   ( c o n t e x t   =   r o o t [ \ " O b j e c t \ " ] ( ) ) ; \ n         e x p o r t s   | |   ( e x p o r t s   =   r o o t [ \ " O b j e c t \ " ] ( ) ) ; \ n \ n         / /   N a t i v e   c o n s t r u c t o r   a l i a s e s . \ n         v a r   N u m b e r   =   c o n t e x t [ \ " N u m b e r \ " ]   | |   r o o t [ \ " N u m b e r \ " ] , \ n                 S t r i n g   =   c o n t e x t [ \ " S t r i n g \ " ]   | |   r o o t [ \ " S t r i n g \ " ] , \ n                 O b j e c t   =   c o n t e x t [ \ " O b j e c t \ " ]   | |   r o o t [ \ " O b j e c t \ " ] , \ n                 D a t e   =   c o n t e x t [ \ " D a t e \ " ]   | |   r o o t [ \ " D a t e \ " ] , \ n                 S y n t a x E r r o r   =   c o n t e x t [ \ " S y n t a x E r r o r \ " ]   | |   r o o t [ \ " S y n t a x E r r o r \ " ] , \ n                 T y p e E r r o r   =   c o n t e x t [ \ " T y p e E r r o r \ " ]   | |   r o o t [ \ " T y p e E r r o r \ " ] , \ n                 M a t h   =   c o n t e x t [ \ " M a t h \ " ]   | |   r o o t [ \ " M a t h \ " ] , \ n                 n a t i v e J S O N   =   c o n t e x t [ \ " J S O N \ " ]   | |   r o o t [ \ " J S O N \ " ] ; \ n \ n         / /   D e l e g a t e   t o   t h e   n a t i v e   ` s t r i n g i f y `   a n d   ` p a r s e `   i m p l e m e n t a t i o n s . \ n         i f   ( t y p e o f   n a t i v e J S O N   = =   \ " o b j e c t \ "   & &   n a t i v e J S O N )   { \ n             e x p o r t s . s t r i n g i f y   =   n a t i v e J S O N . s t r i n g i f y ; \ n             e x p o r t s . p a r s e   =   n a t i v e J S O N . p a r s e ; \ n         } \ n \ n         / /   C o n v e n i e n c e   a l i a s e s . \ n         v a r   o b j e c t P r o t o   =   O b j e c t . p r o t o t y p e , \ n                 g e t C l a s s   =   o b j e c t P r o t o . t o S t r i n g , \ n                 i s P r o p e r t y ,   f o r E a c h ,   u n d e f ; \ n \ n         / /   T e s t   t h e   ` D a t e # g e t U T C * `   m e t h o d s .   B a s e d   o n   w o r k   b y   @ Y a f f l e . \ n         v a r   i s E x t e n d e d   =   n e w   D a t e ( - 3 5 0 9 8 2 7 3 3 4 5 7 3 2 9 2 ) ; \ n         t r y   { \ n             / /   T h e   ` g e t U T C F u l l Y e a r ` ,   ` M o n t h ` ,   a n d   ` D a t e `   m e t h o d s   r e t u r n   n o n s e n s i c a l \ n             / /   r e s u l t s   f o r   c e r t a i n   d a t e s   i n   O p e r a   > =   1 0 . 5 3 . \ n             i s E x t e n d e d   =   i s E x t e n d e d . g e t U T C F u l l Y e a r ( )   = =   - 1 0 9 2 5 2   & &   i s E x t e n d e d . g e t U T C M o n t h ( )   = = =   0   & &   i s E x t e n d e d . g e t U T C D a t e ( )   = = =   1   & & \ n                 / /   S a f a r i   <   2 . 0 . 2   s t o r e s   t h e   i n t e r n a l   m i l l i s e c o n d   t i m e   v a l u e   c o r r e c t l y , \ n                 / /   b u t   c l i p s   t h e   v a l u e s   r e t u r n e d   b y   t h e   d a t e   m e t h o d s   t o   t h e   r a n g e   o f \ n                 / /   s i g n e d   3 2 - b i t   i n t e g e r s   ( [ - 2   * *   3 1 ,   2   * *   3 1   -   1 ] ) . \ n                 i s E x t e n d e d . g e t U T C H o u r s ( )   = =   1 0   & &   i s E x t e n d e d . g e t U T C M i n u t e s ( )   = =   3 7   & &   i s E x t e n d e d . g e t U T C S e c o n d s ( )   = =   6   & &   i s E x t e n d e d . g e t U T C M i l l i s e c o n d s ( )   = =   7 0 8 ; \ n         }   c a t c h   ( e x c e p t i o n )   { } \ n \ n         / /   I n t e r n a l :   D e t e r m i n e s   w h e t h e r   t h e   n a t i v e   ` J S O N . s t r i n g i f y `   a n d   ` p a r s e ` \ n         / /   i m p l e m e n t a t i o n s   a r e   s p e c - c o m p l i a n t .   B a s e d   o n   w o r k   b y   K e n   S n y d e r . \ n         f u n c t i o n   h a s ( n a m e )   { \ n             i f   ( h a s [ n a m e ]   ! = =   u n d e f )   { \ n                 / /   R e t u r n   c a c h e d   f e a t u r e   t e s t   r e s u l t . \ n                 r e t u r n   h a s [ n a m e ] ; \ n             } \ n             v a r   i s S u p p o r t e d ; \ n             i f   ( n a m e   = =   \ " b u g - s t r i n g - c h a r - i n d e x \ " )   { \ n                 / /   I E   < =   7    [ 1 m  [ 3 1 m d o e s n ' t   s u p p o r t  [ 3 9 m  [ 2 2 m  [ 1 m   a c c e s s i n g   s t r i n g   c h a r a c t e r s   u s i n g   s q u a r e \ n                 / /   b r a c k e t   n o t a t i o n .   I E   8   o n l y   s u p p o r t s   t h i s   f o r   p r i m i t i v e s . \ n                 i s S u p p o r t e d   =   \ " a \ " [ 0 ]   ! =   \ " a \ " ; \ n             }   e l s e   i f   ( n a m e   = =   \ " j s o n \ " )   { \ n                 / /   I n d i c a t e s   w h e t h e r   b o t h   ` J S O N . s t r i n g i f y `   a n d   ` J S O N . p a r s e `   a r e \ n                 / /   s u p p o r t e d . \ n                 i s S u p p o r t e d   =   h a s ( \ " j s o n - s t r i n g i f y \ " )   & &   h a s ( \ " j s o n - p a r s e \ " ) ; \ n             }   e l s e   { \ n                 v a r   v a l u e ,   s e r i a l i z e d   =   ' { \ " a \ " : [ 1 , t r u e , f a l s e , n u l l , \ " \ \ \ \ u 0 0 0 0 \ \ \ \ b \ \ \ \ n \ \ \ \ f \ \ \ \ r \ \ \ \ t \ " ] } ' ; \ n                 / /   T e s t   ` J S O N . s t r i n g i f y ` . \ n                 i f   ( n a m e   = =   \ " j s o n - s t r i n g i f y \ " )   { \ n                     v a r   s t r i n g i f y   =   e x p o r t s . s t r i n g i f y ,   s t r i n g i f y S u p p o r t e d   =   t y p e o f   s t r i n g i f y   = =   \ " f u n c t i o n \ "   & &   i s E x t e n d e d ; \ n                     i f   ( s t r i n g i f y S u p p o r t e d )   { \ n                         / /   A   t e s t   f u n c t i o n   o b j e c t   w i t h   a   c u s t o m   ` t o J S O N `   m e t h o d . \ n                         ( v a l u e   =   f u n c t i o n   ( )   { \ n                             r e t u r n   1 ; \ n                         } ) . t o J S O N   =   v a l u e ; \ n                         t r y   { \ n                             s t r i n g i f y S u p p o r t e d   = \ n                                 / /   F i r e f o x   3 . 1 b 1   a n d   b 2   s e r i a l i z e   s t r i n g ,   n u m b e r ,   a n d   b o o l e a n \ n                                 / /   p r i m i t i v e s   a s   o b j e c t   l i t e r a l s . \ n                                 s t r i n g i f y ( 0 )   = = =   \ " 0 \ "   & & \ n                                 / /   F F   3 . 1 b 1 ,   b 2 ,   a n d   J S O N   2   s e r i a l i z e   w r a p p e d   p r i m i t i v e s   a s   o b j e c t \ n                                 / /   l i t e r a l s . \ n                                 s t r i n g i f y ( n e w   N u m b e r ( ) )   = = =   \ " 0 \ "   & & \ n                                 s t r i n g i f y ( n e w   S t r i n g ( ) )   = =   ' \ " \ " '   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   t h e   v a l u e   i s   ` n u l l ` ,   ` u n d e f i n e d ` ,   o r \ n                                 / /   d o e s   n o t   d e f i n e   a   c a n o n i c a l   J S O N   r e p r e s e n t a t i o n   ( t h i s   a p p l i e s   t o \ n                                 / /   o b j e c t s   w i t h   ` t o J S O N `   p r o p e r t i e s   a s   w e l l ,   * u n l e s s *   t h e y   a r e   n e s t e d \ n                                 / /   w i t h i n   a n   o b j e c t   o r   a r r a y ) . \ n                                 s t r i n g i f y ( g e t C l a s s )   = = =   u n d e f   & & \ n                                 / /   I E   8   s e r i a l i z e s   ` u n d e f i n e d `   a s   ` \ " u n d e f i n e d \ " ` .   S a f a r i   < =   5 . 1 . 7   a n d \ n                                 / /   F F   3 . 1 b 3   p a s s   t h i s   t e s t . \ n                                 s t r i n g i f y ( u n d e f )   = = =   u n d e f   & & \ n                                 / /   S a f a r i   < =   5 . 1 . 7   a n d   F F   3 . 1 b 3   t h r o w   `  [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ` s   a n d   ` T y p e E r r o r ` s , \ n                                 / /   r e s p e c t i v e l y ,   i f   t h e   v a l u e   i s   o m i t t e d   e n t i r e l y . \ n                                 s t r i n g i f y ( )   = = =   u n d e f   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   t h e   g i v e n   v a l u e   i s   n o t   a   n u m b e r , \ n                                 / /   s t r i n g ,   a r r a y ,   o b j e c t ,   B o o l e a n ,   o r   ` n u l l `   l i t e r a l .   T h i s   a p p l i e s   t o \ n                                 / /   o b j e c t s   w i t h   c u s t o m   ` t o J S O N `   m e t h o d s   a s   w e l l ,   u n l e s s   t h e y   a r e   n e s t e d \ n                                 / /   i n s i d e   o b j e c t   o r   a r r a y   l i t e r a l s .   Y U I   3 . 0 . 0 b 1   i g n o r e s   c u s t o m   ` t o J S O N ` \ n                                 / /   m e t h o d s   e n t i r e l y . \ n                                 s t r i n g i f y ( v a l u e )   = = =   \ " 1 \ "   & & \ n                                 s t r i n g i f y ( [ v a l u e ] )   = =   \ " [ 1 ] \ "   & & \ n                                 / /   P r o t o t y p e   < =   1 . 6 . 1   s e r i a l i z e s   ` [ u n d e f i n e d ] `   a s   ` \ " [ ] \ " `   i n s t e a d   o f \ n                                 / /   ` \ " [ n u l l ] \ " ` . \ n                                 s t r i n g i f y ( [ u n d e f ] )   = =   \ " [ n u l l ] \ "   & & \ n                                 / /   Y U I   3 . 0 . 0 b 1   f a i l s   t o   s e r i a l i z e   ` n u l l `   l i t e r a l s . \ n                                 s t r i n g i f y ( n u l l )   = =   \ " n u l l \ "   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   h a l t s   s e r i a l i z a t i o n   i f   a n   a r r a y   c o n t a i n s   a   f u n c t i o n : \ n                                 / /   ` [ 1 ,   t r u e ,   g e t C l a s s ,   1 ] `   s e r i a l i z e s   a s   \ " [ 1 , t r u e , ] , \ " .   F F   3 . 1 b 3 \ n                                 / /   e l i d e s   n o n - J S O N   v a l u e s   f r o m   o b j e c t s   a n d   a r r a y s ,   u n l e s s   t h e y \ n                                 / /   d e f i n e   c u s t o m   ` t o J S O N `   m e t h o d s . \ n                                 s t r i n g i f y ( [ u n d e f ,   g e t C l a s s ,   n u l l ] )   = =   \ " [ n u l l , n u l l , n u l l ] \ "   & & \ n                                 / /   S i m p l e   s e r i a l i z a t i o n   t e s t .   F F   3 . 1 b 1   u s e s   U n i c o d e   e s c a p e   s e q u e n c e s \ n                                 / /   w h e r e   c h a r a c t e r   e s c a p e   c o d e s   a r e   e x p e c t e d   ( e . g . ,   ` \ \ b `   = >   ` \ \ u 0 0 0 8 ` ) . \ n                                 s t r i n g i f y ( {   \ " a \ " :   [ v a l u e ,   t r u e ,   f a l s e ,   n u l l ,   \ " \ \ x 0 0 \ \ b \ \ n \ \ f \ \ r \ \ t \ " ]   } )   = =   s e r i a l i z e d   & & \ n                                 / /   F F   3 . 1 b 1   a n d   b 2   i g n o r e   t h e   ` f i l t e r `   a n d   ` w i d t h `   a r g u m e n t s . \ n                                 s t r i n g i f y ( n u l l ,   v a l u e )   = = =   \ " 1 \ "   & & \ n                                 s t r i n g i f y ( [ 1 ,   2 ] ,   n u l l ,   1 )   = =   \ " [ \ \ n   1 , \ \ n   2 \ \ n ] \ "   & & \ n                                 / /   J S O N   2 ,   P r o t o t y p e   < =   1 . 7 ,   a n d   o l d e r   W e b K i t   b u i l d s   i n c o r r e c t l y \ n                                 / /   s e r i a l i z e   e x t e n d e d   y e a r s . \ n                                 s t r i n g i f y ( n e w   D a t e ( - 8 . 6 4 e 1 5 ) )   = =   ' \ " - 2 7 1 8 2 1 - 0 4 - 2 0 T 0 0 : 0 0 : 0 0 . 0 0 0 Z \ " '   & & \ n                                 / /   T h e   m i l l i s e c o n d s   a r e   o p t i o n a l   i n   E S   5 ,   b u t    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   i n   5 . 1 . \ n                                 s t r i n g i f y ( n e w   D a t e ( 8 . 6 4 e 1 5 ) )   = =   ' \ " + 2 7 5 7 6 0 - 0 9 - 1 3 T 0 0 : 0 0 : 0 0 . 0 0 0 Z \ " '   & & \ n                                 / /   F i r e f o x   < =   1 1 . 0   i n c o r r e c t l y   s e r i a l i z e s   y e a r s   p r i o r   t o   0   a s   n e g a t i v e \ n                                 / /   f o u r - d i g i t   y e a r s   i n s t e a d ' ) . r e p l a c e ( / \ \ * / g ,   ' . * ? ' ) ; \ n         i f   ( n a m e s p a c e s [ 0 ]   = = =   ' - ' )   { \ n             e x p o r t s . s k i p s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s . s u b s t r ( 1 )   +   ' ) ) ; \ n         }   e l s e   { \ n             e x p o r t s . n a m e s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s   +   ' ) ) ; \ n         } \ n     } \ n } \ n \ n / * * \ n   *   D i s a b l e   d e b u g   o u t p u t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d i s a b l e ( )   { \ n     e x p o r t s . e n a b l e ( ' ' ) ; \ n } \ n \ n / * * \ n   *   R e t u r n s   t r u e   i f   t h e   g i v e n   m o d e   n a m e   i s   e n a b l e d ,   f a l s e   o t h e r w i s e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e \ n   *   @ r e t u r n   { B o o l e a n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e d ( n a m e )   { \ n     v a r   i ,   l e n ; \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . s k i p s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . s k i p s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   f a l s e ; \ n         } \ n     } \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . n a m e s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . n a m e s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   t r u e ; \ n         } \ n     } \ n     r e t u r n   f a l s e ; \ n } \ n \ n / * * \ n   *   C o e r c e   ` v a l ` . \ n   * \ n   *   @ p a r a m   { M i x e d }   v a l \ n   *   @ r e t u r n   { M i x e d } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   c o e r c e ( v a l )   { \ n     i f   ( v a l   i n s t a n c e o f    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n   v a l . s t a c k   | |   v a l . m e s s a g e ; \ n     r e t u r n   v a l ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / d e b u g / d e b u g . j s \ n / /   m o d u l e   i d   =   5 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   H e l p e r s . \ n   * / \ n \ n v a r   s   =   1 0 0 0 \ n v a r   m   =   s   *   6 0 \ n v a r   h   =   m   *   6 0 \ n v a r   d   =   h   *   2 4 \ n v a r   y   =   d   *   3 6 5 . 2 5 \ n \ n / * * \ n   *   P a r s e   o r   f o r m a t   t h e   g i v e n   ` v a l ` . \ n   * \ n   *   O p t i o n s : \ n   * \ n   *     -   ` l o n g `   v e r b o s e   f o r m a t t i n g   [ f a l s e ] \ n   * \ n   *   @ p a r a m   { S t r i n g | N u m b e r }   v a l \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ t h r o w s   {  [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m }   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   v a l   i s   n o t   a   n o n - e m p t y   s t r i n g   o r   a   n u m b e r \ n   *   @ r e t u r n   { S t r i n g | N u m b e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n   ( v a l ,   o p t i o n s )   { \ n     o p t i o n s   =   o p t i o n s   | |   { } \ n     v a r   t y p e   =   t y p e o f   v a l \ n     i f   ( t y p e   = = =   ' s t r i n g '   & &   v a l . l e n g t h   >   0 )   { \ n         r e t u r n   p a r s e ( v a l ) \ n     }   e l s e   i f   ( t y p e   = = =   ' n u m b e r '   & &   i s N a N ( v a l )   = = =   f a l s e )   { \ n         r e t u r n   o p t i o n s . l o n g   ? \ n \ t \ t \ t f m t L o n g ( v a l )   : \ n \ t \ t \ t f m t S h o r t ( v a l ) \ n     } \ n     t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' v a l   i s   n o t   a   n o n - e m p t y   s t r i n g   o r   a   v a l i d   n u m b e r .   v a l = '   +   J S O N . s t r i n g i f y ( v a l ) ) \ n } \ n \ n / * * \ n   *   P a r s e   t h e   g i v e n   ` s t r `   a n d   r e t u r n   m i l l i s e c o n d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   p a r s e ( s t r )   { \ n     s t r   =   S t r i n g ( s t r ) \ n     i f   ( s t r . l e n g t h   >   1 0 0 0 0 )   { \ n         r e t u r n \ n     } \ n     v a r   m a t c h   =   / ^ ( ( ? : \ \ d + ) ? \ \ . ? \ \ d + )   * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | y e a r s ? | y r s ? | y ) ? $ / i . e x e c ( s t r ) \ n     i f   ( ! m a t c h )   { \ n         r e t u r n \ n     } \ n     v a r   n   =   p a r s e F l o a t ( m a t c h [ 1 ] ) \ n     v a r   t y p e   =   ( m a t c h [ 2 ]   | |   ' m s ' ) . t o L o w e r C a s e ( ) \ n     s w i t c h   ( t y p e )   { \ n         c a s e   ' y e a r s ' : \ n         c a s e   ' y e a r ' : \ n         c a s e   ' y r s ' : \ n         c a s e   ' y r ' : \ n         c a s e   ' y ' : \ n             r e t u r n   n   *   y \ n         c a s e   ' d a y s ' : \ n         c a s e   ' d a y ' : \ n         c a s e   ' d ' : \ n             r e t u r n   n   *   d \ n         c a s e   ' h o u r s ' : \ n         c a s e   ' h o u r ' : \ n         c a s e   ' h r s ' : \ n         c a s e   ' h r ' : \ n         c a s e   ' h ' : \ n             r e t u r n   n   *   h \ n         c a s e   ' m i n u t e s ' : \ n         c a s e   ' m i n u t e ' : \ n         c a s e   ' m i n s ' : \ n         c a s e   ' m i n ' : \ n         c a s e   ' m ' : \ n             r e t u r n   n   *   m \ n         c a s e   ' s e c o n d s ' : \ n         c a s e   ' s e c o n d ' : \ n         c a s e   ' s e c s ' : \ n         c a s e   ' s e c ' : \ n         c a s e   ' s ' : \ n             r e t u r n   n   *   s \ n         c a s e   ' m i l l i s e c o n d s ' : \ n         c a s e   ' m i l l i s e c o n d ' : \ n         c a s e   ' m s e c s ' : \ n         c a s e   ' m s e c ' : \ n         c a s e   ' m s ' : \ n             r e t u r n   n \ n         d e f a u l t : \ n             r e t u r n   u n d e f i n e d \ n     } \ n } \ n \ n / * * \ n   *   S h o r t   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   f m t S h o r t ( m s )   { \ n     i f   ( m s   > =   d )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   d )   +   ' d ' \ n     } \ n     i f   ( m s   > =   h )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   h )   +   ' h ' \ n     } \ n     i f   ( m s   > =   m )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   m )   +   ' m ' \ n     } \ n     i f   ( m s   > =   s )   { \ n         r e t u r n   M a t h . r o u n d ( m s   /   s )   +   ' s ' \ n     } \ n     r e t u r n   m s   +   ' m s ' \ n } \ n \ n / * * \ n   *   L o n g   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   f m t L o n g ( m s )   { \ n     r e t u r n   p l u r a l ( m s ,   d ,   ' d a y ' )   | | \ n         p l u r a l ( m s ,   h ,   ' h o u r ' )   | | \ n         p l u r a l ( m s ,   m ,   ' m i n u t e ' )   | | \ n         p l u r a l ( m s ,   s ,   ' s e c o n d ' )   | | \ n         m s   +   '   m s ' \ n } \ n \ n / * * \ n   *   P l u r a l i z a t i o n   h e l p e r . \ n   * / \ n \ n f u n c t i o n   p l u r a l ( m s ,   n ,   n a m e )   { \ n     i f   ( m s   <   n )   { \ n         r e t u r n \ n     } \ n     i f   ( m s   <   n   *   1 . 5 )   { \ n         r e t u r n   M a t h . f l o o r ( m s   /   n )   +   '   '   +   n a m e \ n     } \ n     r e t u r n   M a t h . c e i l ( m s   /   n )   +   '   '   +   n a m e   +   ' s ' \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / m s / i n d e x . j s \ n / /   m o d u l e   i d   =   6 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - p a r s e r ' ) ; \ n v a r   j s o n   =   r e q u i r e ( ' j s o n 3 ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   b i n a r y   =   r e q u i r e ( ' . / b i n a r y ' ) ; \ n v a r   i s B u f   =   r e q u i r e ( ' . / i s - b u f f e r ' ) ; \ n \ n / * * \ n   *   P r o t o c o l   v e r s i o n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . p r o t o c o l   =   4 ; \ n \ n / * * \ n   *   P a c k e t   t y p e s . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . t y p e s   =   [ \ n     ' C O N N E C T ' , \ n     ' D I S C O N N E C T ' , \ n     ' E V E N T ' , \ n     ' A C K ' , \ n     '  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m ' , \ n     ' B I N A R Y _ E V E N T ' , \ n     ' B I N A R Y _ A C K ' \ n ] ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` c o n n e c t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . C O N N E C T   =   0 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` d i s c o n n e c t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . D I S C O N N E C T   =   1 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` e v e n t ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . E V E N T   =   2 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` a c k ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . A C K   =   3 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   `  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s .  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m   =   4 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ' b i n a r y   e v e n t ' \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . B I N A R Y _ E V E N T   =   5 ; \ n \ n / * * \ n   *   P a c k e t   t y p e   ` b i n a r y   a c k ` .   F o r   a c k s   w i t h   b i n a r y   a r g u m e n t s . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . B I N A R Y _ A C K   =   6 ; \ n \ n / * * \ n   *   E n c o d e r   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . E n c o d e r   =   E n c o d e r ; \ n \ n / * * \ n   *   D e c o d e r   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . D e c o d e r   =   D e c o d e r ; \ n \ n / * * \ n   *   A   s o c k e t . i o   E n c o d e r   i n s t a n c e \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   E n c o d e r ( )   { } \ n \ n / * * \ n   *   E n c o d e   a   p a c k e t   a s   a   s i n g l e   s t r i n g   i f   n o n - b i n a r y ,   o r   a s   a \ n   *   b u f f e r   s e q u e n c e ,   d e p e n d i n g   o n   p a c k e t   t y p e . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o b j   -   p a c k e t   o b j e c t \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k   -   f u n c t i o n   t o   h a n d l e   e n c o d i n g s   ( l i k e l y   e n g i n e . w r i t e ) \ n   *   @ r e t u r n   C a l l s   c a l l b a c k   w i t h   A r r a y   o f   e n c o d i n g s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E n c o d e r . p r o t o t y p e . e n c o d e   =   f u n c t i o n ( o b j ,   c a l l b a c k ) { \ n     d e b u g ( ' e n c o d i n g   p a c k e t   % j ' ,   o b j ) ; \ n \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   o b j . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   o b j . t y p e )   { \ n         e n c o d e A s B i n a r y ( o b j ,   c a l l b a c k ) ; \ n     } \ n     e l s e   { \ n         v a r   e n c o d i n g   =   e n c o d e A s S t r i n g ( o b j ) ; \ n         c a l l b a c k ( [ e n c o d i n g ] ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   E n c o d e   p a c k e t   a s   s t r i n g . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { S t r i n g }   e n c o d e d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   e n c o d e A s S t r i n g ( o b j )   { \ n     v a r   s t r   =   ' ' ; \ n     v a r   n s p   =   f a l s e ; \ n \ n     / /   f i r s t   i s   t y p e \ n     s t r   + =   o b j . t y p e ; \ n \ n     / /   a t t a c h m e n t s   i f   w e   h a v e   t h e m \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   o b j . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   o b j . t y p e )   { \ n         s t r   + =   o b j . a t t a c h m e n t s ; \ n         s t r   + =   ' - ' ; \ n     } \ n \ n     / /   i f   w e   h a v e   a   n a m e s p a c e   o t h e r   t h a n   ` / ` \ n     / /   w e   a p p e n d   i t   f o l l o w e d   b y   a   c o m m a   ` , ` \ n     i f   ( o b j . n s p   & &   ' / '   ! =   o b j . n s p )   { \ n         n s p   =   t r u e ; \ n         s t r   + =   o b j . n s p ; \ n     } \ n \ n     / /   i m m e d i a t e l y   f o l l o w e d   b y   t h e   i d \ n     i f   ( n u l l   ! =   o b j . i d )   { \ n         i f   ( n s p )   { \ n             s t r   + =   ' , ' ; \ n             n s p   =   f a l s e ; \ n         } \ n         s t r   + =   o b j . i d ; \ n     } \ n \ n     / /   j s o n   d a t a \ n     i f   ( n u l l   ! =   o b j . d a t a )   { \ n         i f   ( n s p )   s t r   + =   ' , ' ; \ n         s t r   + =   j s o n . s t r i n g i f y ( o b j . d a t a ) ; \ n     } \ n \ n     d e b u g ( ' e n c o d e d   % j   a s   % s ' ,   o b j ,   s t r ) ; \ n     r e t u r n   s t r ; \ n } \ n \ n / * * \ n   *   E n c o d e   p a c k e t   a s   ' b u f f e r   s e q u e n c e '   b y   r e m o v i n g   b l o b s ,   a n d \ n   *   d e c o n s t r u c t i n g   p a c k e t   i n t o   o b j e c t   w i t h   p l a c e h o l d e r s   a n d \ n   *   a   l i s t   o f   b u f f e r s . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { B u f f e r }   e n c o d e d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   e n c o d e A s B i n a r y ( o b j ,   c a l l b a c k )   { \ n \ n     f u n c t i o n   w r i t e E n c o d i n g ( b l o b l e s s D a t a )   { \ n         v a r   d e c o n s t r u c t i o n   =   b i n a r y . d e c o n s t r u c t P a c k e t ( b l o b l e s s D a t a ) ; \ n         v a r   p a c k   =   e n c o d e A s S t r i n g ( d e c o n s t r u c t i o n . p a c k e t ) ; \ n         v a r   b u f f e r s   =   d e c o n s t r u c t i o n . b u f f e r s ; \ n \ n         b u f f e r s . u n s h i f t ( p a c k ) ;   / /   a d d   p a c k e t   i n f o   t o   b e g i n n i n g   o f   d a t a   l i s t \ n         c a l l b a c k ( b u f f e r s ) ;   / /   w r i t e   a l l   t h e   b u f f e r s \ n     } \ n \ n     b i n a r y . r e m o v e B l o b s ( o b j ,   w r i t e E n c o d i n g ) ; \ n } \ n \ n / * * \ n   *   A   s o c k e t . i o   D e c o d e r   i n s t a n c e \ n   * \ n   *   @ r e t u r n   { O b j e c t }   d e c o d e r \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   D e c o d e r ( )   { \ n     t h i s . r e c o n s t r u c t o r   =   n u l l ; \ n } \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r `   w i t h   D e c o d e r . \ n   * / \ n \ n E m i t t e r ( D e c o d e r . p r o t o t y p e ) ; \ n \ n / * * \ n   *   D e c o d e s   a n   e c o d e d   p a c k e t   s t r i n g   i n t o   p a c k e t   J S O N . \ n   * \ n   *   @ p a r a m   { S t r i n g }   o b j   -   e n c o d e d   p a c k e t \ n   *   @ r e t u r n   { O b j e c t }   p a c k e t \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n D e c o d e r . p r o t o t y p e . a d d   =   f u n c t i o n ( o b j )   { \ n     v a r   p a c k e t ; \ n     i f   ( ' s t r i n g '   = =   t y p e o f   o b j )   { \ n         p a c k e t   =   d e c o d e S t r i n g ( o b j ) ; \ n         i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   p a c k e t . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   p a c k e t . t y p e )   {   / /   b i n a r y   p a c k e t ' s   j s o n \ n             t h i s . r e c o n s t r u c t o r   =   n e w   B i n a r y R e c o n s t r u c t o r ( p a c k e t ) ; \ n \ n             / /   n o   a t t a c h m e n t s ,   l a b e l e d   b i n a r y   b u t   n o   b i n a r y   d a t a   t o   f o l l o w \ n             i f   ( t h i s . r e c o n s t r u c t o r . r e c o n P a c k . a t t a c h m e n t s   = = =   0 )   { \ n                 t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n             } \ n         }   e l s e   {   / /   n o n - b i n a r y   f u l l   p a c k e t \ n             t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n         } \ n     } \ n     e l s e   i f   ( i s B u f ( o b j )   | |   o b j . b a s e 6 4 )   {   / /   r a w   b i n a r y   d a t a \ n         i f   ( ! t h i s . r e c o n s t r u c t o r )   { \ n             t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' g o t   b i n a r y   d a t a   w h e n   n o t   r e c o n s t r u c t i n g   a   p a c k e t ' ) ; \ n         }   e l s e   { \ n             p a c k e t   =   t h i s . r e c o n s t r u c t o r . t a k e B i n a r y D a t a ( o b j ) ; \ n             i f   ( p a c k e t )   {   / /   r e c e i v e d   f i n a l   b u f f e r \ n                 t h i s . r e c o n s t r u c t o r   =   n u l l ; \ n                 t h i s . e m i t ( ' d e c o d e d ' ,   p a c k e t ) ; \ n             } \ n         } \ n     } \ n     e l s e   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' U n k n o w n   t y p e :   '   +   o b j ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   D e c o d e   a   p a c k e t   S t r i n g   ( J S O N   d a t a ) \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   d e c o d e S t r i n g ( s t r )   { \ n     v a r   p   =   { } ; \ n     v a r   i   =   0 ; \ n \ n     / /   l o o k   u p   t y p e \ n     p . t y p e   =   N u m b e r ( s t r . c h a r A t ( 0 ) ) ; \ n     i f   ( n u l l   = =   e x p o r t s . t y p e s [ p . t y p e ] )   r e t u r n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ) ; \ n \ n     / /   l o o k   u p   a t t a c h m e n t s   i f   t y p e   b i n a r y \ n     i f   ( e x p o r t s . B I N A R Y _ E V E N T   = =   p . t y p e   | |   e x p o r t s . B I N A R Y _ A C K   = =   p . t y p e )   { \ n         v a r   b u f   =   ' ' ; \ n         w h i l e   ( s t r . c h a r A t ( + + i )   ! =   ' - ' )   { \ n             b u f   + =   s t r . c h a r A t ( i ) ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n         i f   ( b u f   ! =   N u m b e r ( b u f )   | |   s t r . c h a r A t ( i )   ! =   ' - ' )   { \ n             t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' I l l e g a l   a t t a c h m e n t s ' ) ; \ n         } \ n         p . a t t a c h m e n t s   =   N u m b e r ( b u f ) ; \ n     } \ n \ n     / /   l o o k   u p   n a m e s p a c e   ( i f   a n y ) \ n     i f   ( ' / '   = =   s t r . c h a r A t ( i   +   1 ) )   { \ n         p . n s p   =   ' ' ; \ n         w h i l e   ( + + i )   { \ n             v a r   c   =   s t r . c h a r A t ( i ) ; \ n             i f   ( ' , '   = =   c )   b r e a k ; \ n             p . n s p   + =   c ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n     }   e l s e   { \ n         p . n s p   =   ' / ' ; \ n     } \ n \ n     / /   l o o k   u p   i d \ n     v a r   n e x t   =   s t r . c h a r A t ( i   +   1 ) ; \ n     i f   ( ' '   ! = =   n e x t   & &   N u m b e r ( n e x t )   = =   n e x t )   { \ n         p . i d   =   ' ' ; \ n         w h i l e   ( + + i )   { \ n             v a r   c   =   s t r . c h a r A t ( i ) ; \ n             i f   ( n u l l   = =   c   | |   N u m b e r ( c )   ! =   c )   { \ n                 - - i ; \ n                 b r e a k ; \ n             } \ n             p . i d   + =   s t r . c h a r A t ( i ) ; \ n             i f   ( i   = =   s t r . l e n g t h )   b r e a k ; \ n         } \ n         p . i d   =   N u m b e r ( p . i d ) ; \ n     } \ n \ n     / /   l o o k   u p   j s o n   d a t a \ n     i f   ( s t r . c h a r A t ( + + i ) )   { \ n         p   =   t r y P a r s e ( p ,   s t r . s u b s t r ( i ) ) ; \ n     } \ n \ n     d e b u g ( ' d e c o d e d   % s   a s   % j ' ,   s t r ,   p ) ; \ n     r e t u r n   p ; \ n } \ n \ n f u n c t i o n   t r y P a r s e ( p ,   s t r )   { \ n     t r y   { \ n         p . d a t a   =   j s o n . p a r s e ( s t r ) ; \ n     }   c a t c h ( e ) { \ n         r e t u r n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ) ; \ n     } \ n     r e t u r n   p ;   \ n } ; \ n \ n / * * \ n   *   D e a l l o c a t e s   a   p a r s e r ' s   r e s o u r c e s \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n D e c o d e r . p r o t o t y p e . d e s t r o y   =   f u n c t i o n ( )   { \ n     i f   ( t h i s . r e c o n s t r u c t o r )   { \ n         t h i s . r e c o n s t r u c t o r . f i n i s h e d R e c o n s t r u c t i o n ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   A   m a n a g e r   o f   a   b i n a r y   e v e n t ' s   ' b u f f e r   s e q u e n c e ' .   S h o u l d \ n   *   b e   c o n s t r u c t e d   w h e n e v e r   a   p a c k e t   o f   t y p e   B I N A R Y _ E V E N T   i s \ n   *   d e c o d e d . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ r e t u r n   { B i n a r y R e c o n s t r u c t o r }   i n i t i a l i z e d   r e c o n s t r u c t o r \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   B i n a r y R e c o n s t r u c t o r ( p a c k e t )   { \ n     t h i s . r e c o n P a c k   =   p a c k e t ; \ n     t h i s . b u f f e r s   =   [ ] ; \ n } \ n \ n / * * \ n   *   M e t h o d   t o   b e   c a l l e d   w h e n   b i n a r y   d a t a   r e c e i v e d   f r o m   c o n n e c t i o n \ n   *   a f t e r   a   B I N A R Y _ E V E N T   p a c k e t . \ n   * \ n   *   @ p a r a m   { B u f f e r   |   A r r a y B u f f e r }   b i n D a t a   -   t h e   r a w   b i n a r y   d a t a   r e c e i v e d \ n   *   @ r e t u r n   { n u l l   |   O b j e c t }   r e t u r n s   n u l l   i f   m o r e   b i n a r y   d a t a   i s   e x p e c t e d   o r \ n   *       a   r e c o n s t r u c t e d   p a c k e t   o b j e c t   i f   a l l   b u f f e r s   h a v e   b e e n   r e c e i v e d . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n B i n a r y R e c o n s t r u c t o r . p r o t o t y p e . t a k e B i n a r y D a t a   =   f u n c t i o n ( b i n D a t a )   { \ n     t h i s . b u f f e r s . p u s h ( b i n D a t a ) ; \ n     i f   ( t h i s . b u f f e r s . l e n g t h   = =   t h i s . r e c o n P a c k . a t t a c h m e n t s )   {   / /   d o n e   w i t h   b u f f e r   l i s t \ n         v a r   p a c k e t   =   b i n a r y . r e c o n s t r u c t P a c k e t ( t h i s . r e c o n P a c k ,   t h i s . b u f f e r s ) ; \ n         t h i s . f i n i s h e d R e c o n s t r u c t i o n ( ) ; \ n         r e t u r n   p a c k e t ; \ n     } \ n     r e t u r n   n u l l ; \ n } ; \ n \ n / * * \ n   *   C l e a n s   u p   b i n a r y   p a c k e t   r e c o n s t r u c t i o n   v a r i a b l e s . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n B i n a r y R e c o n s t r u c t o r . p r o t o t y p e . f i n i s h e d R e c o n s t r u c t i o n   =   f u n c t i o n ( )   { \ n     t h i s . r e c o n P a c k   =   n u l l ; \ n     t h i s . b u f f e r s   =   [ ] ; \ n } ; \ n \ n f u n c t i o n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( d a t a ) { \ n     r e t u r n   { \ n         t y p e :   e x p o r t s .  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m , \ n         d a t a :   ' p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' \ n     } ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / i n d e x . j s \ n / /   m o d u l e   i d   =   7 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   w e b   b r o w s e r   i m p l e m e n t a t i o n   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / d e b u g ' ) ; \ n e x p o r t s . l o g   =   l o g ; \ n e x p o r t s . f o r m a t A r g s   =   f o r m a t A r g s ; \ n e x p o r t s . s a v e   =   s a v e ; \ n e x p o r t s . l o a d   =   l o a d ; \ n e x p o r t s . u s e C o l o r s   =   u s e C o l o r s ; \ n e x p o r t s . s t o r a g e   =   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e \ n                               & &   ' u n d e f i n e d '   ! =   t y p e o f   c h r o m e . s t o r a g e \ n                                     ?   c h r o m e . s t o r a g e . l o c a l \ n                                     :   l o c a l s t o r a g e ( ) ; \ n \ n / * * \ n   *   C o l o r s . \ n   * / \ n \ n e x p o r t s . c o l o r s   =   [ \ n     ' l i g h t s e a g r e e n ' , \ n     ' f o r e s t g r e e n ' , \ n     ' g o l d e n r o d ' , \ n     ' d o d g e r b l u e ' , \ n     ' d a r k o r c h i d ' , \ n     ' c r i m s o n ' \ n ] ; \ n \ n / * * \ n   *   C u r r e n t l y   o n l y   W e b K i t - b a s e d   W e b   I n s p e c t o r s ,   F i r e f o x   > =   v 3 1 , \ n   *   a n d   t h e   F i r e b u g   e x t e n s i o n   ( a n y   F i r e f o x   v e r s i o n )   a r e   k n o w n \ n   *   t o   s u p p o r t   \ " % c \ "   C S S   c u s t o m i z a t i o n s . \ n   * \ n   *   T O D O :   a d d   a   ` l o c a l S t o r a g e `   v a r i a b l e   t o   e x p l i c i t l y   e n a b l e / d i s a b l e   c o l o r s \ n   * / \ n \ n f u n c t i o n   u s e C o l o r s ( )   { \ n     / /   i s   w e b k i t ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 1 6 4 5 9 6 0 6 / 3 7 6 7 7 3 \ n     r e t u r n   ( ' W e b k i t A p p e a r a n c e '   i n   d o c u m e n t . d o c u m e n t E l e m e n t . s t y l e )   | | \ n         / /   i s   f i r e b u g ?   h t t p : / / s t a c k o v e r f l o w . c o m / a / 3 9 8 1 2 0 / 3 7 6 7 7 3 \ n         ( w i n d o w . c o n s o l e   & &   ( c o n s o l e . f i r e b u g   | |   ( c o n s o l e . e x c e p t i o n   & &   c o n s o l e . t a b l e ) ) )   | | \ n         / /   i s   f i r e f o x   > =   v 3 1 ? \ n         / /   h t t p s : / / d e v e l o p e r . m o z i l l a . o r g / e n - U S / d o c s / T o o l s / W e b _ C o n s o l e # S t y l i n g _ m e s s a g e s \ n         ( n a v i g a t o r . u s e r A g e n t . t o L o w e r C a s e ( ) . m a t c h ( / f i r e f o x \ \ / ( \ \ d + ) / )   & &   p a r s e I n t ( R e g E x p . $ 1 ,   1 0 )   > =   3 1 ) ; \ n } \ n \ n / * * \ n   *   M a p   % j   t o   ` J S O N . s t r i n g i f y ( ) ` ,   s i n c e   n o   W e b   I n s p e c t o r s   d o   t h a t   b y   d e f a u l t . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s . j   =   f u n c t i o n ( v )   { \ n     r e t u r n   J S O N . s t r i n g i f y ( v ) ; \ n } ; \ n \ n \ n / * * \ n   *   C o l o r i z e   l o g   a r g u m e n t s   i f   e n a b l e d . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   f o r m a t A r g s ( )   { \ n     v a r   a r g s   =   a r g u m e n t s ; \ n     v a r   u s e C o l o r s   =   t h i s . u s e C o l o r s ; \ n \ n     a r g s [ 0 ]   =   ( u s e C o l o r s   ?   ' % c '   :   ' ' ) \ n         +   t h i s . n a m e s p a c e \ n         +   ( u s e C o l o r s   ?   '   % c '   :   '   ' ) \ n         +   a r g s [ 0 ] \ n         +   ( u s e C o l o r s   ?   ' % c   '   :   '   ' ) \ n         +   ' + '   +   e x p o r t s . h u m a n i z e ( t h i s . d i f f ) ; \ n \ n     i f   ( ! u s e C o l o r s )   r e t u r n   a r g s ; \ n \ n     v a r   c   =   ' c o l o r :   '   +   t h i s . c o l o r ; \ n     a r g s   =   [ a r g s [ 0 ] ,   c ,   ' c o l o r :   i n h e r i t ' ] . c o n c a t ( A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g s ,   1 ) ) ; \ n \ n     / /   t h e   f i n a l   \ " % c \ "   i s   s o m e w h a t   t r i c k y ,   b e c a u s e   t h e r e   c o u l d   b e   o t h e r \ n     / /   a r g u m e n t s   p a s s e d   e i t h e r   b e f o r e   o r   a f t e r   t h e   % c ,   s o   w e   n e e d   t o \ n     / /   f i g u r e   o u t   t h e   c o r r e c t   i n d e x   t o   i n s e r t   t h e   C S S   i n t o \ n     v a r   i n d e x   =   0 ; \ n     v a r   l a s t C   =   0 ; \ n     a r g s [ 0 ] . r e p l a c e ( / % [ a - z % ] / g ,   f u n c t i o n ( m a t c h )   { \ n         i f   ( ' % % '   = = =   m a t c h )   r e t u r n ; \ n         i n d e x + + ; \ n         i f   ( ' % c '   = = =   m a t c h )   { \ n             / /   w e   o n l y   a r e   i n t e r e s t e d   i n   t h e   * l a s t *   % c \ n             / /   ( t h e   u s e r   m a y   h a v e   p r o v i d e d   t h e i r   o w n ) \ n             l a s t C   =   i n d e x ; \ n         } \ n     } ) ; \ n \ n     a r g s . s p l i c e ( l a s t C ,   0 ,   c ) ; \ n     r e t u r n   a r g s ; \ n } \ n \ n / * * \ n   *   I n v o k e s   ` c o n s o l e . l o g ( ) `   w h e n   a v a i l a b l e . \ n   *   N o - o p   w h e n   ` c o n s o l e . l o g `   i s   n o t   a   \ " f u n c t i o n \ " . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   l o g ( )   { \ n     / /   t h i s   h a c k e r y   i s    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   f o r   I E 8 / 9 ,   w h e r e \ n     / /   t h e   ` c o n s o l e . l o g `   f u n c t i o n   d o e s n ' t   h a v e   ' a p p l y ' \ n     r e t u r n   ' o b j e c t '   = = =   t y p e o f   c o n s o l e \ n         & &   c o n s o l e . l o g \ n         & &   F u n c t i o n . p r o t o t y p e . a p p l y . c a l l ( c o n s o l e . l o g ,   c o n s o l e ,   a r g u m e n t s ) ; \ n } \ n \ n / * * \ n   *   S a v e   ` n a m e s p a c e s ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s a v e ( n a m e s p a c e s )   { \ n     t r y   { \ n         i f   ( n u l l   = =   n a m e s p a c e s )   { \ n             e x p o r t s . s t o r a g e . r e m o v e I t e m ( ' d e b u g ' ) ; \ n         }   e l s e   { \ n             e x p o r t s . s t o r a g e . d e b u g   =   n a m e s p a c e s ; \ n         } \ n     }   c a t c h ( e )   { } \ n } \ n \ n / * * \ n   *   L o a d   ` n a m e s p a c e s ` . \ n   * \ n   *   @ r e t u r n   { S t r i n g }   r e t u r n s   t h e   p r e v i o u s l y   p e r s i s t e d   d e b u g   m o d e s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o a d ( )   { \ n     v a r   r ; \ n     t r y   { \ n         r   =   e x p o r t s . s t o r a g e . d e b u g ; \ n     }   c a t c h ( e )   { } \ n     r e t u r n   r ; \ n } \ n \ n / * * \ n   *   E n a b l e   n a m e s p a c e s   l i s t e d   i n   ` l o c a l S t o r a g e . d e b u g `   i n i t i a l l y . \ n   * / \ n \ n e x p o r t s . e n a b l e ( l o a d ( ) ) ; \ n \ n / * * \ n   *   L o c a l s t o r a g e   a t t e m p t s   t o   r e t u r n   t h e   l o c a l s t o r a g e . \ n   * \ n   *   T h i s   i s   n e c e s s a r y   b e c a u s e   s a f a r i   t h r o w s \ n   *   w h e n   a   u s e r   d i s a b l e s   c o o k i e s / l o c a l s t o r a g e \ n   *   a n d   y o u   a t t e m p t   t o   a c c e s s   i t . \ n   * \ n   *   @ r e t u r n   { L o c a l S t o r a g e } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o c a l s t o r a g e ( ) { \ n     t r y   { \ n         r e t u r n   w i n d o w . l o c a l S t o r a g e ; \ n     }   c a t c h   ( e )   { } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / b r o w s e r . j s \ n / /   m o d u l e   i d   =   8 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   T h i s   i s   t h e   c o m m o n   l o g i c   f o r   b o t h   t h e   N o d e . j s   a n d   w e b   b r o w s e r \ n   *   i m p l e m e n t a t i o n s   o f   ` d e b u g ( ) ` . \ n   * \ n   *   E x p o s e   ` d e b u g ( ) `   a s   t h e   m o d u l e . \ n   * / \ n \ n e x p o r t s   =   m o d u l e . e x p o r t s   =   d e b u g ; \ n e x p o r t s . c o e r c e   =   c o e r c e ; \ n e x p o r t s . d i s a b l e   =   d i s a b l e ; \ n e x p o r t s . e n a b l e   =   e n a b l e ; \ n e x p o r t s . e n a b l e d   =   e n a b l e d ; \ n e x p o r t s . h u m a n i z e   =   r e q u i r e ( ' m s ' ) ; \ n \ n / * * \ n   *   T h e   c u r r e n t l y   a c t i v e   d e b u g   m o d e   n a m e s ,   a n d   n a m e s   t o   s k i p . \ n   * / \ n \ n e x p o r t s . n a m e s   =   [ ] ; \ n e x p o r t s . s k i p s   =   [ ] ; \ n \ n / * * \ n   *   M a p   o f   s p e c i a l   \ " % n \ "   h a n d l i n g   f u n c t i o n s ,   f o r   t h e   d e b u g   \ " f o r m a t \ "   a r g u m e n t . \ n   * \ n   *   V a l i d   k e y   n a m e s   a r e   a   s i n g l e ,   l o w e r c a s e d   l e t t e r ,   i . e .   \ " n \ " . \ n   * / \ n \ n e x p o r t s . f o r m a t t e r s   =   { } ; \ n \ n / * * \ n   *   P r e v i o u s l y   a s s i g n e d   c o l o r . \ n   * / \ n \ n v a r   p r e v C o l o r   =   0 ; \ n \ n / * * \ n   *   P r e v i o u s   l o g   t i m e s t a m p . \ n   * / \ n \ n v a r   p r e v T i m e ; \ n \ n / * * \ n   *   S e l e c t   a   c o l o r . \ n   * \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s e l e c t C o l o r ( )   { \ n     r e t u r n   e x p o r t s . c o l o r s [ p r e v C o l o r + +   %   e x p o r t s . c o l o r s . l e n g t h ] ; \ n } \ n \ n / * * \ n   *   C r e a t e   a   d e b u g g e r   w i t h   t h e   g i v e n   ` n a m e s p a c e ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e \ n   *   @ r e t u r n   { F u n c t i o n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d e b u g ( n a m e s p a c e )   { \ n \ n     / /   d e f i n e   t h e   ` d i s a b l e d `   v e r s i o n \ n     f u n c t i o n   d i s a b l e d ( )   { \ n     } \ n     d i s a b l e d . e n a b l e d   =   f a l s e ; \ n \ n     / /   d e f i n e   t h e   ` e n a b l e d `   v e r s i o n \ n     f u n c t i o n   e n a b l e d ( )   { \ n \ n         v a r   s e l f   =   e n a b l e d ; \ n \ n         / /   s e t   ` d i f f `   t i m e s t a m p \ n         v a r   c u r r   =   + n e w   D a t e ( ) ; \ n         v a r   m s   =   c u r r   -   ( p r e v T i m e   | |   c u r r ) ; \ n         s e l f . d i f f   =   m s ; \ n         s e l f . p r e v   =   p r e v T i m e ; \ n         s e l f . c u r r   =   c u r r ; \ n         p r e v T i m e   =   c u r r ; \ n \ n         / /   a d d   t h e   ` c o l o r `   i f   n o t   s e t \ n         i f   ( n u l l   = =   s e l f . u s e C o l o r s )   s e l f . u s e C o l o r s   =   e x p o r t s . u s e C o l o r s ( ) ; \ n         i f   ( n u l l   = =   s e l f . c o l o r   & &   s e l f . u s e C o l o r s )   s e l f . c o l o r   =   s e l e c t C o l o r ( ) ; \ n \ n         v a r   a r g s   =   A r r a y . p r o t o t y p e . s l i c e . c a l l ( a r g u m e n t s ) ; \ n \ n         a r g s [ 0 ]   =   e x p o r t s . c o e r c e ( a r g s [ 0 ] ) ; \ n \ n         i f   ( ' s t r i n g '   ! = =   t y p e o f   a r g s [ 0 ] )   { \ n             / /   a n y t h i n g   e l s e   l e t ' s   i n s p e c t   w i t h   % o \ n             a r g s   =   [ ' % o ' ] . c o n c a t ( a r g s ) ; \ n         } \ n \ n         / /   a p p l y   a n y   ` f o r m a t t e r s `   t r a n s f o r m a t i o n s \ n         v a r   i n d e x   =   0 ; \ n         a r g s [ 0 ]   =   a r g s [ 0 ] . r e p l a c e ( / % ( [ a - z % ] ) / g ,   f u n c t i o n ( m a t c h ,   f o r m a t )   { \ n             / /   i f   w e   e n c o u n t e r   a n   e s c a p e d   %   t h e n   d o n ' t   i n c r e a s e   t h e   a r r a y   i n d e x \ n             i f   ( m a t c h   = = =   ' % % ' )   r e t u r n   m a t c h ; \ n             i n d e x + + ; \ n             v a r   f o r m a t t e r   =   e x p o r t s . f o r m a t t e r s [ f o r m a t ] ; \ n             i f   ( ' f u n c t i o n '   = = =   t y p e o f   f o r m a t t e r )   { \ n                 v a r   v a l   =   a r g s [ i n d e x ] ; \ n                 m a t c h   =   f o r m a t t e r . c a l l ( s e l f ,   v a l ) ; \ n \ n                 / /   n o w   w e   n e e d   t o   r e m o v e   ` a r g s [ i n d e x ] `   s i n c e   i t ' s   i n l i n e d   i n   t h e   ` f o r m a t ` \ n                 a r g s . s p l i c e ( i n d e x ,   1 ) ; \ n                 i n d e x - - ; \ n             } \ n             r e t u r n   m a t c h ; \ n         } ) ; \ n \ n         i f   ( ' f u n c t i o n '   = = =   t y p e o f   e x p o r t s . f o r m a t A r g s )   { \ n             a r g s   =   e x p o r t s . f o r m a t A r g s . a p p l y ( s e l f ,   a r g s ) ; \ n         } \ n         v a r   l o g F n   =   e n a b l e d . l o g   | |   e x p o r t s . l o g   | |   c o n s o l e . l o g . b i n d ( c o n s o l e ) ; \ n         l o g F n . a p p l y ( s e l f ,   a r g s ) ; \ n     } \ n     e n a b l e d . e n a b l e d   =   t r u e ; \ n \ n     v a r   f n   =   e x p o r t s . e n a b l e d ( n a m e s p a c e )   ?   e n a b l e d   :   d i s a b l e d ; \ n \ n     f n . n a m e s p a c e   =   n a m e s p a c e ; \ n \ n     r e t u r n   f n ; \ n } \ n \ n / * * \ n   *   E n a b l e s   a   d e b u g   m o d e   b y   n a m e s p a c e s .   T h i s   c a n   i n c l u d e   m o d e s \ n   *   s e p a r a t e d   b y   a   c o l o n   a n d   w i l d c a r d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e s p a c e s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e ( n a m e s p a c e s )   { \ n     e x p o r t s . s a v e ( n a m e s p a c e s ) ; \ n \ n     v a r   s p l i t   =   ( n a m e s p a c e s   | |   ' ' ) . s p l i t ( / [ \ \ s , ] + / ) ; \ n     v a r   l e n   =   s p l i t . l e n g t h ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   l e n ;   i + + )   { \ n         i f   ( ! s p l i t [ i ] )   c o n t i n u e ;   / /   i g n o r e   e m p t y   s t r i n g s \ n         n a m e s p a c e s   =   s p l i t [ i ] . r e p l a c e ( / \ \ * / g ,   ' . * ? ' ) ; \ n         i f   ( n a m e s p a c e s [ 0 ]   = = =   ' - ' )   { \ n             e x p o r t s . s k i p s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s . s u b s t r ( 1 )   +   ' ) ) ; \ n         }   e l s e   { \ n             e x p o r t s . n a m e s . p u s h ( n e w   R e g E x p ( ' ^ '   +   n a m e s p a c e s   +   ' ) ) ; \ n         } \ n     } \ n } \ n \ n / * * \ n   *   D i s a b l e   d e b u g   o u t p u t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   d i s a b l e ( )   { \ n     e x p o r t s . e n a b l e ( ' ' ) ; \ n } \ n \ n / * * \ n   *   R e t u r n s   t r u e   i f   t h e   g i v e n   m o d e   n a m e   i s   e n a b l e d ,   f a l s e   o t h e r w i s e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   n a m e \ n   *   @ r e t u r n   { B o o l e a n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   e n a b l e d ( n a m e )   { \ n     v a r   i ,   l e n ; \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . s k i p s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . s k i p s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   f a l s e ; \ n         } \ n     } \ n     f o r   ( i   =   0 ,   l e n   =   e x p o r t s . n a m e s . l e n g t h ;   i   <   l e n ;   i + + )   { \ n         i f   ( e x p o r t s . n a m e s [ i ] . t e s t ( n a m e ) )   { \ n             r e t u r n   t r u e ; \ n         } \ n     } \ n     r e t u r n   f a l s e ; \ n } \ n \ n / * * \ n   *   C o e r c e   ` v a l ` . \ n   * \ n   *   @ p a r a m   { M i x e d }   v a l \ n   *   @ r e t u r n   { M i x e d } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   c o e r c e ( v a l )   { \ n     i f   ( v a l   i n s t a n c e o f    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n   v a l . s t a c k   | |   v a l . m e s s a g e ; \ n     r e t u r n   v a l ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / d e b u g / d e b u g . j s \ n / /   m o d u l e   i d   =   9 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   H e l p e r s . \ n   * / \ n \ n v a r   s   =   1 0 0 0 ; \ n v a r   m   =   s   *   6 0 ; \ n v a r   h   =   m   *   6 0 ; \ n v a r   d   =   h   *   2 4 ; \ n v a r   y   =   d   *   3 6 5 . 2 5 ; \ n \ n / * * \ n   *   P a r s e   o r   f o r m a t   t h e   g i v e n   ` v a l ` . \ n   * \ n   *   O p t i o n s : \ n   * \ n   *     -   ` l o n g `   v e r b o s e   f o r m a t t i n g   [ f a l s e ] \ n   * \ n   *   @ p a r a m   { S t r i n g | N u m b e r }   v a l \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ r e t u r n   { S t r i n g | N u m b e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( v a l ,   o p t i o n s ) { \ n     o p t i o n s   =   o p t i o n s   | |   { } ; \ n     i f   ( ' s t r i n g '   = =   t y p e o f   v a l )   r e t u r n   p a r s e ( v a l ) ; \ n     r e t u r n   o p t i o n s . l o n g \ n         ?   l o n g ( v a l ) \ n         :   s h o r t ( v a l ) ; \ n } ; \ n \ n / * * \ n   *   P a r s e   t h e   g i v e n   ` s t r `   a n d   r e t u r n   m i l l i s e c o n d s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   p a r s e ( s t r )   { \ n     s t r   =   ' '   +   s t r ; \ n     i f   ( s t r . l e n g t h   >   1 0 0 0 0 )   r e t u r n ; \ n     v a r   m a t c h   =   / ^ ( ( ? : \ \ d + ) ? \ \ . ? \ \ d + )   * ( m i l l i s e c o n d s ? | m s e c s ? | m s | s e c o n d s ? | s e c s ? | s | m i n u t e s ? | m i n s ? | m | h o u r s ? | h r s ? | h | d a y s ? | d | y e a r s ? | y r s ? | y ) ? $ / i . e x e c ( s t r ) ; \ n     i f   ( ! m a t c h )   r e t u r n ; \ n     v a r   n   =   p a r s e F l o a t ( m a t c h [ 1 ] ) ; \ n     v a r   t y p e   =   ( m a t c h [ 2 ]   | |   ' m s ' ) . t o L o w e r C a s e ( ) ; \ n     s w i t c h   ( t y p e )   { \ n         c a s e   ' y e a r s ' : \ n         c a s e   ' y e a r ' : \ n         c a s e   ' y r s ' : \ n         c a s e   ' y r ' : \ n         c a s e   ' y ' : \ n             r e t u r n   n   *   y ; \ n         c a s e   ' d a y s ' : \ n         c a s e   ' d a y ' : \ n         c a s e   ' d ' : \ n             r e t u r n   n   *   d ; \ n         c a s e   ' h o u r s ' : \ n         c a s e   ' h o u r ' : \ n         c a s e   ' h r s ' : \ n         c a s e   ' h r ' : \ n         c a s e   ' h ' : \ n             r e t u r n   n   *   h ; \ n         c a s e   ' m i n u t e s ' : \ n         c a s e   ' m i n u t e ' : \ n         c a s e   ' m i n s ' : \ n         c a s e   ' m i n ' : \ n         c a s e   ' m ' : \ n             r e t u r n   n   *   m ; \ n         c a s e   ' s e c o n d s ' : \ n         c a s e   ' s e c o n d ' : \ n         c a s e   ' s e c s ' : \ n         c a s e   ' s e c ' : \ n         c a s e   ' s ' : \ n             r e t u r n   n   *   s ; \ n         c a s e   ' m i l l i s e c o n d s ' : \ n         c a s e   ' m i l l i s e c o n d ' : \ n         c a s e   ' m s e c s ' : \ n         c a s e   ' m s e c ' : \ n         c a s e   ' m s ' : \ n             r e t u r n   n ; \ n     } \ n } \ n \ n / * * \ n   *   S h o r t   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   s h o r t ( m s )   { \ n     i f   ( m s   > =   d )   r e t u r n   M a t h . r o u n d ( m s   /   d )   +   ' d ' ; \ n     i f   ( m s   > =   h )   r e t u r n   M a t h . r o u n d ( m s   /   h )   +   ' h ' ; \ n     i f   ( m s   > =   m )   r e t u r n   M a t h . r o u n d ( m s   /   m )   +   ' m ' ; \ n     i f   ( m s   > =   s )   r e t u r n   M a t h . r o u n d ( m s   /   s )   +   ' s ' ; \ n     r e t u r n   m s   +   ' m s ' ; \ n } \ n \ n / * * \ n   *   L o n g   f o r m a t   f o r   ` m s ` . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m s \ n   *   @ r e t u r n   { S t r i n g } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   l o n g ( m s )   { \ n     r e t u r n   p l u r a l ( m s ,   d ,   ' d a y ' ) \ n         | |   p l u r a l ( m s ,   h ,   ' h o u r ' ) \ n         | |   p l u r a l ( m s ,   m ,   ' m i n u t e ' ) \ n         | |   p l u r a l ( m s ,   s ,   ' s e c o n d ' ) \ n         | |   m s   +   '   m s ' ; \ n } \ n \ n / * * \ n   *   P l u r a l i z a t i o n   h e l p e r . \ n   * / \ n \ n f u n c t i o n   p l u r a l ( m s ,   n ,   n a m e )   { \ n     i f   ( m s   <   n )   r e t u r n ; \ n     i f   ( m s   <   n   *   1 . 5 )   r e t u r n   M a t h . f l o o r ( m s   /   n )   +   '   '   +   n a m e ; \ n     r e t u r n   M a t h . c e i l ( m s   /   n )   +   '   '   +   n a m e   +   ' s ' ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / m s / i n d e x . j s \ n / /   m o d u l e   i d   =   1 0 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * *   I M P O R T S   F R O M   i m p o r t s - l o a d e r   * * * / \ n v a r   d e f i n e   =   f a l s e ; \ n \ n / * !   J S O N   v 3 . 3 . 2   |   h t t p : / / b e s t i e j s . g i t h u b . i o / j s o n 3   |   C o p y r i g h t   2 0 1 2 - 2 0 1 4 ,   K i t   C a m b r i d g e   |   h t t p : / / k i t . m i t - l i c e n s e . o r g   * / \ n ; ( f u n c t i o n   ( )   { \ n     / /   D e t e c t   t h e   ` d e f i n e `   f u n c t i o n   e x p o s e d   b y   a s y n c h r o n o u s   m o d u l e   l o a d e r s .   T h e \ n     / /   s t r i c t   ` d e f i n e `   c h e c k   i s   n e c e s s a r y   f o r   c o m p a t i b i l i t y   w i t h   ` r . j s ` . \ n     v a r   i s L o a d e r   =   t y p e o f   d e f i n e   = = =   \ " f u n c t i o n \ "   & &   d e f i n e . a m d ; \ n \ n     / /   A   s e t   o f   t y p e s   u s e d   t o   d i s t i n g u i s h   o b j e c t s   f r o m   p r i m i t i v e s . \ n     v a r   o b j e c t T y p e s   =   { \ n         \ " f u n c t i o n \ " :   t r u e , \ n         \ " o b j e c t \ " :   t r u e \ n     } ; \ n \ n     / /   D e t e c t   t h e   ` e x p o r t s `   o b j e c t   e x p o s e d   b y   C o m m o n J S   i m p l e m e n t a t i o n s . \ n     v a r   f r e e E x p o r t s   =   o b j e c t T y p e s [ t y p e o f   e x p o r t s ]   & &   e x p o r t s   & &   ! e x p o r t s . n o d e T y p e   & &   e x p o r t s ; \ n \ n     / /   U s e   t h e   ` g l o b a l `   o b j e c t   e x p o s e d   b y   N o d e   ( i n c l u d i n g   B r o w s e r i f y   v i a \ n     / /   ` i n s e r t - m o d u l e - g l o b a l s ` ) ,   N a r w h a l ,   a n d   R i n g o   a s   t h e   d e f a u l t   c o n t e x t , \ n     / /   a n d   t h e   ` w i n d o w `   o b j e c t   i n   b r o w s e r s .   R h i n o   e x p o r t s   a   ` g l o b a l `   f u n c t i o n \ n     / /   i n s t e a d . \ n     v a r   r o o t   =   o b j e c t T y p e s [ t y p e o f   w i n d o w ]   & &   w i n d o w   | |   t h i s , \ n             f r e e G l o b a l   =   f r e e E x p o r t s   & &   o b j e c t T y p e s [ t y p e o f   m o d u l e ]   & &   m o d u l e   & &   ! m o d u l e . n o d e T y p e   & &   t y p e o f   g l o b a l   = =   \ " o b j e c t \ "   & &   g l o b a l ; \ n \ n     i f   ( f r e e G l o b a l   & &   ( f r e e G l o b a l [ \ " g l o b a l \ " ]   = = =   f r e e G l o b a l   | |   f r e e G l o b a l [ \ " w i n d o w \ " ]   = = =   f r e e G l o b a l   | |   f r e e G l o b a l [ \ " s e l f \ " ]   = = =   f r e e G l o b a l ) )   { \ n         r o o t   =   f r e e G l o b a l ; \ n     } \ n \ n     / /   P u b l i c :   I n i t i a l i z e s   J S O N   3   u s i n g   t h e   g i v e n   ` c o n t e x t `   o b j e c t ,   a t t a c h i n g   t h e \ n     / /   ` s t r i n g i f y `   a n d   ` p a r s e `   f u n c t i o n s   t o   t h e   s p e c i f i e d   ` e x p o r t s `   o b j e c t . \ n     f u n c t i o n   r u n I n C o n t e x t ( c o n t e x t ,   e x p o r t s )   { \ n         c o n t e x t   | |   ( c o n t e x t   =   r o o t [ \ " O b j e c t \ " ] ( ) ) ; \ n         e x p o r t s   | |   ( e x p o r t s   =   r o o t [ \ " O b j e c t \ " ] ( ) ) ; \ n \ n         / /   N a t i v e   c o n s t r u c t o r   a l i a s e s . \ n         v a r   N u m b e r   =   c o n t e x t [ \ " N u m b e r \ " ]   | |   r o o t [ \ " N u m b e r \ " ] , \ n                 S t r i n g   =   c o n t e x t [ \ " S t r i n g \ " ]   | |   r o o t [ \ " S t r i n g \ " ] , \ n                 O b j e c t   =   c o n t e x t [ \ " O b j e c t \ " ]   | |   r o o t [ \ " O b j e c t \ " ] , \ n                 D a t e   =   c o n t e x t [ \ " D a t e \ " ]   | |   r o o t [ \ " D a t e \ " ] , \ n                 S y n t a x E r r o r   =   c o n t e x t [ \ " S y n t a x E r r o r \ " ]   | |   r o o t [ \ " S y n t a x E r r o r \ " ] , \ n                 T y p e E r r o r   =   c o n t e x t [ \ " T y p e E r r o r \ " ]   | |   r o o t [ \ " T y p e E r r o r \ " ] , \ n                 M a t h   =   c o n t e x t [ \ " M a t h \ " ]   | |   r o o t [ \ " M a t h \ " ] , \ n                 n a t i v e J S O N   =   c o n t e x t [ \ " J S O N \ " ]   | |   r o o t [ \ " J S O N \ " ] ; \ n \ n         / /   D e l e g a t e   t o   t h e   n a t i v e   ` s t r i n g i f y `   a n d   ` p a r s e `   i m p l e m e n t a t i o n s . \ n         i f   ( t y p e o f   n a t i v e J S O N   = =   \ " o b j e c t \ "   & &   n a t i v e J S O N )   { \ n             e x p o r t s . s t r i n g i f y   =   n a t i v e J S O N . s t r i n g i f y ; \ n             e x p o r t s . p a r s e   =   n a t i v e J S O N . p a r s e ; \ n         } \ n \ n         / /   C o n v e n i e n c e   a l i a s e s . \ n         v a r   o b j e c t P r o t o   =   O b j e c t . p r o t o t y p e , \ n                 g e t C l a s s   =   o b j e c t P r o t o . t o S t r i n g , \ n                 i s P r o p e r t y ,   f o r E a c h ,   u n d e f ; \ n \ n         / /   T e s t   t h e   ` D a t e # g e t U T C * `   m e t h o d s .   B a s e d   o n   w o r k   b y   @ Y a f f l e . \ n         v a r   i s E x t e n d e d   =   n e w   D a t e ( - 3 5 0 9 8 2 7 3 3 4 5 7 3 2 9 2 ) ; \ n         t r y   { \ n             / /   T h e   ` g e t U T C F u l l Y e a r ` ,   ` M o n t h ` ,   a n d   ` D a t e `   m e t h o d s   r e t u r n   n o n s e n s i c a l \ n             / /   r e s u l t s   f o r   c e r t a i n   d a t e s   i n   O p e r a   > =   1 0 . 5 3 . \ n             i s E x t e n d e d   =   i s E x t e n d e d . g e t U T C F u l l Y e a r ( )   = =   - 1 0 9 2 5 2   & &   i s E x t e n d e d . g e t U T C M o n t h ( )   = = =   0   & &   i s E x t e n d e d . g e t U T C D a t e ( )   = = =   1   & & \ n                 / /   S a f a r i   <   2 . 0 . 2   s t o r e s   t h e   i n t e r n a l   m i l l i s e c o n d   t i m e   v a l u e   c o r r e c t l y , \ n                 / /   b u t   c l i p s   t h e   v a l u e s   r e t u r n e d   b y   t h e   d a t e   m e t h o d s   t o   t h e   r a n g e   o f \ n                 / /   s i g n e d   3 2 - b i t   i n t e g e r s   ( [ - 2   * *   3 1 ,   2   * *   3 1   -   1 ] ) . \ n                 i s E x t e n d e d . g e t U T C H o u r s ( )   = =   1 0   & &   i s E x t e n d e d . g e t U T C M i n u t e s ( )   = =   3 7   & &   i s E x t e n d e d . g e t U T C S e c o n d s ( )   = =   6   & &   i s E x t e n d e d . g e t U T C M i l l i s e c o n d s ( )   = =   7 0 8 ; \ n         }   c a t c h   ( e x c e p t i o n )   { } \ n \ n         / /   I n t e r n a l :   D e t e r m i n e s   w h e t h e r   t h e   n a t i v e   ` J S O N . s t r i n g i f y `   a n d   ` p a r s e ` \ n         / /   i m p l e m e n t a t i o n s   a r e   s p e c - c o m p l i a n t .   B a s e d   o n   w o r k   b y   K e n   S n y d e r . \ n         f u n c t i o n   h a s ( n a m e )   { \ n             i f   ( h a s [ n a m e ]   ! = =   u n d e f )   { \ n                 / /   R e t u r n   c a c h e d   f e a t u r e   t e s t   r e s u l t . \ n                 r e t u r n   h a s [ n a m e ] ; \ n             } \ n             v a r   i s S u p p o r t e d ; \ n             i f   ( n a m e   = =   \ " b u g - s t r i n g - c h a r - i n d e x \ " )   { \ n                 / /   I E   < =   7    [ 1 m  [ 3 1 m d o e s n ' t   s u p p o r t  [ 3 9 m  [ 2 2 m  [ 1 m   a c c e s s i n g   s t r i n g   c h a r a c t e r s   u s i n g   s q u a r e \ n                 / /   b r a c k e t   n o t a t i o n .   I E   8   o n l y   s u p p o r t s   t h i s   f o r   p r i m i t i v e s . \ n                 i s S u p p o r t e d   =   \ " a \ " [ 0 ]   ! =   \ " a \ " ; \ n             }   e l s e   i f   ( n a m e   = =   \ " j s o n \ " )   { \ n                 / /   I n d i c a t e s   w h e t h e r   b o t h   ` J S O N . s t r i n g i f y `   a n d   ` J S O N . p a r s e `   a r e \ n                 / /   s u p p o r t e d . \ n                 i s S u p p o r t e d   =   h a s ( \ " j s o n - s t r i n g i f y \ " )   & &   h a s ( \ " j s o n - p a r s e \ " ) ; \ n             }   e l s e   { \ n                 v a r   v a l u e ,   s e r i a l i z e d   =   ' { \ " a \ " : [ 1 , t r u e , f a l s e , n u l l , \ " \ \ \ \ u 0 0 0 0 \ \ \ \ b \ \ \ \ n \ \ \ \ f \ \ \ \ r \ \ \ \ t \ " ] } ' ; \ n                 / /   T e s t   ` J S O N . s t r i n g i f y ` . \ n                 i f   ( n a m e   = =   \ " j s o n - s t r i n g i f y \ " )   { \ n                     v a r   s t r i n g i f y   =   e x p o r t s . s t r i n g i f y ,   s t r i n g i f y S u p p o r t e d   =   t y p e o f   s t r i n g i f y   = =   \ " f u n c t i o n \ "   & &   i s E x t e n d e d ; \ n                     i f   ( s t r i n g i f y S u p p o r t e d )   { \ n                         / /   A   t e s t   f u n c t i o n   o b j e c t   w i t h   a   c u s t o m   ` t o J S O N `   m e t h o d . \ n                         ( v a l u e   =   f u n c t i o n   ( )   { \ n                             r e t u r n   1 ; \ n                         } ) . t o J S O N   =   v a l u e ; \ n                         t r y   { \ n                             s t r i n g i f y S u p p o r t e d   = \ n                                 / /   F i r e f o x   3 . 1 b 1   a n d   b 2   s e r i a l i z e   s t r i n g ,   n u m b e r ,   a n d   b o o l e a n \ n                                 / /   p r i m i t i v e s   a s   o b j e c t   l i t e r a l s . \ n                                 s t r i n g i f y ( 0 )   = = =   \ " 0 \ "   & & \ n                                 / /   F F   3 . 1 b 1 ,   b 2 ,   a n d   J S O N   2   s e r i a l i z e   w r a p p e d   p r i m i t i v e s   a s   o b j e c t \ n                                 / /   l i t e r a l s . \ n                                 s t r i n g i f y ( n e w   N u m b e r ( ) )   = = =   \ " 0 \ "   & & \ n                                 s t r i n g i f y ( n e w   S t r i n g ( ) )   = =   ' \ " \ " '   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   t h e   v a l u e   i s   ` n u l l ` ,   ` u n d e f i n e d ` ,   o r \ n                                 / /   d o e s   n o t   d e f i n e   a   c a n o n i c a l   J S O N   r e p r e s e n t a t i o n   ( t h i s   a p p l i e s   t o \ n                                 / /   o b j e c t s   w i t h   ` t o J S O N `   p r o p e r t i e s   a s   w e l l ,   * u n l e s s *   t h e y   a r e   n e s t e d \ n                                 / /   w i t h i n   a n   o b j e c t   o r   a r r a y ) . \ n                                 s t r i n g i f y ( g e t C l a s s )   = = =   u n d e f   & & \ n                                 / /   I E   8   s e r i a l i z e s   ` u n d e f i n e d `   a s   ` \ " u n d e f i n e d \ " ` .   S a f a r i   < =   5 . 1 . 7   a n d \ n                                 / /   F F   3 . 1 b 3   p a s s   t h i s   t e s t . \ n                                 s t r i n g i f y ( u n d e f )   = = =   u n d e f   & & \ n                                 / /   S a f a r i   < =   5 . 1 . 7   a n d   F F   3 . 1 b 3   t h r o w   `  [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ` s   a n d   ` T y p e E r r o r ` s , \ n                                 / /   r e s p e c t i v e l y ,   i f   t h e   v a l u e   i s   o m i t t e d   e n t i r e l y . \ n                                 s t r i n g i f y ( )   = = =   u n d e f   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i f   t h e   g i v e n   v a l u e   i s   n o t   a   n u m b e r , \ n                                 / /   s t r i n g ,   a r r a y ,   o b j e c t ,   B o o l e a n ,   o r   ` n u l l `   l i t e r a l .   T h i s   a p p l i e s   t o \ n                                 / /   o b j e c t s   w i t h   c u s t o m   ` t o J S O N `   m e t h o d s   a s   w e l l ,   u n l e s s   t h e y   a r e   n e s t e d \ n                                 / /   i n s i d e   o b j e c t   o r   a r r a y   l i t e r a l s .   Y U I   3 . 0 . 0 b 1   i g n o r e s   c u s t o m   ` t o J S O N ` \ n                                 / /   m e t h o d s   e n t i r e l y . \ n                                 s t r i n g i f y ( v a l u e )   = = =   \ " 1 \ "   & & \ n                                 s t r i n g i f y ( [ v a l u e ] )   = =   \ " [ 1 ] \ "   & & \ n                                 / /   P r o t o t y p e   < =   1 . 6 . 1   s e r i a l i z e s   ` [ u n d e f i n e d ] `   a s   ` \ " [ ] \ " `   i n s t e a d   o f \ n                                 / /   ` \ " [ n u l l ] \ " ` . \ n                                 s t r i n g i f y ( [ u n d e f ] )   = =   \ " [ n u l l ] \ "   & & \ n                                 / /   Y U I   3 . 0 . 0 b 1   f a i l s   t o   s e r i a l i z e   ` n u l l `   l i t e r a l s . \ n                                 s t r i n g i f y ( n u l l )   = =   \ " n u l l \ "   & & \ n                                 / /   F F   3 . 1 b 1 ,   2   h a l t s   s e r i a l i z a t i o n   i f   a n   a r r a y   c o n t a i n s   a   f u n c t i o n : \ n                                 / /   ` [ 1 ,   t r u e ,   g e t C l a s s ,   1 ] `   s e r i a l i z e s   a s   \ " [ 1 , t r u e , ] , \ " .   F F   3 . 1 b 3 \ n                                 / /   e l i d e s   n o n - J S O N   v a l u e s   f r o m   o b j e c t s   a n d   a r r a y s ,   u n l e s s   t h e y \ n                                 / /   d e f i n e   c u s t o m   ` t o J S O N `   m e t h o d s . \ n                                 s t r i n g i f y ( [ u n d e f ,   g e t C l a s s ,   n u l l ] )   = =   \ " [ n u l l , n u l l , n u l l ] \ "   & & \ n                                 / /   S i m p l e   s e r i a l i z a t i o n   t e s t .   F F   3 . 1 b 1   u s e s   U n i c o d e   e s c a p e   s e q u e n c e s \ n                                 / /   w h e r e   c h a r a c t e r   e s c a p e   c o d e s   a r e   e x p e c t e d   ( e . g . ,   ` \ \ b `   = >   ` \ \ u 0 0 0 8 ` ) . \ n                                 s t r i n g i f y ( {   \ " a \ " :   [ v a l u e ,   t r u e ,   f a l s e ,   n u l l ,   \ " \ \ x 0 0 \ \ b \ \ n \ \ f \ \ r \ \ t \ " ]   } )   = =   s e r i a l i z e d   & & \ n                                 / /   F F   3 . 1 b 1   a n d   b 2   i g n o r e   t h e   ` f i l t e r `   a n d   ` w i d t h `   a r g u m e n t s . \ n                                 s t r i n g i f y ( n u l l ,   v a l u e )   = = =   \ " 1 \ "   & & \ n                                 s t r i n g i f y ( [ 1 ,   2 ] ,   n u l l ,   1 )   = =   \ " [ \ \ n   1 , \ \ n   2 \ \ n ] \ "   & & \ n                                 / /   J S O N   2 ,   P r o t o t y p e   < =   1 . 7 ,   a n d   o l d e r   W e b K i t   b u i l d s   i n c o r r e c t l y \ n                                 / /   s e r i a l i z e   e x t e n d e d   y e a r s . \ n                                 s t r i n g i f y ( n e w   D a t e ( - 8 . 6 4 e 1 5 ) )   = =   ' \ " - 2 7 1 8 2 1 - 0 4 - 2 0 T 0 0 : 0 0 : 0 0 . 0 0 0 Z \ " '   & & \ n                                 / /   T h e   m i l l i s e c o n d s   a r e   o p t i o n a l   i n   E S   5 ,   b u t    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   i n   5 . 1 . \ n                                 s t r i n g i f y ( n e w   D a t e ( 8 . 6 4 e 1 5 ) )   = =   ' \ " + 2 7 5 7 6 0 - 0 9 - 1 3 T 0 0 : 0 0 : 0 0 . 0 0 0 Z \ " '   & & \ n                                 / /   F i r e f o x   < =   1 1 . 0   i n c o r r e c t l y   s e r i a l i z e s   y e a r s   p r i o r   t o   0   a s   n e g a t i v e \ n                                 / /   f o u r - d i g i t   y e a r s   i n s t e a d  [ 3 9 m  [ 2 2 m  [ 1 m   o f   s i x - d i g i t   y e a r s .   C r e d i t s :   @ Y a f f l e . \ n                                 s t r i n g i f y ( n e w   D a t e ( - 6 2 1 9 8 7 5 5 2 e 5 ) )   = =   ' \ " - 0 0 0 0 0 1 - 0 1 - 0 1 T 0 0 : 0 0 : 0 0 . 0 0 0 Z \ " '   & & \ n                                 / /   S a f a r i   < =   5 . 1 . 5   a n d   O p e r a   > =   1 0 . 5 3   i n c o r r e c t l y   s e r i a l i z e   m i l l i s e c o n d \ n                                 / /   v a l u e s   l e s s   t h a n   1 0 0 0 .   C r e d i t s :   @ Y a f f l e . \ n                                 s t r i n g i f y ( n e w   D a t e ( - 1 ) )   = =   ' \ " 1 9 6 9 - 1 2 - 3 1 T 2 3 : 5 9 : 5 9 . 9 9 9 Z \ " ' ; \ n                         }   c a t c h   ( e x c e p t i o n )   { \ n                             s t r i n g i f y S u p p o r t e d   =   f a l s e ; \ n                         } \ n                     } \ n                     i s S u p p o r t e d   =   s t r i n g i f y S u p p o r t e d ; \ n                 } \ n                 / /   T e s t   ` J S O N . p a r s e ` . \ n                 i f   ( n a m e   = =   \ " j s o n - p a r s e \ " )   { \ n                     v a r   p a r s e   =   e x p o r t s . p a r s e ; \ n                     i f   ( t y p e o f   p a r s e   = =   \ " f u n c t i o n \ " )   { \ n                         t r y   { \ n                             / /   F F   3 . 1 b 1 ,   b 2   w i l l   t h r o w   a n   e x c e p t i o n   i f   a   b a r e   l i t e r a l   i s   p r o v i d e d . \ n                             / /   C o n f o r m i n g   i m p l e m e n t a t i o n s   s h o u l d   a l s o   c o e r c e   t h e   i n i t i a l   a r g u m e n t   t o \ n                             / /   a   s t r i n g   p r i o r   t o   p a r s i n g . \ n                             i f   ( p a r s e ( \ " 0 \ " )   = = =   0   & &   ! p a r s e ( f a l s e ) )   { \ n                                 / /   S i m p l e   p a r s i n g   t e s t . \ n                                 v a l u e   =   p a r s e ( s e r i a l i z e d ) ; \ n                                 v a r   p a r s e S u p p o r t e d   =   v a l u e [ \ " a \ " ] . l e n g t h   = =   5   & &   v a l u e [ \ " a \ " ] [ 0 ]   = = =   1 ; \ n                                 i f   ( p a r s e S u p p o r t e d )   { \ n                                     t r y   { \ n                                         / /   S a f a r i   < =   5 . 1 . 2   a n d   F F   3 . 1 b 1   a l l o w   u n e s c a p e d   t a b s   i n   s t r i n g s . \ n                                         p a r s e S u p p o r t e d   =   ! p a r s e ( ' \ " \ \ t \ " ' ) ; \ n                                     }   c a t c h   ( e x c e p t i o n )   { } \ n                                     i f   ( p a r s e S u p p o r t e d )   { \ n                                         t r y   { \ n                                             / /   F F   4 . 0   a n d   4 . 0 . 1   a l l o w   l e a d i n g   ` + `   s i g n s   a n d   l e a d i n g \ n                                             / /   d e c i m a l   p o i n t s .   F F   4 . 0 ,   4 . 0 . 1 ,   a n d   I E   9 - 1 0   a l s o   a l l o w \ n                                             / /   c e r t a i n   o c t a l   l i t e r a l s . \ n                                             p a r s e S u p p o r t e d   =   p a r s e ( \ " 0 1 \ " )   ! = =   1 ; \ n                                         }   c a t c h   ( e x c e p t i o n )   { } \ n                                     } \ n                                     i f   ( p a r s e S u p p o r t e d )   { \ n                                         t r y   { \ n                                             / /   F F   4 . 0 ,   4 . 0 . 1 ,   a n d   R h i n o   1 . 7 R 3 - R 4   a l l o w   t r a i l i n g   d e c i m a l \ n                                             / /   p o i n t s .   T h e s e   e n v i r o n m e n t s ,   a l o n g   w i t h   F F   3 . 1 b 1   a n d   2 , \ n                                             / /   a l s o   a l l o w   t r a i l i n g   c o m m a s   i n   J S O N   o b j e c t s   a n d   a r r a y s . \ n                                             p a r s e S u p p o r t e d   =   p a r s e ( \ " 1 . \ " )   ! = =   1 ; \ n                                         }   c a t c h   ( e x c e p t i o n )   { } \ n                                     } \ n                                 } \ n                             } \ n                         }   c a t c h   ( e x c e p t i o n )   { \ n                             p a r s e S u p p o r t e d   =   f a l s e ; \ n                         } \ n                     } \ n                     i s S u p p o r t e d   =   p a r s e S u p p o r t e d ; \ n                 } \ n             } \ n             r e t u r n   h a s [ n a m e ]   =   ! ! i s S u p p o r t e d ; \ n         } \ n \ n         i f   ( ! h a s ( \ " j s o n \ " ) )   { \ n             / /   C o m m o n   ` [ [ C l a s s ] ] `   n a m e   a l i a s e s . \ n             v a r   f u n c t i o n C l a s s   =   \ " [ o b j e c t   F u n c t i o n ] \ " , \ n                     d a t e C l a s s   =   \ " [ o b j e c t   D a t e ] \ " , \ n                     n u m b e r C l a s s   =   \ " [ o b j e c t   N u m b e r ] \ " , \ n                     s t r i n g C l a s s   =   \ " [ o b j e c t   S t r i n g ] \ " , \ n                     a r r a y C l a s s   =   \ " [ o b j e c t   A r r a y ] \ " , \ n                     b o o l e a n C l a s s   =   \ " [ o b j e c t   B o o l e a n ] \ " ; \ n \ n             / /   D e t e c t   i n c o m p l e t e   s u p p o r t   f o r   a c c e s s i n g   s t r i n g   c h a r a c t e r s   b y   i n d e x . \ n             v a r   c h a r I n d e x B u g g y   =   h a s ( \ " b u g - s t r i n g - c h a r - i n d e x \ " ) ; \ n \ n             / /   D e f i n e   a d d i t i o n a l   u t i l i t y   m e t h o d s   i f   t h e   ` D a t e `   m e t h o d s   a r e   b u g g y . \ n             i f   ( ! i s E x t e n d e d )   { \ n                 v a r   f l o o r   =   M a t h . f l o o r ; \ n                 / /   A   m a p p i n g   b e t w e e n   t h e   m o n t h s   o f   t h e   y e a r   a n d   t h e   n u m b e r   o f   d a y s   b e t w e e n \ n                 / /   J a n u a r y   1 s t   a n d   t h e   f i r s t   o f   t h e   r e s p e c t i v e   m o n t h . \ n                 v a r   M o n t h s   =   [ 0 ,   3 1 ,   5 9 ,   9 0 ,   1 2 0 ,   1 5 1 ,   1 8 1 ,   2 1 2 ,   2 4 3 ,   2 7 3 ,   3 0 4 ,   3 3 4 ] ; \ n                 / /   I n t e r n a l :   C a l c u l a t e s   t h e   n u m b e r   o f   d a y s   b e t w e e n   t h e   U n i x   e p o c h   a n d   t h e \ n                 / /   f i r s t   d a y   o f   t h e   g i v e n   m o n t h . \ n                 v a r   g e t D a y   =   f u n c t i o n   ( y e a r ,   m o n t h )   { \ n                     r e t u r n   M o n t h s [ m o n t h ]   +   3 6 5   *   ( y e a r   -   1 9 7 0 )   +   f l o o r ( ( y e a r   -   1 9 6 9   +   ( m o n t h   =   + ( m o n t h   >   1 ) ) )   /   4 )   -   f l o o r ( ( y e a r   -   1 9 0 1   +   m o n t h )   /   1 0 0 )   +   f l o o r ( ( y e a r   -   1 6 0 1   +   m o n t h )   /   4 0 0 ) ; \ n                 } ; \ n             } \ n \ n             / /   I n t e r n a l :   D e t e r m i n e s   i f   a   p r o p e r t y   i s   a   d i r e c t   p r o p e r t y   o f   t h e   g i v e n \ n             / /   o b j e c t .   D e l e g a t e s   t o   t h e   n a t i v e   ` O b j e c t # h a s O w n P r o p e r t y `   m e t h o d . \ n             i f   ( ! ( i s P r o p e r t y   =   o b j e c t P r o t o . h a s O w n P r o p e r t y ) )   { \ n                 i s P r o p e r t y   =   f u n c t i o n   ( p r o p e r t y )   { \ n                     v a r   m e m b e r s   =   { } ,   c o n s t r u c t o r ; \ n                     i f   ( ( m e m b e r s . _ _ p r o t o _ _   =   n u l l ,   m e m b e r s . _ _ p r o t o _ _   =   { \ n                         / /   T h e   * p r o t o *   p r o p e r t y   c a n n o t   b e   s e t   m u l t i p l e   t i m e s   i n   r e c e n t \ n                         / /   v e r s i o n s   o f   F i r e f o x   a n d   S e a M o n k e y . \ n                         \ " t o S t r i n g \ " :   1 \ n                     } ,   m e m b e r s ) . t o S t r i n g   ! =   g e t C l a s s )   { \ n                         / /   S a f a r i   < =   2 . 0 . 3   d o e s n ' t   i m p l e m e n t   ` O b j e c t # h a s O w n P r o p e r t y ` ,   b u t \ n                         / /   s u p p o r t s   t h e   m u t a b l e   * p r o t o *   p r o p e r t y . \ n                         i s P r o p e r t y   =   f u n c t i o n   ( p r o p e r t y )   { \ n                             / /   C a p t u r e   a n d   b r e a k   t h e   o b j e c t ' s   p r o t o t y p e   c h a i n   ( s e e   s e c t i o n   8 . 6 . 2 \ n                             / /   o f   t h e   E S   5 . 1   s p e c ) .   T h e   p a r e n t h e s i z e d   e x p r e s s i o n   p r e v e n t s   a n \ n                             / /   u n s a f e   t r a n s f o r m a t i o n   b y   t h e   C l o s u r e   C o m p i l e r . \ n                             v a r   o r i g i n a l   =   t h i s . _ _ p r o t o _ _ ,   r e s u l t   =   p r o p e r t y   i n   ( t h i s . _ _ p r o t o _ _   =   n u l l ,   t h i s ) ; \ n                             / /   R e s t o r e   t h e   o r i g i n a l   p r o t o t y p e   c h a i n . \ n                             t h i s . _ _ p r o t o _ _   =   o r i g i n a l ; \ n                             r e t u r n   r e s u l t ; \ n                         } ; \ n                     }   e l s e   { \ n                         / /   C a p t u r e   a   r e f e r e n c e   t o   t h e   t o p - l e v e l   ` O b j e c t `   c o n s t r u c t o r . \ n                         c o n s t r u c t o r   =   m e m b e r s . c o n s t r u c t o r ; \ n                         / /   U s e   t h e   ` c o n s t r u c t o r `   p r o p e r t y   t o   s i m u l a t e   ` O b j e c t # h a s O w n P r o p e r t y `   i n \ n                         / /   o t h e r   e n v i r o n m e n t s . \ n                         i s P r o p e r t y   =   f u n c t i o n   ( p r o p e r t y )   { \ n                             v a r   p a r e n t   =   ( t h i s . c o n s t r u c t o r   | |   c o n s t r u c t o r ) . p r o t o t y p e ; \ n                             r e t u r n   p r o p e r t y   i n   t h i s   & &   ! ( p r o p e r t y   i n   p a r e n t   & &   t h i s [ p r o p e r t y ]   = = =   p a r e n t [ p r o p e r t y ] ) ; \ n                         } ; \ n                     } \ n                     m e m b e r s   =   n u l l ; \ n                     r e t u r n   i s P r o p e r t y . c a l l ( t h i s ,   p r o p e r t y ) ; \ n                 } ; \ n             } \ n \ n             / /   I n t e r n a l :   N o r m a l i z e s   t h e   ` f o r . . . i n `   i t e r a t i o n   a l g o r i t h m   a c r o s s \ n             / /   e n v i r o n m e n t s .   E a c h   e n u m e r a t e d   k e y   i s   y i e l d e d   t o   a   ` c a l l b a c k `   f u n c t i o n . \ n             f o r E a c h   =   f u n c t i o n   ( o b j e c t ,   c a l l b a c k )   { \ n                 v a r   s i z e   =   0 ,   P r o p e r t i e s ,   m e m b e r s ,   p r o p e r t y ; \ n \ n                 / /   T e s t s   f o r   b u g s   i n   t h e   c u r r e n t   e n v i r o n m e n t ' s   ` f o r . . . i n `   a l g o r i t h m .   T h e \ n                 / /   ` v a l u e O f `   p r o p e r t y   i n h e r i t s   t h e   n o n - e n u m e r a b l e   f l a g   f r o m \ n                 / /   ` O b j e c t . p r o t o t y p e `   i n   o l d e r   v e r s i o n s   o f   I E ,   N e t s c a p e ,   a n d   M o z i l l a . \ n                 ( P r o p e r t i e s   =   f u n c t i o n   ( )   { \ n                     t h i s . v a l u e O f   =   0 ; \ n                 } ) . p r o t o t y p e . v a l u e O f   =   0 ; \ n \ n                 / /   I t e r a t e   o v e r   a   n e w   i n s t a n c e   o f   t h e   ` P r o p e r t i e s `   c l a s s . \ n                 m e m b e r s   =   n e w   P r o p e r t i e s ( ) ; \ n                 f o r   ( p r o p e r t y   i n   m e m b e r s )   { \ n                     / /   I g n o r e   a l l   p r o p e r t i e s   i n h e r i t e d   f r o m   ` O b j e c t . p r o t o t y p e ` . \ n                     i f   ( i s P r o p e r t y . c a l l ( m e m b e r s ,   p r o p e r t y ) )   { \ n                         s i z e + + ; \ n                     } \ n                 } \ n                 P r o p e r t i e s   =   m e m b e r s   =   n u l l ; \ n \ n                 / /   N o r m a l i z e   t h e   i t e r a t i o n   a l g o r i t h m . \ n                 i f   ( ! s i z e )   { \ n                     / /   A   l i s t   o f   n o n - e n u m e r a b l e   p r o p e r t i e s   i n h e r i t e d   f r o m   ` O b j e c t . p r o t o t y p e ` . \ n                     m e m b e r s   =   [ \ " v a l u e O f \ " ,   \ " t o S t r i n g \ " ,   \ " t o L o c a l e S t r i n g \ " ,   \ " p r o p e r t y I s E n u m e r a b l e \ " ,   \ " i s P r o t o t y p e O f \ " ,   \ " h a s O w n P r o p e r t y \ " ,   \ " c o n s t r u c t o r \ " ] ; \ n                     / /   I E   < =   8 ,   M o z i l l a   1 . 0 ,   a n d   N e t s c a p e   6 . 2   i g n o r e   s h a d o w e d   n o n - e n u m e r a b l e \ n                     / /   p r o p e r t i e s . \ n                     f o r E a c h   =   f u n c t i o n   ( o b j e c t ,   c a l l b a c k )   { \ n                         v a r   i s F u n c t i o n   =   g e t C l a s s . c a l l ( o b j e c t )   = =   f u n c t i o n C l a s s ,   p r o p e r t y ,   l e n g t h ; \ n                         v a r   h a s P r o p e r t y   =   ! i s F u n c t i o n   & &   t y p e o f   o b j e c t . c o n s t r u c t o r   ! =   \ " f u n c t i o n \ "   & &   o b j e c t T y p e s [ t y p e o f   o b j e c t . h a s O w n P r o p e r t y ]   & &   o b j e c t . h a s O w n P r o p e r t y   | |   i s P r o p e r t y ; \ n                         f o r   ( p r o p e r t y   i n   o b j e c t )   { \ n                             / /   G e c k o   < =   1 . 0   e n u m e r a t e s   t h e   ` p r o t o t y p e `   p r o p e r t y   o f   f u n c t i o n s   u n d e r \ n                             / /   c e r t a i n   c o n d i t i o n s ;   I E   d o e s   n o t . \ n                             i f   ( ! ( i s F u n c t i o n   & &   p r o p e r t y   = =   \ " p r o t o t y p e \ " )   & &   h a s P r o p e r t y . c a l l ( o b j e c t ,   p r o p e r t y ) )   { \ n                                 c a l l b a c k ( p r o p e r t y ) ; \ n                             } \ n                         } \ n                         / /   M a n u a l l y   i n v o k e   t h e   c a l l b a c k   f o r   e a c h   n o n - e n u m e r a b l e   p r o p e r t y . \ n                         f o r   ( l e n g t h   =   m e m b e r s . l e n g t h ;   p r o p e r t y   =   m e m b e r s [ - - l e n g t h ] ;   h a s P r o p e r t y . c a l l ( o b j e c t ,   p r o p e r t y )   & &   c a l l b a c k ( p r o p e r t y ) ) ; \ n                     } ; \ n                 }   e l s e   i f   ( s i z e   = =   2 )   { \ n                     / /   S a f a r i   < =   2 . 0 . 4   e n u m e r a t e s   s h a d o w e d   p r o p e r t i e s   t w i c e . \ n                     f o r E a c h   =   f u n c t i o n   ( o b j e c t ,   c a l l b a c k )   { \ n                         / /   C r e a t e   a   s e t   o f   i t e r a t e d   p r o p e r t i e s . \ n                         v a r   m e m b e r s   =   { } ,   i s F u n c t i o n   =   g e t C l a s s . c a l l ( o b j e c t )   = =   f u n c t i o n C l a s s ,   p r o p e r t y ; \ n                         f o r   ( p r o p e r t y   i n   o b j e c t )   { \ n                             / /   S t o r e   e a c h   p r o p e r t y   n a m e   t o   p r e v e n t   d o u b l e   e n u m e r a t i o n .   T h e \ n                             / /   ` p r o t o t y p e `   p r o p e r t y   o f   f u n c t i o n s   i s   n o t   e n u m e r a t e d   d u e   t o   c r o s s - \ n                             / /   e n v i r o n m e n t   i n c o n s i s t e n c i e s . \ n                             i f   ( ! ( i s F u n c t i o n   & &   p r o p e r t y   = =   \ " p r o t o t y p e \ " )   & &   ! i s P r o p e r t y . c a l l ( m e m b e r s ,   p r o p e r t y )   & &   ( m e m b e r s [ p r o p e r t y ]   =   1 )   & &   i s P r o p e r t y . c a l l ( o b j e c t ,   p r o p e r t y ) )   { \ n                                 c a l l b a c k ( p r o p e r t y ) ; \ n                             } \ n                         } \ n                     } ; \ n                 }   e l s e   { \ n                     / /   N o   b u g s   d e t e c t e d ;   u s e   t h e   s t a n d a r d   ` f o r . . . i n `   a l g o r i t h m . \ n                     f o r E a c h   =   f u n c t i o n   ( o b j e c t ,   c a l l b a c k )   { \ n                         v a r   i s F u n c t i o n   =   g e t C l a s s . c a l l ( o b j e c t )   = =   f u n c t i o n C l a s s ,   p r o p e r t y ,   i s C o n s t r u c t o r ; \ n                         f o r   ( p r o p e r t y   i n   o b j e c t )   { \ n                             i f   ( ! ( i s F u n c t i o n   & &   p r o p e r t y   = =   \ " p r o t o t y p e \ " )   & &   i s P r o p e r t y . c a l l ( o b j e c t ,   p r o p e r t y )   & &   ! ( i s C o n s t r u c t o r   =   p r o p e r t y   = = =   \ " c o n s t r u c t o r \ " ) )   { \ n                                 c a l l b a c k ( p r o p e r t y ) ; \ n                             } \ n                         } \ n                         / /   M a n u a l l y   i n v o k e   t h e   c a l l b a c k   f o r   t h e   ` c o n s t r u c t o r `   p r o p e r t y   d u e   t o \ n                         / /   c r o s s - e n v i r o n m e n t   i n c o n s i s t e n c i e s . \ n                         i f   ( i s C o n s t r u c t o r   | |   i s P r o p e r t y . c a l l ( o b j e c t ,   ( p r o p e r t y   =   \ " c o n s t r u c t o r \ " ) ) )   { \ n                             c a l l b a c k ( p r o p e r t y ) ; \ n                         } \ n                     } ; \ n                 } \ n                 r e t u r n   f o r E a c h ( o b j e c t ,   c a l l b a c k ) ; \ n             } ; \ n \ n             / /   P u b l i c :   S e r i a l i z e s   a   J a v a S c r i p t   ` v a l u e `   a s   a   J S O N   s t r i n g .   T h e   o p t i o n a l \ n             / /   ` f i l t e r `   a r g u m e n t   m a y   s p e c i f y   e i t h e r   a   f u n c t i o n   t h a t   a l t e r s   h o w   o b j e c t   a n d \ n             / /   a r r a y   m e m b e r s   a r e   s e r i a l i z e d ,   o r   a n   a r r a y   o f   s t r i n g s   a n d   n u m b e r s   t h a t \ n             / /   i n d i c a t e s   w h i c h   p r o p e r t i e s   s h o u l d   b e   s e r i a l i z e d .   T h e   o p t i o n a l   ` w i d t h ` \ n             / /   a r g u m e n t   m a y   b e   e i t h e r   a   s t r i n g   o r   n u m b e r   t h a t   s p e c i f i e s   t h e   i n d e n t a t i o n \ n             / /   l e v e l   o f   t h e   o u t p u t . \ n             i f   ( ! h a s ( \ " j s o n - s t r i n g i f y \ " ) )   { \ n                 / /   I n t e r n a l :   A   m a p   o f   c o n t r o l   c h a r a c t e r s   a n d   t h e i r   e s c a p e d   e q u i v a l e n t s . \ n                 v a r   E s c a p e s   =   { \ n                     9 2 :   \ " \ \ \ \ \ \ \ \ \ " , \ n                     3 4 :   ' \ \ \ \ \ " ' , \ n                     8 :   \ " \ \ \ \ b \ " , \ n                     1 2 :   \ " \ \ \ \ f \ " , \ n                     1 0 :   \ " \ \ \ \ n \ " , \ n                     1 3 :   \ " \ \ \ \ r \ " , \ n                     9 :   \ " \ \ \ \ t \ " \ n                 } ; \ n \ n                 / /   I n t e r n a l :   C o n v e r t s   ` v a l u e `   i n t o   a   z e r o - p a d d e d   s t r i n g   s u c h   t h a t   i t s \ n                 / /   l e n g t h   i s   a t   l e a s t   e q u a l   t o   ` w i d t h ` .   T h e   ` w i d t h `    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   b e   < =   6 . \ n                 v a r   l e a d i n g Z e r o e s   =   \ " 0 0 0 0 0 0 \ " ; \ n                 v a r   t o P a d d e d S t r i n g   =   f u n c t i o n   ( w i d t h ,   v a l u e )   { \ n                     / /   T h e   ` | |   0 `   e x p r e s s i o n   i s   n e c e s s a r y   t o   w o r k   a r o u n d   a   b u g   i n \ n                     / /   O p e r a   < =   7 . 5 4 u 2   w h e r e   ` 0   = =   - 0 ` ,   b u t   ` S t r i n g ( - 0 )   ! = =   \ " 0 \ " ` . \ n                     r e t u r n   ( l e a d i n g Z e r o e s   +   ( v a l u e   | |   0 ) ) . s l i c e ( - w i d t h ) ; \ n                 } ; \ n \ n                 / /   I n t e r n a l :   D o u b l e - q u o t e s   a   s t r i n g   ` v a l u e ` ,   r e p l a c i n g   a l l   A S C I I   c o n t r o l \ n                 / /   c h a r a c t e r s   ( c h a r a c t e r s   w i t h   c o d e   u n i t   v a l u e s   b e t w e e n   0   a n d   3 1 )   w i t h \ n                 / /   t h e i r   e s c a p e d   e q u i v a l e n t s .   T h i s   i s   a n   i m p l e m e n t a t i o n   o f   t h e \ n                 / /   ` Q u o t e ( v a l u e ) `   o p e r a t i o n   d e f i n e d   i n   E S   5 . 1   s e c t i o n   1 5 . 1 2 . 3 . \ n                 v a r   u n i c o d e P r e f i x   =   \ " \ \ \ \ u 0 0 \ " ; \ n                 v a r   q u o t e   =   f u n c t i o n   ( v a l u e )   { \ n                     v a r   r e s u l t   =   ' \ " ' ,   i n d e x   =   0 ,   l e n g t h   =   v a l u e . l e n g t h ,   u s e C h a r I n d e x   =   ! c h a r I n d e x B u g g y   | |   l e n g t h   >   1 0 ; \ n                     v a r   s y m b o l s   =   u s e C h a r I n d e x   & &   ( c h a r I n d e x B u g g y   ?   v a l u e . s p l i t ( \ " \ " )   :   v a l u e ) ; \ n                     f o r   ( ;   i n d e x   <   l e n g t h ;   i n d e x + + )   { \ n                         v a r   c h a r C o d e   =   v a l u e . c h a r C o d e A t ( i n d e x ) ; \ n                         / /   I f   t h e   c h a r a c t e r   i s   a   c o n t r o l   c h a r a c t e r ,   a p p e n d   i t s   U n i c o d e   o r \ n                         / /   s h o r t h a n d   e s c a p e   s e q u e n c e ;   o t h e r w i s e ,   a p p e n d   t h e   c h a r a c t e r   a s - i s . \ n                         s w i t c h   ( c h a r C o d e )   { \ n                             c a s e   8 :   c a s e   9 :   c a s e   1 0 :   c a s e   1 2 :   c a s e   1 3 :   c a s e   3 4 :   c a s e   9 2 : \ n                                 r e s u l t   + =   E s c a p e s [ c h a r C o d e ] ; \ n                                 b r e a k ; \ n                             d e f a u l t : \ n                                 i f   ( c h a r C o d e   <   3 2 )   { \ n                                     r e s u l t   + =   u n i c o d e P r e f i x   +   t o P a d d e d S t r i n g ( 2 ,   c h a r C o d e . t o S t r i n g ( 1 6 ) ) ; \ n                                     b r e a k ; \ n                                 } \ n                                 r e s u l t   + =   u s e C h a r I n d e x   ?   s y m b o l s [ i n d e x ]   :   v a l u e . c h a r A t ( i n d e x ) ; \ n                         } \ n                     } \ n                     r e t u r n   r e s u l t   +   ' \ " ' ; \ n                 } ; \ n \ n                 / /   I n t e r n a l :   R e c u r s i v e l y   s e r i a l i z e s   a n   o b j e c t .   I m p l e m e n t s   t h e \ n                 / /   ` S t r ( k e y ,   h o l d e r ) ` ,   ` J O ( v a l u e ) ` ,   a n d   ` J A ( v a l u e ) `   o p e r a t i o n s . \ n                 v a r   s e r i a l i z e   =   f u n c t i o n   ( p r o p e r t y ,   o b j e c t ,   c a l l b a c k ,   p r o p e r t i e s ,   w h i t e s p a c e ,   i n d e n t a t i o n ,   s t a c k )   { \ n                     v a r   v a l u e ,   c l a s s N a m e ,   y e a r ,   m o n t h ,   d a t e ,   t i m e ,   h o u r s ,   m i n u t e s ,   s e c o n d s ,   m i l l i s e c o n d s ,   r e s u l t s ,   e l e m e n t ,   i n d e x ,   l e n g t h ,   p r e f i x ,   r e s u l t ; \ n                     t r y   { \ n                         / /   N e c e s s a r y   f o r   h o s t   o b j e c t   s u p p o r t . \ n                         v a l u e   =   o b j e c t [ p r o p e r t y ] ; \ n                     }   c a t c h   ( e x c e p t i o n )   { } \ n                     i f   ( t y p e o f   v a l u e   = =   \ " o b j e c t \ "   & &   v a l u e )   { \ n                         c l a s s N a m e   =   g e t C l a s s . c a l l ( v a l u e ) ; \ n                         i f   ( c l a s s N a m e   = =   d a t e C l a s s   & &   ! i s P r o p e r t y . c a l l ( v a l u e ,   \ " t o J S O N \ " ) )   { \ n                             i f   ( v a l u e   >   - 1   /   0   & &   v a l u e   <   1   /   0 )   { \ n                                 / /   D a t e s   a r e   s e r i a l i z e d   a c c o r d i n g   t o   t h e   ` D a t e # t o J S O N `   m e t h o d \ n                                 / /   s p e c i f i e d   i n   E S   5 . 1   s e c t i o n   1 5 . 9 . 5 . 4 4 .   S e e   s e c t i o n   1 5 . 9 . 1 . 1 5 \ n                                 / /   f o r   t h e   I S O   8 6 0 1   d a t e   t i m e   s t r i n g   f o r m a t . \ n                                 i f   ( g e t D a y )   { \ n                                     / /   M a n u a l l y   c o m p u t e   t h e   y e a r ,   m o n t h ,   d a t e ,   h o u r s ,   m i n u t e s , \ n                                     / /   s e c o n d s ,   a n d   m i l l i s e c o n d s   i f   t h e   ` g e t U T C * `   m e t h o d s   a r e \ n                                     / /   b u g g y .   A d a p t e d   f r o m   @ Y a f f l e ' s   ` d a t e - s h i m `   p r o j e c t . \ n                                     d a t e   =   f l o o r ( v a l u e   /   8 6 4 e 5 ) ; \ n                                     f o r   ( y e a r   =   f l o o r ( d a t e   /   3 6 5 . 2 4 2 5 )   +   1 9 7 0   -   1 ;   g e t D a y ( y e a r   +   1 ,   0 )   < =   d a t e ;   y e a r + + ) ; \ n                                     f o r   ( m o n t h   =   f l o o r ( ( d a t e   -   g e t D a y ( y e a r ,   0 ) )   /   3 0 . 4 2 ) ;   g e t D a y ( y e a r ,   m o n t h   +   1 )   < =   d a t e ;   m o n t h + + ) ; \ n                                     d a t e   =   1   +   d a t e   -   g e t D a y ( y e a r ,   m o n t h ) ; \ n                                     / /   T h e   ` t i m e `   v a l u e   s p e c i f i e s   t h e   t i m e   w i t h i n   t h e   d a y   ( s e e   E S \ n                                     / /   5 . 1   s e c t i o n   1 5 . 9 . 1 . 2 ) .   T h e   f o r m u l a   ` ( A   %   B   +   B )   %   B `   i s   u s e d \ n                                     / /   t o   c o m p u t e   ` A   m o d u l o   B ` ,   a s   t h e   ` % `   o p e r a t o r   d o e s   n o t \ n                                     / /   c o r r e s p o n d   t o   t h e   ` m o d u l o `   o p e r a t i o n   f o r   n e g a t i v e   n u m b e r s . \ n                                     t i m e   =   ( v a l u e   %   8 6 4 e 5   +   8 6 4 e 5 )   %   8 6 4 e 5 ; \ n                                     / /   T h e   h o u r s ,   m i n u t e s ,   s e c o n d s ,   a n d   m i l l i s e c o n d s   a r e   o b t a i n e d   b y \ n                                     / /   d e c o m p o s i n g   t h e   t i m e   w i t h i n   t h e   d a y .   S e e   s e c t i o n   1 5 . 9 . 1 . 1 0 . \ n                                     h o u r s   =   f l o o r ( t i m e   /   3 6 e 5 )   %   2 4 ; \ n                                     m i n u t e s   =   f l o o r ( t i m e   /   6 e 4 )   %   6 0 ; \ n                                     s e c o n d s   =   f l o o r ( t i m e   /   1 e 3 )   %   6 0 ; \ n                                     m i l l i s e c o n d s   =   t i m e   %   1 e 3 ; \ n                                 }   e l s e   { \ n                                     y e a r   =   v a l u e . g e t U T C F u l l Y e a r ( ) ; \ n                                     m o n t h   =   v a l u e . g e t U T C M o n t h ( ) ; \ n                                     d a t e   =   v a l u e . g e t U T C D a t e ( ) ; \ n                                     h o u r s   =   v a l u e . g e t U T C H o u r s ( ) ; \ n                                     m i n u t e s   =   v a l u e . g e t U T C M i n u t e s ( ) ; \ n                                     s e c o n d s   =   v a l u e . g e t U T C S e c o n d s ( ) ; \ n                                     m i l l i s e c o n d s   =   v a l u e . g e t U T C M i l l i s e c o n d s ( ) ; \ n                                 } \ n                                 / /   S e r i a l i z e   e x t e n d e d   y e a r s   c o r r e c t l y . \ n                                 v a l u e   =   ( y e a r   < =   0   | |   y e a r   > =   1 e 4   ?   ( y e a r   <   0   ?   \ " - \ "   :   \ " + \ " )   +   t o P a d d e d S t r i n g ( 6 ,   y e a r   <   0   ?   - y e a r   :   y e a r )   :   t o P a d d e d S t r i n g ( 4 ,   y e a r ) )   + \ n                                     \ " - \ "   +   t o P a d d e d S t r i n g ( 2 ,   m o n t h   +   1 )   +   \ " - \ "   +   t o P a d d e d S t r i n g ( 2 ,   d a t e )   + \ n                                     / /   M o n t h s ,   d a t e s ,   h o u r s ,   m i n u t e s ,   a n d   s e c o n d s   s h o u l d   h a v e   t w o \ n                                     / /   d i g i t s ;   m i l l i s e c o n d s   s h o u l d   h a v e   t h r e e . \ n                                     \ " T \ "   +   t o P a d d e d S t r i n g ( 2 ,   h o u r s )   +   \ " : \ "   +   t o P a d d e d S t r i n g ( 2 ,   m i n u t e s )   +   \ " : \ "   +   t o P a d d e d S t r i n g ( 2 ,   s e c o n d s )   + \ n                                     / /   M i l l i s e c o n d s   a r e   o p t i o n a l   i n   E S   5 . 0 ,   b u t    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   i n   5 . 1 . \ n                                     \ " . \ "   +   t o P a d d e d S t r i n g ( 3 ,   m i l l i s e c o n d s )   +   \ " Z \ " ; \ n                             }   e l s e   { \ n                                 v a l u e   =   n u l l ; \ n                             } \ n                         }   e l s e   i f   ( t y p e o f   v a l u e . t o J S O N   = =   \ " f u n c t i o n \ "   & &   ( ( c l a s s N a m e   ! =   n u m b e r C l a s s   & &   c l a s s N a m e   ! =   s t r i n g C l a s s   & &   c l a s s N a m e   ! =   a r r a y C l a s s )   | |   i s P r o p e r t y . c a l l ( v a l u e ,   \ " t o J S O N \ " ) ) )   { \ n                             / /   P r o t o t y p e   < =   1 . 6 . 1   a d d s   n o n - s t a n d a r d   ` t o J S O N `   m e t h o d s   t o   t h e \ n                             / /   ` N u m b e r ` ,   ` S t r i n g ` ,   ` D a t e ` ,   a n d   ` A r r a y `   p r o t o t y p e s .   J S O N   3 \ n                             / /   i g n o r e s   a l l   ` t o J S O N `   m e t h o d s   o n   t h e s e   o b j e c t s   u n l e s s   t h e y   a r e \ n                             / /   d e f i n e d   d i r e c t l y   o n   a n   i n s t a n c e . \ n                             v a l u e   =   v a l u e . t o J S O N ( p r o p e r t y ) ; \ n                         } \ n                     } \ n                     i f   ( c a l l b a c k )   { \ n                         / /   I f   a   r e p l a c e m e n t   f u n c t i o n   w a s   p r o v i d e d ,   c a l l   i t   t o   o b t a i n   t h e   v a l u e \ n                         / /   f o r   s e r i a l i z a t i o n . \ n                         v a l u e   =   c a l l b a c k . c a l l ( o b j e c t ,   p r o p e r t y ,   v a l u e ) ; \ n                     } \ n                     i f   ( v a l u e   = = =   n u l l )   { \ n                         r e t u r n   \ " n u l l \ " ; \ n                     } \ n                     c l a s s N a m e   =   g e t C l a s s . c a l l ( v a l u e ) ; \ n                     i f   ( c l a s s N a m e   = =   b o o l e a n C l a s s )   { \ n                         / /   B o o l e a n s   a r e   r e p r e s e n t e d   l i t e r a l l y . \ n                         r e t u r n   \ " \ "   +   v a l u e ; \ n                     }   e l s e   i f   ( c l a s s N a m e   = =   n u m b e r C l a s s )   { \ n                         / /   J S O N   n u m b e r s    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   b e   f i n i t e .   ` I n f i n i t y `   a n d   ` N a N `   a r e   s e r i a l i z e d   a s \ n                         / /   ` \ " n u l l \ " ` . \ n                         r e t u r n   v a l u e   >   - 1   /   0   & &   v a l u e   <   1   /   0   ?   \ " \ "   +   v a l u e   :   \ " n u l l \ " ; \ n                     }   e l s e   i f   ( c l a s s N a m e   = =   s t r i n g C l a s s )   { \ n                         / /   S t r i n g s   a r e   d o u b l e - q u o t e d   a n d   e s c a p e d . \ n                         r e t u r n   q u o t e ( \ " \ "   +   v a l u e ) ; \ n                     } \ n                     / /   R e c u r s i v e l y   s e r i a l i z e   o b j e c t s   a n d   a r r a y s . \ n                     i f   ( t y p e o f   v a l u e   = =   \ " o b j e c t \ " )   { \ n                         / /   C h e c k   f o r   c y c l i c   s t r u c t u r e s .   T h i s   i s   a   l i n e a r   s e a r c h ;   p e r f o r m a n c e \ n                         / /   i s   i n v e r s e l y   p r o p o r t i o n a l   t o   t h e   n u m b e r   o f   u n i q u e   n e s t e d   o b j e c t s . \ n                         f o r   ( l e n g t h   =   s t a c k . l e n g t h ;   l e n g t h - - ; )   { \ n                             i f   ( s t a c k [ l e n g t h ]   = = =   v a l u e )   { \ n                                 / /   C y c l i c   s t r u c t u r e s   c a n n o t   b e   s e r i a l i z e d   b y   ` J S O N . s t r i n g i f y ` . \ n                                 t h r o w   T y p e E r r o r ( ) ; \ n                             } \ n                         } \ n                         / /   A d d   t h e   o b j e c t   t o   t h e   s t a c k   o f   t r a v e r s e d   o b j e c t s . \ n                         s t a c k . p u s h ( v a l u e ) ; \ n                         r e s u l t s   =   [ ] ; \ n                         / /   S a v e   t h e   c u r r e n t   i n d e n t a t i o n   l e v e l   a n d   i n d e n t   o n e   a d d i t i o n a l   l e v e l . \ n                         p r e f i x   =   i n d e n t a t i o n ; \ n                         i n d e n t a t i o n   + =   w h i t e s p a c e ; \ n                         i f   ( c l a s s N a m e   = =   a r r a y C l a s s )   { \ n                             / /   R e c u r s i v e l y   s e r i a l i z e   a r r a y   e l e m e n t s . \ n                             f o r   ( i n d e x   =   0 ,   l e n g t h   =   v a l u e . l e n g t h ;   i n d e x   <   l e n g t h ;   i n d e x + + )   { \ n                                 e l e m e n t   =   s e r i a l i z e ( i n d e x ,   v a l u e ,   c a l l b a c k ,   p r o p e r t i e s ,   w h i t e s p a c e ,   i n d e n t a t i o n ,   s t a c k ) ; \ n                                 r e s u l t s . p u s h ( e l e m e n t   = = =   u n d e f   ?   \ " n u l l \ "   :   e l e m e n t ) ; \ n                             } \ n                             r e s u l t   =   r e s u l t s . l e n g t h   ?   ( w h i t e s p a c e   ?   \ " [ \ \ n \ "   +   i n d e n t a t i o n   +   r e s u l t s . j o i n ( \ " , \ \ n \ "   +   i n d e n t a t i o n )   +   \ " \ \ n \ "   +   p r e f i x   +   \ " ] \ "   :   ( \ " [ \ "   +   r e s u l t s . j o i n ( \ " , \ " )   +   \ " ] \ " ) )   :   \ " [ ] \ " ; \ n                         }   e l s e   { \ n                             / /   R e c u r s i v e l y   s e r i a l i z e   o b j e c t   m e m b e r s .   M e m b e r s   a r e   s e l e c t e d   f r o m \ n                             / /   e i t h e r   a   u s e r - s p e c i f i e d   l i s t   o f   p r o p e r t y   n a m e s ,   o r   t h e   o b j e c t \ n                             / /   i t s e l f . \ n                             f o r E a c h ( p r o p e r t i e s   | |   v a l u e ,   f u n c t i o n   ( p r o p e r t y )   { \ n                                 v a r   e l e m e n t   =   s e r i a l i z e ( p r o p e r t y ,   v a l u e ,   c a l l b a c k ,   p r o p e r t i e s ,   w h i t e s p a c e ,   i n d e n t a t i o n ,   s t a c k ) ; \ n                                 i f   ( e l e m e n t   ! = =   u n d e f )   { \ n                                     / /   A c c o r d i n g   t o   E S   5 . 1   s e c t i o n   1 5 . 1 2 . 3 :   \ " I f   ` g a p `   { w h i t e s p a c e } \ n                                     / /   i s   n o t   t h e   e m p t y   s t r i n g ,   l e t   ` m e m b e r `   { q u o t e ( p r o p e r t y )   +   \ " : \ " } \ n                                     / /   b e   t h e   c o n c a t e n a t i o n   o f   ` m e m b e r `   a n d   t h e   ` s p a c e `   c h a r a c t e r . \ " \ n                                     / /   T h e   \ " ` s p a c e `   c h a r a c t e r \ "   r e f e r s   t o   t h e   l i t e r a l   s p a c e \ n                                     / /   c h a r a c t e r ,   n o t   t h e   ` s p a c e `   { w i d t h }   a r g u m e n t   p r o v i d e d   t o \ n                                     / /   ` J S O N . s t r i n g i f y ` . \ n                                     r e s u l t s . p u s h ( q u o t e ( p r o p e r t y )   +   \ " : \ "   +   ( w h i t e s p a c e   ?   \ "   \ "   :   \ " \ " )   +   e l e m e n t ) ; \ n                                 } \ n                             } ) ; \ n                             r e s u l t   =   r e s u l t s . l e n g t h   ?   ( w h i t e s p a c e   ?   \ " { \ \ n \ "   +   i n d e n t a t i o n   +   r e s u l t s . j o i n ( \ " , \ \ n \ "   +   i n d e n t a t i o n )   +   \ " \ \ n \ "   +   p r e f i x   +   \ " } \ "   :   ( \ " { \ "   +   r e s u l t s . j o i n ( \ " , \ " )   +   \ " } \ " ) )   :   \ " { } \ " ; \ n                         } \ n                         / /   R e m o v e   t h e   o b j e c t   f r o m   t h e   t r a v e r s e d   o b j e c t   s t a c k . \ n                         s t a c k . p o p ( ) ; \ n                         r e t u r n   r e s u l t ; \ n                     } \ n                 } ; \ n \ n                 / /   P u b l i c :   ` J S O N . s t r i n g i f y ` .   S e e   E S   5 . 1   s e c t i o n   1 5 . 1 2 . 3 . \ n                 e x p o r t s . s t r i n g i f y   =   f u n c t i o n   ( s o u r c e ,   f i l t e r ,   w i d t h )   { \ n                     v a r   w h i t e s p a c e ,   c a l l b a c k ,   p r o p e r t i e s ,   c l a s s N a m e ; \ n                     i f   ( o b j e c t T y p e s [ t y p e o f   f i l t e r ]   & &   f i l t e r )   { \ n                         i f   ( ( c l a s s N a m e   =   g e t C l a s s . c a l l ( f i l t e r ) )   = =   f u n c t i o n C l a s s )   { \ n                             c a l l b a c k   =   f i l t e r ; \ n                         }   e l s e   i f   ( c l a s s N a m e   = =   a r r a y C l a s s )   { \ n                             / /   C o n v e r t   t h e   p r o p e r t y   n a m e s   a r r a y   i n t o   a   m a k e s h i f t   s e t . \ n                             p r o p e r t i e s   =   { } ; \ n                             f o r   ( v a r   i n d e x   =   0 ,   l e n g t h   =   f i l t e r . l e n g t h ,   v a l u e ;   i n d e x   <   l e n g t h ;   v a l u e   =   f i l t e r [ i n d e x + + ] ,   ( ( c l a s s N a m e   =   g e t C l a s s . c a l l ( v a l u e ) ) ,   c l a s s N a m e   = =   s t r i n g C l a s s   | |   c l a s s N a m e   = =   n u m b e r C l a s s )   & &   ( p r o p e r t i e s [ v a l u e ]   =   1 ) ) ; \ n                         } \ n                     } \ n                     i f   ( w i d t h )   { \ n                         i f   ( ( c l a s s N a m e   =   g e t C l a s s . c a l l ( w i d t h ) )   = =   n u m b e r C l a s s )   { \ n                             / /   C o n v e r t   t h e   ` w i d t h `   t o   a n   i n t e g e r   a n d   c r e a t e   a   s t r i n g   c o n t a i n i n g \ n                             / /   ` w i d t h `   n u m b e r   o f   s p a c e   c h a r a c t e r s . \ n                             i f   ( ( w i d t h   - =   w i d t h   %   1 )   >   0 )   { \ n                                 f o r   ( w h i t e s p a c e   =   \ " \ " ,   w i d t h   >   1 0   & &   ( w i d t h   =   1 0 ) ;   w h i t e s p a c e . l e n g t h   <   w i d t h ;   w h i t e s p a c e   + =   \ "   \ " ) ; \ n                             } \ n                         }   e l s e   i f   ( c l a s s N a m e   = =   s t r i n g C l a s s )   { \ n                             w h i t e s p a c e   =   w i d t h . l e n g t h   < =   1 0   ?   w i d t h   :   w i d t h . s l i c e ( 0 ,   1 0 ) ; \ n                         } \ n                     } \ n                     / /   O p e r a   < =   7 . 5 4 u 2   d i s c a r d s   t h e   v a l u e s   a s s o c i a t e d   w i t h   e m p t y   s t r i n g   k e y s \ n                     / /   ( ` \ " \ " ` )   o n l y   i f   t h e y   a r e   u s e d   d i r e c t l y   w i t h i n   a n   o b j e c t   m e m b e r   l i s t \ n                     / /   ( e . g . ,   ` ! ( \ " \ "   i n   {   \ " \ " :   1 } ) ` ) . \ n                     r e t u r n   s e r i a l i z e ( \ " \ " ,   ( v a l u e   =   { } ,   v a l u e [ \ " \ " ]   =   s o u r c e ,   v a l u e ) ,   c a l l b a c k ,   p r o p e r t i e s ,   w h i t e s p a c e ,   \ " \ " ,   [ ] ) ; \ n                 } ; \ n             } \ n \ n             / /   P u b l i c :   P a r s e s   a   J S O N   s o u r c e   s t r i n g . \ n             i f   ( ! h a s ( \ " j s o n - p a r s e \ " ) )   { \ n                 v a r   f r o m C h a r C o d e   =   S t r i n g . f r o m C h a r C o d e ; \ n \ n                 / /   I n t e r n a l :   A   m a p   o f   e s c a p e d   c o n t r o l   c h a r a c t e r s   a n d   t h e i r   u n e s c a p e d \ n                 / /   e q u i v a l e n t s . \ n                 v a r   U n e s c a p e s   =   { \ n                     9 2 :   \ " \ \ \ \ \ " , \ n                     3 4 :   ' \ " ' , \ n                     4 7 :   \ " / \ " , \ n                     9 8 :   \ " \ \ b \ " , \ n                     1 1 6 :   \ " \ \ t \ " , \ n                     1 1 0 :   \ " \ \ n \ " , \ n                     1 0 2 :   \ " \ \ f \ " , \ n                     1 1 4 :   \ " \ \ r \ " \ n                 } ; \ n \ n                 / /   I n t e r n a l :   S t o r e s   t h e   p a r s e r   s t a t e . \ n                 v a r   I n d e x ,   S o u r c e ; \ n \ n                 / /   I n t e r n a l :   R e s e t s   t h e   p a r s e r   s t a t e   a n d   t h r o w s   a   ` S y n t a x E r r o r ` . \ n                 v a r   a b o r t   =   f u n c t i o n   ( )   { \ n                     I n d e x   =   S o u r c e   =   n u l l ; \ n                     t h r o w   S y n t a x E r r o r ( ) ; \ n                 } ; \ n \ n                 / /   I n t e r n a l :   R e t u r n s   t h e   n e x t   t o k e n ,   o r   ` \ " $ \ " `   i f   t h e   p a r s e r   h a s   r e a c h e d \ n                 / /   t h e   e n d   o f   t h e   s o u r c e   s t r i n g .   A   t o k e n   m a y   b e   a   s t r i n g ,   n u m b e r ,   ` n u l l ` \ n                 / /   l i t e r a l ,   o r   B o o l e a n   l i t e r a l . \ n                 v a r   l e x   =   f u n c t i o n   ( )   { \ n                     v a r   s o u r c e   =   S o u r c e ,   l e n g t h   =   s o u r c e . l e n g t h ,   v a l u e ,   b e g i n ,   p o s i t i o n ,   i s S i g n e d ,   c h a r C o d e ; \ n                     w h i l e   ( I n d e x   <   l e n g t h )   { \ n                         c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ; \ n                         s w i t c h   ( c h a r C o d e )   { \ n                             c a s e   9 :   c a s e   1 0 :   c a s e   1 3 :   c a s e   3 2 : \ n                                 / /   S k i p   w h i t e s p a c e   t o k e n s ,   i n c l u d i n g   t a b s ,   c a r r i a g e   r e t u r n s ,   l i n e \ n                                 / /   f e e d s ,   a n d   s p a c e   c h a r a c t e r s . \ n                                 I n d e x + + ; \ n                                 b r e a k ; \ n                             c a s e   1 2 3 :   c a s e   1 2 5 :   c a s e   9 1 :   c a s e   9 3 :   c a s e   5 8 :   c a s e   4 4 : \ n                                 / /   P a r s e   a   p u n c t u a t o r   t o k e n   ( ` { ` ,   ` } ` ,   ` [ ` ,   ` ] ` ,   ` : ` ,   o r   ` , ` )   a t \ n                                 / /   t h e   c u r r e n t   p o s i t i o n . \ n                                 v a l u e   =   c h a r I n d e x B u g g y   ?   s o u r c e . c h a r A t ( I n d e x )   :   s o u r c e [ I n d e x ] ; \ n                                 I n d e x + + ; \ n                                 r e t u r n   v a l u e ; \ n                             c a s e   3 4 : \ n                                 / /   ` \ " `   d e l i m i t s   a   J S O N   s t r i n g ;   a d v a n c e   t o   t h e   n e x t   c h a r a c t e r   a n d \ n                                 / /   b e g i n   p a r s i n g   t h e   s t r i n g .   S t r i n g   t o k e n s   a r e   p r e f i x e d   w i t h   t h e \ n                                 / /   s e n t i n e l   ` @ `   c h a r a c t e r   t o   d i s t i n g u i s h   t h e m   f r o m   p u n c t u a t o r s   a n d \ n                                 / /   e n d - o f - s t r i n g   t o k e n s . \ n                                 f o r   ( v a l u e   =   \ " @ \ " ,   I n d e x + + ;   I n d e x   <   l e n g t h ; )   { \ n                                     c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ; \ n                                     i f   ( c h a r C o d e   <   3 2 )   { \ n                                         / /   U n e s c a p e d   A S C I I   c o n t r o l   c h a r a c t e r s   ( t h o s e   w i t h   a   c o d e   u n i t \ n                                         / /   l e s s   t h a n   t h e   s p a c e   c h a r a c t e r )   a r e   n o t   p e r m i t t e d . \ n                                         a b o r t ( ) ; \ n                                     }   e l s e   i f   ( c h a r C o d e   = =   9 2 )   { \ n                                         / /   A   r e v e r s e   s o l i d u s   ( ` \ \ ` )   m a r k s   t h e   b e g i n n i n g   o f   a n   e s c a p e d \ n                                         / /   c o n t r o l   c h a r a c t e r   ( i n c l u d i n g   ` \ " ` ,   ` \ \ ` ,   a n d   ` / ` )   o r   U n i c o d e \ n                                         / /   e s c a p e   s e q u e n c e . \ n                                         c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( + + I n d e x ) ; \ n                                         s w i t c h   ( c h a r C o d e )   { \ n                                             c a s e   9 2 :   c a s e   3 4 :   c a s e   4 7 :   c a s e   9 8 :   c a s e   1 1 6 :   c a s e   1 1 0 :   c a s e   1 0 2 :   c a s e   1 1 4 : \ n                                                 / /   R e v i v e   e s c a p e d   c o n t r o l   c h a r a c t e r s . \ n                                                 v a l u e   + =   U n e s c a p e s [ c h a r C o d e ] ; \ n                                                 I n d e x + + ; \ n                                                 b r e a k ; \ n                                             c a s e   1 1 7 : \ n                                                 / /   ` \ \ u `   m a r k s   t h e   b e g i n n i n g   o f   a   U n i c o d e   e s c a p e   s e q u e n c e . \ n                                                 / /   A d v a n c e   t o   t h e   f i r s t   c h a r a c t e r   a n d   v a l i d a t e   t h e \ n                                                 / /   f o u r - d i g i t   c o d e   p o i n t . \ n                                                 b e g i n   =   + + I n d e x ; \ n                                                 f o r   ( p o s i t i o n   =   I n d e x   +   4 ;   I n d e x   <   p o s i t i o n ;   I n d e x + + )   { \ n                                                     c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ; \ n                                                     / /   A   v a l i d   s e q u e n c e   c o m p r i s e s   f o u r   h e x d i g i t s   ( c a s e - \ n                                                     / /   i n s e n s i t i v e )   t h a t   f o r m   a   s i n g l e   h e x a d e c i m a l   v a l u e . \ n                                                     i f   ( ! ( c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7   | |   c h a r C o d e   > =   9 7   & &   c h a r C o d e   < =   1 0 2   | |   c h a r C o d e   > =   6 5   & &   c h a r C o d e   < =   7 0 ) )   { \ n                                                         / /    [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   U n i c o d e   e s c a p e   s e q u e n c e . \ n                                                         a b o r t ( ) ; \ n                                                     } \ n                                                 } \ n                                                 / /   R e v i v e   t h e   e s c a p e d   c h a r a c t e r . \ n                                                 v a l u e   + =   f r o m C h a r C o d e ( \ " 0 x \ "   +   s o u r c e . s l i c e ( b e g i n ,   I n d e x ) ) ; \ n                                                 b r e a k ; \ n                                             d e f a u l t : \ n                                                 / /    [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   e s c a p e   s e q u e n c e . \ n                                                 a b o r t ( ) ; \ n                                         } \ n                                     }   e l s e   { \ n                                         i f   ( c h a r C o d e   = =   3 4 )   { \ n                                             / /   A n   u n e s c a p e d   d o u b l e - q u o t e   c h a r a c t e r   m a r k s   t h e   e n d   o f   t h e \ n                                             / /   s t r i n g . \ n                                             b r e a k ; \ n                                         } \ n                                         c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ; \ n                                         b e g i n   =   I n d e x ; \ n                                         / /   O p t i m i z e   f o r   t h e   c o m m o n   c a s e   w h e r e   a   s t r i n g   i s   v a l i d . \ n                                         w h i l e   ( c h a r C o d e   > =   3 2   & &   c h a r C o d e   ! =   9 2   & &   c h a r C o d e   ! =   3 4 )   { \ n                                             c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( + + I n d e x ) ; \ n                                         } \ n                                         / /   A p p e n d   t h e   s t r i n g   a s - i s . \ n                                         v a l u e   + =   s o u r c e . s l i c e ( b e g i n ,   I n d e x ) ; \ n                                     } \ n                                 } \ n                                 i f   ( s o u r c e . c h a r C o d e A t ( I n d e x )   = =   3 4 )   { \ n                                     / /   A d v a n c e   t o   t h e   n e x t   c h a r a c t e r   a n d   r e t u r n   t h e   r e v i v e d   s t r i n g . \ n                                     I n d e x + + ; \ n                                     r e t u r n   v a l u e ; \ n                                 } \ n                                 / /   U n t e r m i n a t e d   s t r i n g . \ n                                 a b o r t ( ) ; \ n                             d e f a u l t : \ n                                 / /   P a r s e   n u m b e r s   a n d   l i t e r a l s . \ n                                 b e g i n   =   I n d e x ; \ n                                 / /   A d v a n c e   p a s t   t h e   n e g a t i v e   s i g n ,   i f   o n e   i s   s p e c i f i e d . \ n                                 i f   ( c h a r C o d e   = =   4 5 )   { \ n                                     i s S i g n e d   =   t r u e ; \ n                                     c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( + + I n d e x ) ; \ n                                 } \ n                                 / /   P a r s e   a n   i n t e g e r   o r   f l o a t i n g - p o i n t   v a l u e . \ n                                 i f   ( c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7 )   { \ n                                     / /   L e a d i n g   z e r o e s   a r e   i n t e r p r e t e d   a s   o c t a l   l i t e r a l s . \ n                                     i f   ( c h a r C o d e   = =   4 8   & &   ( ( c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x   +   1 ) ) ,   c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7 ) )   { \ n                                         / /   I l l e g a l   o c t a l   l i t e r a l . \ n                                         a b o r t ( ) ; \ n                                     } \ n                                     i s S i g n e d   =   f a l s e ; \ n                                     / /   P a r s e   t h e   i n t e g e r   c o m p o n e n t . \ n                                     f o r   ( ;   I n d e x   <   l e n g t h   & &   ( ( c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ) ,   c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7 ) ;   I n d e x + + ) ; \ n                                     / /   F l o a t s   c a n n o t   c o n t a i n   a   l e a d i n g   d e c i m a l   p o i n t ;   h o w e v e r ,   t h i s \ n                                     / /   c a s e   i s   a l r e a d y   a c c o u n t e d   f o r   b y   t h e   p a r s e r . \ n                                     i f   ( s o u r c e . c h a r C o d e A t ( I n d e x )   = =   4 6 )   { \ n                                         p o s i t i o n   =   + + I n d e x ; \ n                                         / /   P a r s e   t h e   d e c i m a l   c o m p o n e n t . \ n                                         f o r   ( ;   p o s i t i o n   <   l e n g t h   & &   ( ( c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( p o s i t i o n ) ) ,   c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7 ) ;   p o s i t i o n + + ) ; \ n                                         i f   ( p o s i t i o n   = =   I n d e x )   { \ n                                             / /   I l l e g a l   t r a i l i n g   d e c i m a l . \ n                                             a b o r t ( ) ; \ n                                         } \ n                                         I n d e x   =   p o s i t i o n ; \ n                                     } \ n                                     / /   P a r s e   e x p o n e n t s .   T h e   ` e `   d e n o t i n g   t h e   e x p o n e n t   i s \ n                                     / /   c a s e - i n s e n s i t i v e . \ n                                     c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( I n d e x ) ; \ n                                     i f   ( c h a r C o d e   = =   1 0 1   | |   c h a r C o d e   = =   6 9 )   { \ n                                         c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( + + I n d e x ) ; \ n                                         / /   S k i p   p a s t   t h e   s i g n   f o l l o w i n g   t h e   e x p o n e n t ,   i f   o n e   i s \ n                                         / /   s p e c i f i e d . \ n                                         i f   ( c h a r C o d e   = =   4 3   | |   c h a r C o d e   = =   4 5 )   { \ n                                             I n d e x + + ; \ n                                         } \ n                                         / /   P a r s e   t h e   e x p o n e n t i a l   c o m p o n e n t . \ n                                         f o r   ( p o s i t i o n   =   I n d e x ;   p o s i t i o n   <   l e n g t h   & &   ( ( c h a r C o d e   =   s o u r c e . c h a r C o d e A t ( p o s i t i o n ) ) ,   c h a r C o d e   > =   4 8   & &   c h a r C o d e   < =   5 7 ) ;   p o s i t i o n + + ) ; \ n                                         i f   ( p o s i t i o n   = =   I n d e x )   { \ n                                             / /   I l l e g a l   e m p t y   e x p o n e n t . \ n                                             a b o r t ( ) ; \ n                                         } \ n                                         I n d e x   =   p o s i t i o n ; \ n                                     } \ n                                     / /   C o e r c e   t h e   p a r s e d   v a l u e   t o   a   J a v a S c r i p t   n u m b e r . \ n                                     r e t u r n   + s o u r c e . s l i c e ( b e g i n ,   I n d e x ) ; \ n                                 } \ n                                 / /   A   n e g a t i v e   s i g n   m a y   o n l y   p r e c e d e   n u m b e r s . \ n                                 i f   ( i s S i g n e d )   { \ n                                     a b o r t ( ) ; \ n                                 } \ n                                 / /   ` t r u e ` ,   ` f a l s e ` ,   a n d   ` n u l l `   l i t e r a l s . \ n                                 i f   ( s o u r c e . s l i c e ( I n d e x ,   I n d e x   +   4 )   = =   \ " t r u e \ " )   { \ n                                     I n d e x   + =   4 ; \ n                                     r e t u r n   t r u e ; \ n                                 }   e l s e   i f   ( s o u r c e . s l i c e ( I n d e x ,   I n d e x   +   5 )   = =   \ " f a l s e \ " )   { \ n                                     I n d e x   + =   5 ; \ n                                     r e t u r n   f a l s e ; \ n                                 }   e l s e   i f   ( s o u r c e . s l i c e ( I n d e x ,   I n d e x   +   4 )   = =   \ " n u l l \ " )   { \ n                                     I n d e x   + =   4 ; \ n                                     r e t u r n   n u l l ; \ n                                 } \ n                                 / /   U n r e c o g n i z e d   t o k e n . \ n                                 a b o r t ( ) ; \ n                         } \ n                     } \ n                     / /   R e t u r n   t h e   s e n t i n e l   ` $ `   c h a r a c t e r   i f   t h e   p a r s e r   h a s   r e a c h e d   t h e   e n d \ n                     / /   o f   t h e   s o u r c e   s t r i n g . \ n                     r e t u r n   \ " $ \ " ; \ n                 } ; \ n \ n                 / /   I n t e r n a l :   P a r s e s   a   J S O N   ` v a l u e `   t o k e n . \ n                 v a r   g e t   =   f u n c t i o n   ( v a l u e )   { \ n                     v a r   r e s u l t s ,   h a s M e m b e r s ; \ n                     i f   ( v a l u e   = =   \ " $ \ " )   { \ n                         / /    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   e n d   o f   i n p u t . \ n                         a b o r t ( ) ; \ n                     } \ n                     i f   ( t y p e o f   v a l u e   = =   \ " s t r i n g \ " )   { \ n                         i f   ( ( c h a r I n d e x B u g g y   ?   v a l u e . c h a r A t ( 0 )   :   v a l u e [ 0 ] )   = =   \ " @ \ " )   { \ n                             / /   R e m o v e   t h e   s e n t i n e l   ` @ `   c h a r a c t e r . \ n                             r e t u r n   v a l u e . s l i c e ( 1 ) ; \ n                         } \ n                         / /   P a r s e   o b j e c t   a n d   a r r a y   l i t e r a l s . \ n                         i f   ( v a l u e   = =   \ " [ \ " )   { \ n                             / /   P a r s e s   a   J S O N   a r r a y ,   r e t u r n i n g   a   n e w   J a v a S c r i p t   a r r a y . \ n                             r e s u l t s   =   [ ] ; \ n                             f o r   ( ; ;   h a s M e m b e r s   | |   ( h a s M e m b e r s   =   t r u e ) )   { \ n                                 v a l u e   =   l e x ( ) ; \ n                                 / /   A   c l o s i n g   s q u a r e   b r a c k e t   m a r k s   t h e   e n d   o f   t h e   a r r a y   l i t e r a l . \ n                                 i f   ( v a l u e   = =   \ " ] \ " )   { \ n                                     b r e a k ; \ n                                 } \ n                                 / /   I f   t h e   a r r a y   l i t e r a l   c o n t a i n s   e l e m e n t s ,   t h e   c u r r e n t   t o k e n \ n                                 / /   s h o u l d   b e   a   c o m m a   s e p a r a t i n g   t h e   p r e v i o u s   e l e m e n t   f r o m   t h e \ n                                 / /   n e x t . \ n                                 i f   ( h a s M e m b e r s )   { \ n                                     i f   ( v a l u e   = =   \ " , \ " )   { \ n                                         v a l u e   =   l e x ( ) ; \ n                                         i f   ( v a l u e   = =   \ " ] \ " )   { \ n                                             / /    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   t r a i l i n g   ` , `   i n   a r r a y   l i t e r a l . \ n                                             a b o r t ( ) ; \ n                                         } \ n                                     }   e l s e   { \ n                                         / /   A   ` , `    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   s e p a r a t e   e a c h   a r r a y   e l e m e n t . \ n                                         a b o r t ( ) ; \ n                                     } \ n                                 } \ n                                 / /   E l i s i o n s   a n d   l e a d i n g   c o m m a s   a r e   n o t   p e r m i t t e d . \ n                                 i f   ( v a l u e   = =   \ " , \ " )   { \ n                                     a b o r t ( ) ; \ n                                 } \ n                                 r e s u l t s . p u s h ( g e t ( v a l u e ) ) ; \ n                             } \ n                             r e t u r n   r e s u l t s ; \ n                         }   e l s e   i f   ( v a l u e   = =   \ " { \ " )   { \ n                             / /   P a r s e s   a   J S O N   o b j e c t ,   r e t u r n i n g   a   n e w   J a v a S c r i p t   o b j e c t . \ n                             r e s u l t s   =   { } ; \ n                             f o r   ( ; ;   h a s M e m b e r s   | |   ( h a s M e m b e r s   =   t r u e ) )   { \ n                                 v a l u e   =   l e x ( ) ; \ n                                 / /   A   c l o s i n g   c u r l y   b r a c e   m a r k s   t h e   e n d   o f   t h e   o b j e c t   l i t e r a l . \ n                                 i f   ( v a l u e   = =   \ " } \ " )   { \ n                                     b r e a k ; \ n                                 } \ n                                 / /   I f   t h e   o b j e c t   l i t e r a l   c o n t a i n s   m e m b e r s ,   t h e   c u r r e n t   t o k e n \ n                                 / /   s h o u l d   b e   a   c o m m a   s e p a r a t o r . \ n                                 i f   ( h a s M e m b e r s )   { \ n                                     i f   ( v a l u e   = =   \ " , \ " )   { \ n                                         v a l u e   =   l e x ( ) ; \ n                                         i f   ( v a l u e   = =   \ " } \ " )   { \ n                                             / /    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   t r a i l i n g   ` , `   i n   o b j e c t   l i t e r a l . \ n                                             a b o r t ( ) ; \ n                                         } \ n                                     }   e l s e   { \ n                                         / /   A   ` , `    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   s e p a r a t e   e a c h   o b j e c t   m e m b e r . \ n                                         a b o r t ( ) ; \ n                                     } \ n                                 } \ n                                 / /   L e a d i n g   c o m m a s   a r e   n o t   p e r m i t t e d ,   o b j e c t   p r o p e r t y   n a m e s    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   b e \ n                                 / /   d o u b l e - q u o t e d   s t r i n g s ,   a n d   a   ` : `    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   s e p a r a t e   e a c h   p r o p e r t y \ n                                 / /   n a m e   a n d   v a l u e . \ n                                 i f   ( v a l u e   = =   \ " , \ "   | |   t y p e o f   v a l u e   ! =   \ " s t r i n g \ "   | |   ( c h a r I n d e x B u g g y   ?   v a l u e . c h a r A t ( 0 )   :   v a l u e [ 0 ] )   ! =   \ " @ \ "   | |   l e x ( )   ! =   \ " : \ " )   { \ n                                     a b o r t ( ) ; \ n                                 } \ n                                 r e s u l t s [ v a l u e . s l i c e ( 1 ) ]   =   g e t ( l e x ( ) ) ; \ n                             } \ n                             r e t u r n   r e s u l t s ; \ n                         } \ n                         / /    [ 1 m  [ 3 1 m U n e x p e c t e d  [ 3 9 m  [ 2 2 m  [ 1 m   t o k e n   e n c o u n t e r e d . \ n                         a b o r t ( ) ; \ n                     } \ n                     r e t u r n   v a l u e ; \ n                 } ; \ n \ n                 / /   I n t e r n a l :   U p d a t e s   a   t r a v e r s e d   o b j e c t   m e m b e r . \ n                 v a r   u p d a t e   =   f u n c t i o n   ( s o u r c e ,   p r o p e r t y ,   c a l l b a c k )   { \ n                     v a r   e l e m e n t   =   w a l k ( s o u r c e ,   p r o p e r t y ,   c a l l b a c k ) ; \ n                     i f   ( e l e m e n t   = = =   u n d e f )   { \ n                         d e l e t e   s o u r c e [ p r o p e r t y ] ; \ n                     }   e l s e   { \ n                         s o u r c e [ p r o p e r t y ]   =   e l e m e n t ; \ n                     } \ n                 } ; \ n \ n                 / /   I n t e r n a l :   R e c u r s i v e l y   t r a v e r s e s   a   p a r s e d   J S O N   o b j e c t ,   i n v o k i n g   t h e \ n                 / /   ` c a l l b a c k `   f u n c t i o n   f o r   e a c h   v a l u e .   T h i s   i s   a n   i m p l e m e n t a t i o n   o f   t h e \ n                 / /   ` W a l k ( h o l d e r ,   n a m e ) `   o p e r a t i o n   d e f i n e d   i n   E S   5 . 1   s e c t i o n   1 5 . 1 2 . 2 . \ n                 v a r   w a l k   =   f u n c t i o n   ( s o u r c e ,   p r o p e r t y ,   c a l l b a c k )   { \ n                     v a r   v a l u e   =   s o u r c e [ p r o p e r t y ] ,   l e n g t h ; \ n                     i f   ( t y p e o f   v a l u e   = =   \ " o b j e c t \ "   & &   v a l u e )   { \ n                         / /   ` f o r E a c h `   c a n ' t   b e   u s e d   t o   t r a v e r s e   a n   a r r a y   i n   O p e r a   < =   8 . 5 4 \ n                         / /   b e c a u s e   i t s   ` O b j e c t # h a s O w n P r o p e r t y `   i m p l e m e n t a t i o n   r e t u r n s   ` f a l s e ` \ n                         / /   f o r   a r r a y   i n d i c e s   ( e . g . ,   ` ! [ 1 ,   2 ,   3 ] . h a s O w n P r o p e r t y ( \ " 0 \ " ) ` ) . \ n                         i f   ( g e t C l a s s . c a l l ( v a l u e )   = =   a r r a y C l a s s )   { \ n                             f o r   ( l e n g t h   =   v a l u e . l e n g t h ;   l e n g t h - - ; )   { \ n                                 u p d a t e ( v a l u e ,   l e n g t h ,   c a l l b a c k ) ; \ n                             } \ n                         }   e l s e   { \ n                             f o r E a c h ( v a l u e ,   f u n c t i o n   ( p r o p e r t y )   { \ n                                 u p d a t e ( v a l u e ,   p r o p e r t y ,   c a l l b a c k ) ; \ n                             } ) ; \ n                         } \ n                     } \ n                     r e t u r n   c a l l b a c k . c a l l ( s o u r c e ,   p r o p e r t y ,   v a l u e ) ; \ n                 } ; \ n \ n                 / /   P u b l i c :   ` J S O N . p a r s e ` .   S e e   E S   5 . 1   s e c t i o n   1 5 . 1 2 . 2 . \ n                 e x p o r t s . p a r s e   =   f u n c t i o n   ( s o u r c e ,   c a l l b a c k )   { \ n                     v a r   r e s u l t ,   v a l u e ; \ n                     I n d e x   =   0 ; \ n                     S o u r c e   =   \ " \ "   +   s o u r c e ; \ n                     r e s u l t   =   g e t ( l e x ( ) ) ; \ n                     / /   I f   a   J S O N   s t r i n g   c o n t a i n s   m u l t i p l e   t o k e n s ,   i t   i s    [ 1 m  [ 3 1 m i n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m . \ n                     i f   ( l e x ( )   ! =   \ " $ \ " )   { \ n                         a b o r t ( ) ; \ n                     } \ n                     / /   R e s e t   t h e   p a r s e r   s t a t e . \ n                     I n d e x   =   S o u r c e   =   n u l l ; \ n                     r e t u r n   c a l l b a c k   & &   g e t C l a s s . c a l l ( c a l l b a c k )   = =   f u n c t i o n C l a s s   ?   w a l k ( ( v a l u e   =   { } ,   v a l u e [ \ " \ " ]   =   r e s u l t ,   v a l u e ) ,   \ " \ " ,   c a l l b a c k )   :   r e s u l t ; \ n                 } ; \ n             } \ n         } \ n \ n         e x p o r t s [ \ " r u n I n C o n t e x t \ " ]   =   r u n I n C o n t e x t ; \ n         r e t u r n   e x p o r t s ; \ n     } \ n \ n     i f   ( f r e e E x p o r t s   & &   ! i s L o a d e r )   { \ n         / /   E x p o r t   f o r   C o m m o n J S   e n v i r o n m e n t s . \ n         r u n I n C o n t e x t ( r o o t ,   f r e e E x p o r t s ) ; \ n     }   e l s e   { \ n         / /   E x p o r t   f o r   w e b   b r o w s e r s   a n d   J a v a S c r i p t   e n g i n e s . \ n         v a r   n a t i v e J S O N   =   r o o t . J S O N , \ n                 p r e v i o u s J S O N   =   r o o t [ \ " J S O N 3 \ " ] , \ n                 i s R e s t o r e d   =   f a l s e ; \ n \ n         v a r   J S O N 3   =   r u n I n C o n t e x t ( r o o t ,   ( r o o t [ \ " J S O N 3 \ " ]   =   { \ n             / /   P u b l i c :   R e s t o r e s   t h e   o r i g i n a l   v a l u e   o f   t h e   g l o b a l   ` J S O N `   o b j e c t   a n d \ n             / /   r e t u r n s   a   r e f e r e n c e   t o   t h e   ` J S O N 3 `   o b j e c t . \ n             \ " n o C o n f l i c t \ " :   f u n c t i o n   ( )   { \ n                 i f   ( ! i s R e s t o r e d )   { \ n                     i s R e s t o r e d   =   t r u e ; \ n                     r o o t . J S O N   =   n a t i v e J S O N ; \ n                     r o o t [ \ " J S O N 3 \ " ]   =   p r e v i o u s J S O N ; \ n                     n a t i v e J S O N   =   p r e v i o u s J S O N   =   n u l l ; \ n                 } \ n                 r e t u r n   J S O N 3 ; \ n             } \ n         } ) ) ; \ n \ n         r o o t . J S O N   =   { \ n             \ " p a r s e \ " :   J S O N 3 . p a r s e , \ n             \ " s t r i n g i f y \ " :   J S O N 3 . s t r i n g i f y \ n         } ; \ n     } \ n \ n     / /   E x p o r t   f o r   a s y n c h r o n o u s   m o d u l e   l o a d e r s . \ n     i f   ( i s L o a d e r )   { \ n         d e f i n e ( f u n c t i o n   ( )   { \ n             r e t u r n   J S O N 3 ; \ n         } ) ; \ n     } \ n } ) . c a l l ( t h i s ) ; \ n \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / j s o n 3 / l i b / j s o n 3 . j s \ n / /   m o d u l e   i d   =   1 1 \ n / /   m o d u l e   c h u n k s   =   0 " , " m o d u l e . e x p o r t s   =   f u n c t i o n ( m o d u l e )   { \ r \ n \ t i f ( ! m o d u l e . w e b p a c k P o l y f i l l )   { \ r \ n \ t \ t m o d u l e . d e p r e c a t e   =   f u n c t i o n ( )   { } ; \ r \ n \ t \ t m o d u l e . p a t h s   =   [ ] ; \ r \ n \ t \ t / /   m o d u l e . p a r e n t   =   u n d e f i n e d   b y   d e f a u l t \ r \ n \ t \ t m o d u l e . c h i l d r e n   =   [ ] ; \ r \ n \ t \ t m o d u l e . w e b p a c k P o l y f i l l   =   1 ; \ r \ n \ t } \ r \ n \ t r e t u r n   m o d u l e ; \ r \ n } \ r \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   ( w e b p a c k ) / b u i l d i n / m o d u l e . j s \ n / /   m o d u l e   i d   =   1 2 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   E x p o s e   ` E m i t t e r ` . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   E m i t t e r ; \ n \ n / * * \ n   *   I n i t i a l i z e   a   n e w   ` E m i t t e r ` . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   E m i t t e r ( o b j )   { \ n     i f   ( o b j )   r e t u r n   m i x i n ( o b j ) ; \ n } ; \ n \ n / * * \ n   *   M i x i n   t h e   e m i t t e r   p r o p e r t i e s . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o b j \ n   *   @ r e t u r n   { O b j e c t } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   m i x i n ( o b j )   { \ n     f o r   ( v a r   k e y   i n   E m i t t e r . p r o t o t y p e )   { \ n         o b j [ k e y ]   =   E m i t t e r . p r o t o t y p e [ k e y ] ; \ n     } \ n     r e t u r n   o b j ; \ n } \ n \ n / * * \ n   *   L i s t e n   o n   t h e   g i v e n   ` e v e n t `   w i t h   ` f n ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ p a r a m   { F u n c t i o n }   f n \ n   *   @ r e t u r n   { E m i t t e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . o n   = \ n E m i t t e r . p r o t o t y p e . a d d E v e n t L i s t e n e r   =   f u n c t i o n ( e v e n t ,   f n ) { \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ n     ( t h i s . _ c a l l b a c k s [ e v e n t ]   =   t h i s . _ c a l l b a c k s [ e v e n t ]   | |   [ ] ) \ n         . p u s h ( f n ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   A d d s   a n   ` e v e n t `   l i s t e n e r   t h a t   w i l l   b e   i n v o k e d   a   s i n g l e \ n   *   t i m e   t h e n   a u t o m a t i c a l l y   r e m o v e d . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ p a r a m   { F u n c t i o n }   f n \ n   *   @ r e t u r n   { E m i t t e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . o n c e   =   f u n c t i o n ( e v e n t ,   f n ) { \ n     v a r   s e l f   =   t h i s ; \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ n \ n     f u n c t i o n   o n ( )   { \ n         s e l f . o f f ( e v e n t ,   o n ) ; \ n         f n . a p p l y ( t h i s ,   a r g u m e n t s ) ; \ n     } \ n \ n     o n . f n   =   f n ; \ n     t h i s . o n ( e v e n t ,   o n ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   R e m o v e   t h e   g i v e n   c a l l b a c k   f o r   ` e v e n t `   o r   a l l \ n   *   r e g i s t e r e d   c a l l b a c k s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ p a r a m   { F u n c t i o n }   f n \ n   *   @ r e t u r n   { E m i t t e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . o f f   = \ n E m i t t e r . p r o t o t y p e . r e m o v e L i s t e n e r   = \ n E m i t t e r . p r o t o t y p e . r e m o v e A l l L i s t e n e r s   = \ n E m i t t e r . p r o t o t y p e . r e m o v e E v e n t L i s t e n e r   =   f u n c t i o n ( e v e n t ,   f n ) { \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ n \ n     / /   a l l \ n     i f   ( 0   = =   a r g u m e n t s . l e n g t h )   { \ n         t h i s . _ c a l l b a c k s   =   { } ; \ n         r e t u r n   t h i s ; \ n     } \ n \ n     / /   s p e c i f i c   e v e n t \ n     v a r   c a l l b a c k s   =   t h i s . _ c a l l b a c k s [ e v e n t ] ; \ n     i f   ( ! c a l l b a c k s )   r e t u r n   t h i s ; \ n \ n     / /   r e m o v e   a l l   h a n d l e r s \ n     i f   ( 1   = =   a r g u m e n t s . l e n g t h )   { \ n         d e l e t e   t h i s . _ c a l l b a c k s [ e v e n t ] ; \ n         r e t u r n   t h i s ; \ n     } \ n \ n     / /   r e m o v e   s p e c i f i c   h a n d l e r \ n     v a r   c b ; \ n     f o r   ( v a r   i   =   0 ;   i   <   c a l l b a c k s . l e n g t h ;   i + + )   { \ n         c b   =   c a l l b a c k s [ i ] ; \ n         i f   ( c b   = = =   f n   | |   c b . f n   = = =   f n )   { \ n             c a l l b a c k s . s p l i c e ( i ,   1 ) ; \ n             b r e a k ; \ n         } \ n     } \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   E m i t   ` e v e n t `   w i t h   t h e   g i v e n   a r g s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ p a r a m   { M i x e d }   . . . \ n   *   @ r e t u r n   { E m i t t e r } \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . e m i t   =   f u n c t i o n ( e v e n t ) { \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ n     v a r   a r g s   =   [ ] . s l i c e . c a l l ( a r g u m e n t s ,   1 ) \ n         ,   c a l l b a c k s   =   t h i s . _ c a l l b a c k s [ e v e n t ] ; \ n \ n     i f   ( c a l l b a c k s )   { \ n         c a l l b a c k s   =   c a l l b a c k s . s l i c e ( 0 ) ; \ n         f o r   ( v a r   i   =   0 ,   l e n   =   c a l l b a c k s . l e n g t h ;   i   <   l e n ;   + + i )   { \ n             c a l l b a c k s [ i ] . a p p l y ( t h i s ,   a r g s ) ; \ n         } \ n     } \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   R e t u r n   a r r a y   o f   c a l l b a c k s   f o r   ` e v e n t ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ r e t u r n   { A r r a y } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . l i s t e n e r s   =   f u n c t i o n ( e v e n t ) { \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ n     r e t u r n   t h i s . _ c a l l b a c k s [ e v e n t ]   | |   [ ] ; \ n } ; \ n \ n / * * \ n   *   C h e c k   i f   t h i s   e m i t t e r   h a s   ` e v e n t `   h a n d l e r s . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ n   *   @ r e t u r n   { B o o l e a n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n E m i t t e r . p r o t o t y p e . h a s L i s t e n e r s   =   f u n c t i o n ( e v e n t ) { \ n     r e t u r n   ! !   t h i s . l i s t e n e r s ( e v e n t ) . l e n g t h ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / ~ / c o m p o n e n t - e m i t t e r / i n d e x . j s \ n / /   m o d u l e   i d   =   1 3 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * g l o b a l   B l o b , F i l e * / \ n \ n / * * \ n   *   M o d u l e   r e q u i r e m e n t s \ n   * / \ n \ n v a r   i s A r r a y   =   r e q u i r e ( ' i s a r r a y ' ) ; \ n v a r   i s B u f   =   r e q u i r e ( ' . / i s - b u f f e r ' ) ; \ n \ n / * * \ n   *   R e p l a c e s   e v e r y   B u f f e r   |   A r r a y B u f f e r   i n   p a c k e t   w i t h   a   n u m b e r e d   p l a c e h o l d e r . \ n   *   A n y t h i n g   w i t h   b l o b s   o r   f i l e s   s h o u l d   b e   f e d   t h r o u g h   r e m o v e B l o b s   b e f o r e   c o m i n g \ n   *   h e r e . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t   -   s o c k e t . i o   e v e n t   p a c k e t \ n   *   @ r e t u r n   { O b j e c t }   w i t h   d e c o n s t r u c t e d   p a c k e t   a n d   l i s t   o f   b u f f e r s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . d e c o n s t r u c t P a c k e t   =   f u n c t i o n ( p a c k e t ) { \ n     v a r   b u f f e r s   =   [ ] ; \ n     v a r   p a c k e t D a t a   =   p a c k e t . d a t a ; \ n \ n     f u n c t i o n   _ d e c o n s t r u c t P a c k e t ( d a t a )   { \ n         i f   ( ! d a t a )   r e t u r n   d a t a ; \ n \ n         i f   ( i s B u f ( d a t a ) )   { \ n             v a r   p l a c e h o l d e r   =   {   _ p l a c e h o l d e r :   t r u e ,   n u m :   b u f f e r s . l e n g t h   } ; \ n             b u f f e r s . p u s h ( d a t a ) ; \ n             r e t u r n   p l a c e h o l d e r ; \ n         }   e l s e   i f   ( i s A r r a y ( d a t a ) )   { \ n             v a r   n e w D a t a   =   n e w   A r r a y ( d a t a . l e n g t h ) ; \ n             f o r   ( v a r   i   =   0 ;   i   <   d a t a . l e n g t h ;   i + + )   { \ n                 n e w D a t a [ i ]   =   _ d e c o n s t r u c t P a c k e t ( d a t a [ i ] ) ; \ n             } \ n             r e t u r n   n e w D a t a ; \ n         }   e l s e   i f   ( ' o b j e c t '   = =   t y p e o f   d a t a   & &   ! ( d a t a   i n s t a n c e o f   D a t e ) )   { \ n             v a r   n e w D a t a   =   { } ; \ n             f o r   ( v a r   k e y   i n   d a t a )   { \ n                 n e w D a t a [ k e y ]   =   _ d e c o n s t r u c t P a c k e t ( d a t a [ k e y ] ) ; \ n             } \ n             r e t u r n   n e w D a t a ; \ n         } \ n         r e t u r n   d a t a ; \ n     } \ n \ n     v a r   p a c k   =   p a c k e t ; \ n     p a c k . d a t a   =   _ d e c o n s t r u c t P a c k e t ( p a c k e t D a t a ) ; \ n     p a c k . a t t a c h m e n t s   =   b u f f e r s . l e n g t h ;   / /   n u m b e r   o f   b i n a r y   ' a t t a c h m e n t s ' \ n     r e t u r n   { p a c k e t :   p a c k ,   b u f f e r s :   b u f f e r s } ; \ n } ; \ n \ n / * * \ n   *   R e c o n s t r u c t s   a   b i n a r y   p a c k e t   f r o m   i t s   p l a c e h o l d e r   p a c k e t   a n d   b u f f e r s \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t   -   e v e n t   p a c k e t   w i t h   p l a c e h o l d e r s \ n   *   @ p a r a m   { A r r a y }   b u f f e r s   -   b i n a r y   b u f f e r s   t o   p u t   i n   p l a c e h o l d e r   p o s i t i o n s \ n   *   @ r e t u r n   { O b j e c t }   r e c o n s t r u c t e d   p a c k e t \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . r e c o n s t r u c t P a c k e t   =   f u n c t i o n ( p a c k e t ,   b u f f e r s )   { \ n     v a r   c u r P l a c e H o l d e r   =   0 ; \ n \ n     f u n c t i o n   _ r e c o n s t r u c t P a c k e t ( d a t a )   { \ n         i f   ( d a t a   & &   d a t a . _ p l a c e h o l d e r )   { \ n             v a r   b u f   =   b u f f e r s [ d a t a . n u m ] ;   / /   a p p r o p r i a t e   b u f f e r   ( s h o u l d   b e   n a t u r a l   o r d e r   a n y w a y ) \ n             r e t u r n   b u f ; \ n         }   e l s e   i f   ( i s A r r a y ( d a t a ) )   { \ n             f o r   ( v a r   i   =   0 ;   i   <   d a t a . l e n g t h ;   i + + )   { \ n                 d a t a [ i ]   =   _ r e c o n s t r u c t P a c k e t ( d a t a [ i ] ) ; \ n             } \ n             r e t u r n   d a t a ; \ n         }   e l s e   i f   ( d a t a   & &   ' o b j e c t '   = =   t y p e o f   d a t a )   { \ n             f o r   ( v a r   k e y   i n   d a t a )   { \ n                 d a t a [ k e y ]   =   _ r e c o n s t r u c t P a c k e t ( d a t a [ k e y ] ) ; \ n             } \ n             r e t u r n   d a t a ; \ n         } \ n         r e t u r n   d a t a ; \ n     } \ n \ n     p a c k e t . d a t a   =   _ r e c o n s t r u c t P a c k e t ( p a c k e t . d a t a ) ; \ n     p a c k e t . a t t a c h m e n t s   =   u n d e f i n e d ;   / /   n o   l o n g e r   u s e f u l \ n     r e t u r n   p a c k e t ; \ n } ; \ n \ n / * * \ n   *   A s y n c h r o n o u s l y   r e m o v e s   B l o b s   o r   F i l e s   f r o m   d a t a   v i a \ n   *   F i l e R e a d e r ' s   r e a d A s A r r a y B u f f e r   m e t h o d .   U s e d   b e f o r e   e n c o d i n g \ n   *   d a t a   a s   m s g p a c k .   C a l l s   c a l l b a c k   w i t h   t h e   b l o b l e s s   d a t a . \ n   * \ n   *   @ p a r a m   { O b j e c t }   d a t a \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n e x p o r t s . r e m o v e B l o b s   =   f u n c t i o n ( d a t a ,   c a l l b a c k )   { \ n     f u n c t i o n   _ r e m o v e B l o b s ( o b j ,   c u r K e y ,   c o n t a i n i n g O b j e c t )   { \ n         i f   ( ! o b j )   r e t u r n   o b j ; \ n \ n         / /   c o n v e r t   a n y   b l o b \ n         i f   ( ( g l o b a l . B l o b   & &   o b j   i n s t a n c e o f   B l o b )   | | \ n                 ( g l o b a l . F i l e   & &   o b j   i n s t a n c e o f   F i l e ) )   { \ n             p e n d i n g B l o b s + + ; \ n \ n             / /   a s y n c   f i l e r e a d e r \ n             v a r   f i l e R e a d e r   =   n e w   F i l e R e a d e r ( ) ; \ n             f i l e R e a d e r . o n l o a d   =   f u n c t i o n ( )   {   / /   t h i s . r e s u l t   = =   a r r a y b u f f e r \ n                 i f   ( c o n t a i n i n g O b j e c t )   { \ n                     c o n t a i n i n g O b j e c t [ c u r K e y ]   =   t h i s . r e s u l t ; \ n                 } \ n                 e l s e   { \ n                     b l o b l e s s D a t a   =   t h i s . r e s u l t ; \ n                 } \ n \ n                 / /   i f   n o t h i n g   p e n d i n g   i t s   c a l l b a c k   t i m e \ n                 i f ( !   - - p e n d i n g B l o b s )   { \ n                     c a l l b a c k ( b l o b l e s s D a t a ) ; \ n                 } \ n             } ; \ n \ n             f i l e R e a d e r . r e a d A s A r r a y B u f f e r ( o b j ) ;   / /   b l o b   - >   a r r a y b u f f e r \ n         }   e l s e   i f   ( i s A r r a y ( o b j ) )   {   / /   h a n d l e   a r r a y \ n             f o r   ( v a r   i   =   0 ;   i   <   o b j . l e n g t h ;   i + + )   { \ n                 _ r e m o v e B l o b s ( o b j [ i ] ,   i ,   o b j ) ; \ n             } \ n         }   e l s e   i f   ( o b j   & &   ' o b j e c t '   = =   t y p e o f   o b j   & &   ! i s B u f ( o b j ) )   {   / /   a n d   o b j e c t \ n             f o r   ( v a r   k e y   i n   o b j )   { \ n                 _ r e m o v e B l o b s ( o b j [ k e y ] ,   k e y ,   o b j ) ; \ n             } \ n         } \ n     } \ n \ n     v a r   p e n d i n g B l o b s   =   0 ; \ n     v a r   b l o b l e s s D a t a   =   d a t a ; \ n     _ r e m o v e B l o b s ( b l o b l e s s D a t a ) ; \ n     i f   ( ! p e n d i n g B l o b s )   { \ n         c a l l b a c k ( b l o b l e s s D a t a ) ; \ n     } \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / b i n a r y . j s \ n / /   m o d u l e   i d   =   1 4 \ n / /   m o d u l e   c h u n k s   =   0 " , " m o d u l e . e x p o r t s   =   A r r a y . i s A r r a y   | |   f u n c t i o n   ( a r r )   { \ n     r e t u r n   O b j e c t . p r o t o t y p e . t o S t r i n g . c a l l ( a r r )   = =   ' [ o b j e c t   A r r a y ] ' ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / i s a r r a y / i n d e x . j s \ n / /   m o d u l e   i d   =   1 5 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n m o d u l e . e x p o r t s   =   i s B u f ; \ n \ n / * * \ n   *   R e t u r n s   t r u e   i f   o b j   i s   a   b u f f e r   o r   a n   a r r a y b u f f e r . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   i s B u f ( o b j )   { \ n     r e t u r n   ( g l o b a l . B u f f e r   & &   g l o b a l . B u f f e r . i s B u f f e r ( o b j ) )   | | \ n                   ( g l o b a l . A r r a y B u f f e r   & &   o b j   i n s t a n c e o f   A r r a y B u f f e r ) ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / s o c k e t . i o - p a r s e r / i s - b u f f e r . j s \ n / /   m o d u l e   i d   =   1 6 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   e i o   =   r e q u i r e ( ' e n g i n e . i o - c l i e n t ' ) ; \ n v a r   S o c k e t   =   r e q u i r e ( ' . / s o c k e t ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   p a r s e r   =   r e q u i r e ( ' s o c k e t . i o - p a r s e r ' ) ; \ n v a r   o n   =   r e q u i r e ( ' . / o n ' ) ; \ n v a r   b i n d   =   r e q u i r e ( ' c o m p o n e n t - b i n d ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - c l i e n t : m a n a g e r ' ) ; \ n v a r   i n d e x O f   =   r e q u i r e ( ' i n d e x o f ' ) ; \ n v a r   B a c k o f f   =   r e q u i r e ( ' b a c k o 2 ' ) ; \ n \ n / * * \ n   *   I E 6 +   h a s O w n P r o p e r t y \ n   * / \ n \ n v a r   h a s   =   O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s \ n   * / \ n \ n m o d u l e . e x p o r t s   =   M a n a g e r ; \ n \ n / * * \ n   *   ` M a n a g e r `   c o n s t r u c t o r . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e n g i n e   i n s t a n c e   o r   e n g i n e   u r i / o p t s \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   M a n a g e r   ( u r i ,   o p t s )   { \ n     i f   ( ! ( t h i s   i n s t a n c e o f   M a n a g e r ) )   r e t u r n   n e w   M a n a g e r ( u r i ,   o p t s ) ; \ n     i f   ( u r i   & &   ( ' o b j e c t '   = = =   t y p e o f   u r i ) )   { \ n         o p t s   =   u r i ; \ n         u r i   =   u n d e f i n e d ; \ n     } \ n     o p t s   =   o p t s   | |   { } ; \ n \ n     o p t s . p a t h   =   o p t s . p a t h   | |   ' / s o c k e t . i o ' ; \ n     t h i s . n s p s   =   { } ; \ n     t h i s . s u b s   =   [ ] ; \ n     t h i s . o p t s   =   o p t s ; \ n     t h i s . r e c o n n e c t i o n ( o p t s . r e c o n n e c t i o n   ! = =   f a l s e ) ; \ n     t h i s . r e c o n n e c t i o n A t t e m p t s ( o p t s . r e c o n n e c t i o n A t t e m p t s   | |   I n f i n i t y ) ; \ n     t h i s . r e c o n n e c t i o n D e l a y ( o p t s . r e c o n n e c t i o n D e l a y   | |   1 0 0 0 ) ; \ n     t h i s . r e c o n n e c t i o n D e l a y M a x ( o p t s . r e c o n n e c t i o n D e l a y M a x   | |   5 0 0 0 ) ; \ n     t h i s . r a n d o m i z a t i o n F a c t o r ( o p t s . r a n d o m i z a t i o n F a c t o r   | |   0 . 5 ) ; \ n     t h i s . b a c k o f f   =   n e w   B a c k o f f ( { \ n         m i n :   t h i s . r e c o n n e c t i o n D e l a y ( ) , \ n         m a x :   t h i s . r e c o n n e c t i o n D e l a y M a x ( ) , \ n         j i t t e r :   t h i s . r a n d o m i z a t i o n F a c t o r ( ) \ n     } ) ; \ n     t h i s . t i m e o u t ( n u l l   = =   o p t s . t i m e o u t   ?   2 0 0 0 0   :   o p t s . t i m e o u t ) ; \ n     t h i s . r e a d y S t a t e   =   ' c l o s e d ' ; \ n     t h i s . u r i   =   u r i ; \ n     t h i s . c o n n e c t i n g   =   [ ] ; \ n     t h i s . l a s t P i n g   =   n u l l ; \ n     t h i s . e n c o d i n g   =   f a l s e ; \ n     t h i s . p a c k e t B u f f e r   =   [ ] ; \ n     t h i s . e n c o d e r   =   n e w   p a r s e r . E n c o d e r ( ) ; \ n     t h i s . d e c o d e r   =   n e w   p a r s e r . D e c o d e r ( ) ; \ n     t h i s . a u t o C o n n e c t   =   o p t s . a u t o C o n n e c t   ! = =   f a l s e ; \ n     i f   ( t h i s . a u t o C o n n e c t )   t h i s . o p e n ( ) ; \ n } \ n \ n / * * \ n   *   P r o p a g a t e   g i v e n   e v e n t   t o   s o c k e t s   a n d   e m i t   o n   ` t h i s ` \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . e m i t A l l   =   f u n c t i o n   ( )   { \ n     t h i s . e m i t . a p p l y ( t h i s ,   a r g u m e n t s ) ; \ n     f o r   ( v a r   n s p   i n   t h i s . n s p s )   { \ n         i f   ( h a s . c a l l ( t h i s . n s p s ,   n s p ) )   { \ n             t h i s . n s p s [ n s p ] . e m i t . a p p l y ( t h i s . n s p s [ n s p ] ,   a r g u m e n t s ) ; \ n         } \ n     } \ n } ; \ n \ n / * * \ n   *   U p d a t e   ` s o c k e t . i d `   o f   a l l   s o c k e t s \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . u p d a t e S o c k e t I d s   =   f u n c t i o n   ( )   { \ n     f o r   ( v a r   n s p   i n   t h i s . n s p s )   { \ n         i f   ( h a s . c a l l ( t h i s . n s p s ,   n s p ) )   { \ n             t h i s . n s p s [ n s p ] . i d   =   t h i s . e n g i n e . i d ; \ n         } \ n     } \ n } ; \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r ` . \ n   * / \ n \ n E m i t t e r ( M a n a g e r . p r o t o t y p e ) ; \ n \ n / * * \ n   *   S e t s   t h e   ` r e c o n n e c t i o n `   c o n f i g . \ n   * \ n   *   @ p a r a m   { B o o l e a n }   t r u e / f a l s e   i f   i t   s h o u l d   a u t o m a t i c a l l y   r e c o n n e c t \ n   *   @ r e t u r n   { M a n a g e r }   s e l f   o r   v a l u e \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . r e c o n n e c t i o n   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ r e c o n n e c t i o n ; \ n     t h i s . _ r e c o n n e c t i o n   =   ! ! v ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   r e c o n n e c t i o n   a t t e m p t s   c o n f i g . \ n   * \ n   *   @ p a r a m   { N u m b e r }   m a x   r e c o n n e c t i o n   a t t e m p t s   b e f o r e   g i v i n g   u p \ n   *   @ r e t u r n   { M a n a g e r }   s e l f   o r   v a l u e \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . r e c o n n e c t i o n A t t e m p t s   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ r e c o n n e c t i o n A t t e m p t s ; \ n     t h i s . _ r e c o n n e c t i o n A t t e m p t s   =   v ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   d e l a y   b e t w e e n   r e c o n n e c t i o n s . \ n   * \ n   *   @ p a r a m   { N u m b e r }   d e l a y \ n   *   @ r e t u r n   { M a n a g e r }   s e l f   o r   v a l u e \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . r e c o n n e c t i o n D e l a y   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ r e c o n n e c t i o n D e l a y ; \ n     t h i s . _ r e c o n n e c t i o n D e l a y   =   v ; \ n     t h i s . b a c k o f f   & &   t h i s . b a c k o f f . s e t M i n ( v ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n M a n a g e r . p r o t o t y p e . r a n d o m i z a t i o n F a c t o r   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ r a n d o m i z a t i o n F a c t o r ; \ n     t h i s . _ r a n d o m i z a t i o n F a c t o r   =   v ; \ n     t h i s . b a c k o f f   & &   t h i s . b a c k o f f . s e t J i t t e r ( v ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   m a x i m u m   d e l a y   b e t w e e n   r e c o n n e c t i o n s . \ n   * \ n   *   @ p a r a m   { N u m b e r }   d e l a y \ n   *   @ r e t u r n   { M a n a g e r }   s e l f   o r   v a l u e \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . r e c o n n e c t i o n D e l a y M a x   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ r e c o n n e c t i o n D e l a y M a x ; \ n     t h i s . _ r e c o n n e c t i o n D e l a y M a x   =   v ; \ n     t h i s . b a c k o f f   & &   t h i s . b a c k o f f . s e t M a x ( v ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   c o n n e c t i o n   t i m e o u t .   ` f a l s e `   t o   d i s a b l e \ n   * \ n   *   @ r e t u r n   { M a n a g e r }   s e l f   o r   v a l u e \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . t i m e o u t   =   f u n c t i o n   ( v )   { \ n     i f   ( ! a r g u m e n t s . l e n g t h )   r e t u r n   t h i s . _ t i m e o u t ; \ n     t h i s . _ t i m e o u t   =   v ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S t a r t s   t r y i n g   t o   r e c o n n e c t   i f   r e c o n n e c t i o n   i s   e n a b l e d   a n d   w e   h a v e   n o t \ n   *   s t a r t e d   r e c o n n e c t i n g   y e t \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . m a y b e R e c o n n e c t O n O p e n   =   f u n c t i o n   ( )   { \ n     / /   O n l y   t r y   t o   r e c o n n e c t   i f   i t ' s   t h e   f i r s t   t i m e   w e ' r e   c o n n e c t i n g \ n     i f   ( ! t h i s . r e c o n n e c t i n g   & &   t h i s . _ r e c o n n e c t i o n   & &   t h i s . b a c k o f f . a t t e m p t s   = = =   0 )   { \ n         / /   k e e p s   r e c o n n e c t i o n   f r o m   f i r i n g   t w i c e   f o r   t h e   s a m e   r e c o n n e c t i o n   l o o p \ n         t h i s . r e c o n n e c t ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   c u r r e n t   t r a n s p o r t   ` s o c k e t ` . \ n   * \ n   *   @ p a r a m   { F u n c t i o n }   o p t i o n a l ,   c a l l b a c k \ n   *   @ r e t u r n   { M a n a g e r }   s e l f \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o p e n   = \ n M a n a g e r . p r o t o t y p e . c o n n e c t   =   f u n c t i o n   ( f n ,   o p t s )   { \ n     d e b u g ( ' r e a d y S t a t e   % s ' ,   t h i s . r e a d y S t a t e ) ; \ n     i f   ( ~ t h i s . r e a d y S t a t e . i n d e x O f ( ' o p e n ' ) )   r e t u r n   t h i s ; \ n \ n     d e b u g ( ' o p e n i n g   % s ' ,   t h i s . u r i ) ; \ n     t h i s . e n g i n e   =   e i o ( t h i s . u r i ,   t h i s . o p t s ) ; \ n     v a r   s o c k e t   =   t h i s . e n g i n e ; \ n     v a r   s e l f   =   t h i s ; \ n     t h i s . r e a d y S t a t e   =   ' o p e n i n g ' ; \ n     t h i s . s k i p R e c o n n e c t   =   f a l s e ; \ n \ n     / /   e m i t   ` o p e n ` \ n     v a r   o p e n S u b   =   o n ( s o c k e t ,   ' o p e n ' ,   f u n c t i o n   ( )   { \ n         s e l f . o n o p e n ( ) ; \ n         f n   & &   f n ( ) ; \ n     } ) ; \ n \ n     / /   e m i t   ` c o n n e c t _ e r r o r ` \ n     v a r   e r r o r S u b   =   o n ( s o c k e t ,   '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   f u n c t i o n   ( d a t a )   { \ n         d e b u g ( ' c o n n e c t _ e r r o r ' ) ; \ n         s e l f . c l e a n u p ( ) ; \ n         s e l f . r e a d y S t a t e   =   ' c l o s e d ' ; \ n         s e l f . e m i t A l l ( ' c o n n e c t _ e r r o r ' ,   d a t a ) ; \ n         i f   ( f n )   { \ n             v a r   e r r   =   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' C o n n e c t i o n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n             e r r . d a t a   =   d a t a ; \ n             f n ( e r r ) ; \ n         }   e l s e   { \ n             / /   O n l y   d o   t h i s   i f   t h e r e   i s   n o   f n   t o   h a n d l e   t h e    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m \ n             s e l f . m a y b e R e c o n n e c t O n O p e n ( ) ; \ n         } \ n     } ) ; \ n \ n     / /   e m i t   ` c o n n e c t _ t i m e o u t ` \ n     i f   ( f a l s e   ! = =   t h i s . _ t i m e o u t )   { \ n         v a r   t i m e o u t   =   t h i s . _ t i m e o u t ; \ n         d e b u g ( ' c o n n e c t   a t t e m p t   w i l l   t i m e o u t   a f t e r   % d ' ,   t i m e o u t ) ; \ n \ n         / /   s e t   t i m e r \ n         v a r   t i m e r   =   s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             d e b u g ( ' c o n n e c t   a t t e m p t   t i m e d   o u t   a f t e r   % d ' ,   t i m e o u t ) ; \ n             o p e n S u b . d e s t r o y ( ) ; \ n             s o c k e t . c l o s e ( ) ; \ n             s o c k e t . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   ' t i m e o u t ' ) ; \ n             s e l f . e m i t A l l ( ' c o n n e c t _ t i m e o u t ' ,   t i m e o u t ) ; \ n         } ,   t i m e o u t ) ; \ n \ n         t h i s . s u b s . p u s h ( { \ n             d e s t r o y :   f u n c t i o n   ( )   { \ n                 c l e a r T i m e o u t ( t i m e r ) ; \ n             } \ n         } ) ; \ n     } \ n \ n     t h i s . s u b s . p u s h ( o p e n S u b ) ; \ n     t h i s . s u b s . p u s h ( e r r o r S u b ) ; \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   t r a n s p o r t   o p e n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n o p e n   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' o p e n ' ) ; \ n \ n     / /   c l e a r   o l d   s u b s \ n     t h i s . c l e a n u p ( ) ; \ n \ n     / /   m a r k   a s   o p e n \ n     t h i s . r e a d y S t a t e   =   ' o p e n ' ; \ n     t h i s . e m i t ( ' o p e n ' ) ; \ n \ n     / /   a d d   n e w   s u b s \ n     v a r   s o c k e t   =   t h i s . e n g i n e ; \ n     t h i s . s u b s . p u s h ( o n ( s o c k e t ,   ' d a t a ' ,   b i n d ( t h i s ,   ' o n d a t a ' ) ) ) ; \ n     t h i s . s u b s . p u s h ( o n ( s o c k e t ,   ' p i n g ' ,   b i n d ( t h i s ,   ' o n p i n g ' ) ) ) ; \ n     t h i s . s u b s . p u s h ( o n ( s o c k e t ,   ' p o n g ' ,   b i n d ( t h i s ,   ' o n p o n g ' ) ) ) ; \ n     t h i s . s u b s . p u s h ( o n ( s o c k e t ,   '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   b i n d ( t h i s ,   ' o n e r r o r ' ) ) ) ; \ n     t h i s . s u b s . p u s h ( o n ( s o c k e t ,   ' c l o s e ' ,   b i n d ( t h i s ,   ' o n c l o s e ' ) ) ) ; \ n     t h i s . s u b s . p u s h ( o n ( t h i s . d e c o d e r ,   ' d e c o d e d ' ,   b i n d ( t h i s ,   ' o n d e c o d e d ' ) ) ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   a   p i n g . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n p i n g   =   f u n c t i o n   ( )   { \ n     t h i s . l a s t P i n g   =   n e w   D a t e ( ) ; \ n     t h i s . e m i t A l l ( ' p i n g ' ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   a   p a c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n p o n g   =   f u n c t i o n   ( )   { \ n     t h i s . e m i t A l l ( ' p o n g ' ,   n e w   D a t e ( )   -   t h i s . l a s t P i n g ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w i t h   d a t a . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n d a t a   =   f u n c t i o n   ( d a t a )   { \ n     t h i s . d e c o d e r . a d d ( d a t a ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w h e n   p a r s e r   f u l l y   d e c o d e s   a   p a c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n d e c o d e d   =   f u n c t i o n   ( p a c k e t )   { \ n     t h i s . e m i t ( ' p a c k e t ' ,   p a c k e t ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   s o c k e t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n e r r o r   =   f u n c t i o n   ( e r r )   { \ n     d e b u g ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     t h i s . e m i t A l l ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n } ; \ n \ n / * * \ n   *   C r e a t e s   a   n e w   s o c k e t   f o r   t h e   g i v e n   ` n s p ` . \ n   * \ n   *   @ r e t u r n   { S o c k e t } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . s o c k e t   =   f u n c t i o n   ( n s p ,   o p t s )   { \ n     v a r   s o c k e t   =   t h i s . n s p s [ n s p ] ; \ n     i f   ( ! s o c k e t )   { \ n         s o c k e t   =   n e w   S o c k e t ( t h i s ,   n s p ,   o p t s ) ; \ n         t h i s . n s p s [ n s p ]   =   s o c k e t ; \ n         v a r   s e l f   =   t h i s ; \ n         s o c k e t . o n ( ' c o n n e c t i n g ' ,   o n C o n n e c t i n g ) ; \ n         s o c k e t . o n ( ' c o n n e c t ' ,   f u n c t i o n   ( )   { \ n             s o c k e t . i d   =   s e l f . e n g i n e . i d ; \ n         } ) ; \ n \ n         i f   ( t h i s . a u t o C o n n e c t )   { \ n             / /   m a n u a l l y   c a l l   h e r e   s i n c e   c o n n e c t i n g   e v n e t   i s   f i r e d   b e f o r e   l i s t e n i n g \ n             o n C o n n e c t i n g ( ) ; \ n         } \ n     } \ n \ n     f u n c t i o n   o n C o n n e c t i n g   ( )   { \ n         i f   ( ! ~ i n d e x O f ( s e l f . c o n n e c t i n g ,   s o c k e t ) )   { \ n             s e l f . c o n n e c t i n g . p u s h ( s o c k e t ) ; \ n         } \ n     } \ n \ n     r e t u r n   s o c k e t ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   a   s o c k e t   c l o s e . \ n   * \ n   *   @ p a r a m   { S o c k e t }   s o c k e t \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . d e s t r o y   =   f u n c t i o n   ( s o c k e t )   { \ n     v a r   i n d e x   =   i n d e x O f ( t h i s . c o n n e c t i n g ,   s o c k e t ) ; \ n     i f   ( ~ i n d e x )   t h i s . c o n n e c t i n g . s p l i c e ( i n d e x ,   1 ) ; \ n     i f   ( t h i s . c o n n e c t i n g . l e n g t h )   r e t u r n ; \ n \ n     t h i s . c l o s e ( ) ; \ n } ; \ n \ n / * * \ n   *   W r i t e s   a   p a c k e t . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . p a c k e t   =   f u n c t i o n   ( p a c k e t )   { \ n     d e b u g ( ' w r i t i n g   p a c k e t   % j ' ,   p a c k e t ) ; \ n     v a r   s e l f   =   t h i s ; \ n     i f   ( p a c k e t . q u e r y   & &   p a c k e t . t y p e   = = =   0 )   p a c k e t . n s p   + =   ' ? '   +   p a c k e t . q u e r y ; \ n \ n     i f   ( ! s e l f . e n c o d i n g )   { \ n         / /   e n c o d e ,   t h e n   w r i t e   t o   e n g i n e   w i t h   r e s u l t \ n         s e l f . e n c o d i n g   =   t r u e ; \ n         t h i s . e n c o d e r . e n c o d e ( p a c k e t ,   f u n c t i o n   ( e n c o d e d P a c k e t s )   { \ n             f o r   ( v a r   i   =   0 ;   i   <   e n c o d e d P a c k e t s . l e n g t h ;   i + + )   { \ n                 s e l f . e n g i n e . w r i t e ( e n c o d e d P a c k e t s [ i ] ,   p a c k e t . o p t i o n s ) ; \ n             } \ n             s e l f . e n c o d i n g   =   f a l s e ; \ n             s e l f . p r o c e s s P a c k e t Q u e u e ( ) ; \ n         } ) ; \ n     }   e l s e   {   / /   a d d   p a c k e t   t o   t h e   q u e u e \ n         s e l f . p a c k e t B u f f e r . p u s h ( p a c k e t ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   I f   p a c k e t   b u f f e r   i s   n o n - e m p t y ,   b e g i n s   e n c o d i n g   t h e \ n   *   n e x t   p a c k e t   i n   l i n e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . p r o c e s s P a c k e t Q u e u e   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . p a c k e t B u f f e r . l e n g t h   >   0   & &   ! t h i s . e n c o d i n g )   { \ n         v a r   p a c k   =   t h i s . p a c k e t B u f f e r . s h i f t ( ) ; \ n         t h i s . p a c k e t ( p a c k ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C l e a n   u p   t r a n s p o r t   s u b s c r i p t i o n s   a n d   p a c k e t   b u f f e r . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . c l e a n u p   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' c l e a n u p ' ) ; \ n \ n     v a r   s u b s L e n g t h   =   t h i s . s u b s . l e n g t h ; \ n     f o r   ( v a r   i   =   0 ;   i   <   s u b s L e n g t h ;   i + + )   { \ n         v a r   s u b   =   t h i s . s u b s . s h i f t ( ) ; \ n         s u b . d e s t r o y ( ) ; \ n     } \ n \ n     t h i s . p a c k e t B u f f e r   =   [ ] ; \ n     t h i s . e n c o d i n g   =   f a l s e ; \ n     t h i s . l a s t P i n g   =   n u l l ; \ n \ n     t h i s . d e c o d e r . d e s t r o y ( ) ; \ n } ; \ n \ n / * * \ n   *   C l o s e   t h e   c u r r e n t   s o c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . c l o s e   = \ n M a n a g e r . p r o t o t y p e . d i s c o n n e c t   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' d i s c o n n e c t ' ) ; \ n     t h i s . s k i p R e c o n n e c t   =   t r u e ; \ n     t h i s . r e c o n n e c t i n g   =   f a l s e ; \ n     i f   ( ' o p e n i n g '   = = =   t h i s . r e a d y S t a t e )   { \ n         / /   ` o n c l o s e `   w i l l   n o t   f i r e   b e c a u s e \ n         / /   a n   o p e n   e v e n t   n e v e r   h a p p e n e d \ n         t h i s . c l e a n u p ( ) ; \ n     } \ n     t h i s . b a c k o f f . r e s e t ( ) ; \ n     t h i s . r e a d y S t a t e   =   ' c l o s e d ' ; \ n     i f   ( t h i s . e n g i n e )   t h i s . e n g i n e . c l o s e ( ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   e n g i n e   c l o s e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n c l o s e   =   f u n c t i o n   ( r e a s o n )   { \ n     d e b u g ( ' o n c l o s e ' ) ; \ n \ n     t h i s . c l e a n u p ( ) ; \ n     t h i s . b a c k o f f . r e s e t ( ) ; \ n     t h i s . r e a d y S t a t e   =   ' c l o s e d ' ; \ n     t h i s . e m i t ( ' c l o s e ' ,   r e a s o n ) ; \ n \ n     i f   ( t h i s . _ r e c o n n e c t i o n   & &   ! t h i s . s k i p R e c o n n e c t )   { \ n         t h i s . r e c o n n e c t ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   A t t e m p t   a   r e c o n n e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . r e c o n n e c t   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . r e c o n n e c t i n g   | |   t h i s . s k i p R e c o n n e c t )   r e t u r n   t h i s ; \ n \ n     v a r   s e l f   =   t h i s ; \ n \ n     i f   ( t h i s . b a c k o f f . a t t e m p t s   > =   t h i s . _ r e c o n n e c t i o n A t t e m p t s )   { \ n         d e b u g ( ' r e c o n n e c t    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n         t h i s . b a c k o f f . r e s e t ( ) ; \ n         t h i s . e m i t A l l ( ' r e c o n n e c t _ f a i l e d ' ) ; \ n         t h i s . r e c o n n e c t i n g   =   f a l s e ; \ n     }   e l s e   { \ n         v a r   d e l a y   =   t h i s . b a c k o f f . d u r a t i o n ( ) ; \ n         d e b u g ( ' w i l l   w a i t   % d m s   b e f o r e   r e c o n n e c t   a t t e m p t ' ,   d e l a y ) ; \ n \ n         t h i s . r e c o n n e c t i n g   =   t r u e ; \ n         v a r   t i m e r   =   s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             i f   ( s e l f . s k i p R e c o n n e c t )   r e t u r n ; \ n \ n             d e b u g ( ' a t t e m p t i n g   r e c o n n e c t ' ) ; \ n             s e l f . e m i t A l l ( ' r e c o n n e c t _ a t t e m p t ' ,   s e l f . b a c k o f f . a t t e m p t s ) ; \ n             s e l f . e m i t A l l ( ' r e c o n n e c t i n g ' ,   s e l f . b a c k o f f . a t t e m p t s ) ; \ n \ n             / /   c h e c k   a g a i n   f o r   t h e   c a s e   s o c k e t   c l o s e d   i n   a b o v e   e v e n t s \ n             i f   ( s e l f . s k i p R e c o n n e c t )   r e t u r n ; \ n \ n             s e l f . o p e n ( f u n c t i o n   ( e r r )   { \ n                 i f   ( e r r )   { \ n                     d e b u g ( ' r e c o n n e c t   a t t e m p t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n                     s e l f . r e c o n n e c t i n g   =   f a l s e ; \ n                     s e l f . r e c o n n e c t ( ) ; \ n                     s e l f . e m i t A l l ( ' r e c o n n e c t _ e r r o r ' ,   e r r . d a t a ) ; \ n                 }   e l s e   { \ n                     d e b u g ( ' r e c o n n e c t   s u c c e s s ' ) ; \ n                     s e l f . o n r e c o n n e c t ( ) ; \ n                 } \ n             } ) ; \ n         } ,   d e l a y ) ; \ n \ n         t h i s . s u b s . p u s h ( { \ n             d e s t r o y :   f u n c t i o n   ( )   { \ n                 c l e a r T i m e o u t ( t i m e r ) ; \ n             } \ n         } ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   s u c c e s s f u l   r e c o n n e c t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n M a n a g e r . p r o t o t y p e . o n r e c o n n e c t   =   f u n c t i o n   ( )   { \ n     v a r   a t t e m p t   =   t h i s . b a c k o f f . a t t e m p t s ; \ n     t h i s . r e c o n n e c t i n g   =   f a l s e ; \ n     t h i s . b a c k o f f . r e s e t ( ) ; \ n     t h i s . u p d a t e S o c k e t I d s ( ) ; \ n     t h i s . e m i t A l l ( ' r e c o n n e c t ' ,   a t t e m p t ) ; \ n } ; \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / m a n a g e r . j s " , " \ n m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / l i b / i n d e x ' ) ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / i n d e x . j s \ n / /   m o d u l e   i d   =   1 8 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n m o d u l e . e x p o r t s   =   r e q u i r e ( ' . / s o c k e t ' ) ; \ n \ n / * * \ n   *   E x p o r t s   p a r s e r \ n   * \ n   *   @ a p i   p u b l i c \ n   * \ n   * / \ n m o d u l e . e x p o r t s . p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / i n d e x . j s \ n / /   m o d u l e   i d   =   1 9 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   t r a n s p o r t s   =   r e q u i r e ( ' . / t r a n s p o r t s / i n d e x ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' e n g i n e . i o - c l i e n t : s o c k e t ' ) ; \ n v a r   i n d e x   =   r e q u i r e ( ' i n d e x o f ' ) ; \ n v a r   p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n v a r   p a r s e u r i   =   r e q u i r e ( ' p a r s e u r i ' ) ; \ n v a r   p a r s e j s o n   =   r e q u i r e ( ' p a r s e j s o n ' ) ; \ n v a r   p a r s e q s   =   r e q u i r e ( ' p a r s e q s ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   S o c k e t ; \ n \ n / * * \ n   *   S o c k e t   c o n s t r u c t o r . \ n   * \ n   *   @ p a r a m   { S t r i n g | O b j e c t }   u r i   o r   o p t i o n s \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   S o c k e t   ( u r i ,   o p t s )   { \ n     i f   ( ! ( t h i s   i n s t a n c e o f   S o c k e t ) )   r e t u r n   n e w   S o c k e t ( u r i ,   o p t s ) ; \ n \ n     o p t s   =   o p t s   | |   { } ; \ n \ n     i f   ( u r i   & &   ' o b j e c t '   = = =   t y p e o f   u r i )   { \ n         o p t s   =   u r i ; \ n         u r i   =   n u l l ; \ n     } \ n \ n     i f   ( u r i )   { \ n         u r i   =   p a r s e u r i ( u r i ) ; \ n         o p t s . h o s t n a m e   =   u r i . h o s t ; \ n         o p t s . s e c u r e   =   u r i . p r o t o c o l   = = =   ' h t t p s '   | |   u r i . p r o t o c o l   = = =   ' w s s ' ; \ n         o p t s . p o r t   =   u r i . p o r t ; \ n         i f   ( u r i . q u e r y )   o p t s . q u e r y   =   u r i . q u e r y ; \ n     }   e l s e   i f   ( o p t s . h o s t )   { \ n         o p t s . h o s t n a m e   =   p a r s e u r i ( o p t s . h o s t ) . h o s t ; \ n     } \ n \ n     t h i s . s e c u r e   =   n u l l   ! =   o p t s . s e c u r e   ?   o p t s . s e c u r e \ n         :   ( g l o b a l . l o c a t i o n   & &   ' h t t p s : '   = = =   l o c a t i o n . p r o t o c o l ) ; \ n \ n     i f   ( o p t s . h o s t n a m e   & &   ! o p t s . p o r t )   { \ n         / /   i f   n o   p o r t   i s   s p e c i f i e d   m a n u a l l y ,   u s e   t h e   p r o t o c o l   d e f a u l t \ n         o p t s . p o r t   =   t h i s . s e c u r e   ?   ' 4 4 3 '   :   ' 8 0 ' ; \ n     } \ n \ n     t h i s . a g e n t   =   o p t s . a g e n t   | |   f a l s e ; \ n     t h i s . h o s t n a m e   =   o p t s . h o s t n a m e   | | \ n         ( g l o b a l . l o c a t i o n   ?   l o c a t i o n . h o s t n a m e   :   ' l o c a l h o s t ' ) ; \ n     t h i s . p o r t   =   o p t s . p o r t   | |   ( g l o b a l . l o c a t i o n   & &   l o c a t i o n . p o r t \ n             ?   l o c a t i o n . p o r t \ n             :   ( t h i s . s e c u r e   ?   4 4 3   :   8 0 ) ) ; \ n     t h i s . q u e r y   =   o p t s . q u e r y   | |   { } ; \ n     i f   ( ' s t r i n g '   = = =   t y p e o f   t h i s . q u e r y )   t h i s . q u e r y   =   p a r s e q s . d e c o d e ( t h i s . q u e r y ) ; \ n     t h i s . u p g r a d e   =   f a l s e   ! = =   o p t s . u p g r a d e ; \ n     t h i s . p a t h   =   ( o p t s . p a t h   | |   ' / e n g i n e . i o ' ) . r e p l a c e ( / \ \ / $ / ,   ' ' )   +   ' / ' ; \ n     t h i s . f o r c e J S O N P   =   ! ! o p t s . f o r c e J S O N P ; \ n     t h i s . j s o n p   =   f a l s e   ! = =   o p t s . j s o n p ; \ n     t h i s . f o r c e B a s e 6 4   =   ! ! o p t s . f o r c e B a s e 6 4 ; \ n     t h i s . e n a b l e s X D R   =   ! ! o p t s . e n a b l e s X D R ; \ n     t h i s . t i m e s t a m p P a r a m   =   o p t s . t i m e s t a m p P a r a m   | |   ' t ' ; \ n     t h i s . t i m e s t a m p R e q u e s t s   =   o p t s . t i m e s t a m p R e q u e s t s ; \ n     t h i s . t r a n s p o r t s   =   o p t s . t r a n s p o r t s   | |   [ ' p o l l i n g ' ,   ' w e b s o c k e t ' ] ; \ n     t h i s . r e a d y S t a t e   =   ' ' ; \ n     t h i s . w r i t e B u f f e r   =   [ ] ; \ n     t h i s . p r e v B u f f e r L e n   =   0 ; \ n     t h i s . p o l i c y P o r t   =   o p t s . p o l i c y P o r t   | |   8 4 3 ; \ n     t h i s . r e m e m b e r U p g r a d e   =   o p t s . r e m e m b e r U p g r a d e   | |   f a l s e ; \ n     t h i s . b i n a r y T y p e   =   n u l l ; \ n     t h i s . o n l y B i n a r y U p g r a d e s   =   o p t s . o n l y B i n a r y U p g r a d e s ; \ n     t h i s . p e r M e s s a g e D e f l a t e   =   f a l s e   ! = =   o p t s . p e r M e s s a g e D e f l a t e   ?   ( o p t s . p e r M e s s a g e D e f l a t e   | |   { } )   :   f a l s e ; \ n \ n     i f   ( t r u e   = = =   t h i s . p e r M e s s a g e D e f l a t e )   t h i s . p e r M e s s a g e D e f l a t e   =   { } ; \ n     i f   ( t h i s . p e r M e s s a g e D e f l a t e   & &   n u l l   = =   t h i s . p e r M e s s a g e D e f l a t e . t h r e s h o l d )   { \ n         t h i s . p e r M e s s a g e D e f l a t e . t h r e s h o l d   =   1 0 2 4 ; \ n     } \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     t h i s . p f x   =   o p t s . p f x   | |   n u l l ; \ n     t h i s . k e y   =   o p t s . k e y   | |   n u l l ; \ n     t h i s . p a s s p h r a s e   =   o p t s . p a s s p h r a s e   | |   n u l l ; \ n     t h i s . c e r t   =   o p t s . c e r t   | |   n u l l ; \ n     t h i s . c a   =   o p t s . c a   | |   n u l l ; \ n     t h i s . c i p h e r s   =   o p t s . c i p h e r s   | |   n u l l ; \ n     t h i s . r e j e c t U n a u t h o r i z e d   =   o p t s . r e j e c t U n a u t h o r i z e d   = = =   u n d e f i n e d   ?   n u l l   :   o p t s . r e j e c t U n a u t h o r i z e d ; \ n     t h i s . f o r c e N o d e   =   ! ! o p t s . f o r c e N o d e ; \ n \ n     / /   o t h e r   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     v a r   f r e e G l o b a l   =   t y p e o f   g l o b a l   = = =   ' o b j e c t '   & &   g l o b a l ; \ n     i f   ( f r e e G l o b a l . g l o b a l   = = =   f r e e G l o b a l )   { \ n         i f   ( o p t s . e x t r a H e a d e r s   & &   O b j e c t . k e y s ( o p t s . e x t r a H e a d e r s ) . l e n g t h   >   0 )   { \ n             t h i s . e x t r a H e a d e r s   =   o p t s . e x t r a H e a d e r s ; \ n         } \ n \ n         i f   ( o p t s . l o c a l A d d r e s s )   { \ n             t h i s . l o c a l A d d r e s s   =   o p t s . l o c a l A d d r e s s ; \ n         } \ n     } \ n \ n     / /   s e t   o n   h a n d s h a k e \ n     t h i s . i d   =   n u l l ; \ n     t h i s . u p g r a d e s   =   n u l l ; \ n     t h i s . p i n g I n t e r v a l   =   n u l l ; \ n     t h i s . p i n g T i m e o u t   =   n u l l ; \ n \ n     / /   s e t   o n   h e a r t b e a t \ n     t h i s . p i n g I n t e r v a l T i m e r   =   n u l l ; \ n     t h i s . p i n g T i m e o u t T i m e r   =   n u l l ; \ n \ n     t h i s . o p e n ( ) ; \ n } \ n \ n S o c k e t . p r i o r W e b s o c k e t S u c c e s s   =   f a l s e ; \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r ` . \ n   * / \ n \ n E m i t t e r ( S o c k e t . p r o t o t y p e ) ; \ n \ n / * * \ n   *   P r o t o c o l   v e r s i o n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o c o l   =   p a r s e r . p r o t o c o l ;   / /   t h i s   i s   a n   i n t \ n \ n / * * \ n   *   E x p o s e   d e p s   f o r   l e g a c y   c o m p a t i b i l i t y \ n   *   a n d   s t a n d a l o n e   b r o w s e r   a c c e s s . \ n   * / \ n \ n S o c k e t . S o c k e t   =   S o c k e t ; \ n S o c k e t . T r a n s p o r t   =   r e q u i r e ( ' . / t r a n s p o r t ' ) ; \ n S o c k e t . t r a n s p o r t s   =   r e q u i r e ( ' . / t r a n s p o r t s / i n d e x ' ) ; \ n S o c k e t . p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n \ n / * * \ n   *   C r e a t e s   t r a n s p o r t   o f   t h e   g i v e n   t y p e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   t r a n s p o r t   n a m e \ n   *   @ r e t u r n   { T r a n s p o r t } \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . c r e a t e T r a n s p o r t   =   f u n c t i o n   ( n a m e )   { \ n     d e b u g ( ' c r e a t i n g   t r a n s p o r t   \ " % s \ " ' ,   n a m e ) ; \ n     v a r   q u e r y   =   c l o n e ( t h i s . q u e r y ) ; \ n \ n     / /   a p p e n d   e n g i n e . i o   p r o t o c o l   i d e n t i f i e r \ n     q u e r y . E I O   =   p a r s e r . p r o t o c o l ; \ n \ n     / /   t r a n s p o r t   n a m e \ n     q u e r y . t r a n s p o r t   =   n a m e ; \ n \ n     / /   s e s s i o n   i d   i f   w e   a l r e a d y   h a v e   o n e \ n     i f   ( t h i s . i d )   q u e r y . s i d   =   t h i s . i d ; \ n \ n     v a r   t r a n s p o r t   =   n e w   t r a n s p o r t s [ n a m e ] ( { \ n         a g e n t :   t h i s . a g e n t , \ n         h o s t n a m e :   t h i s . h o s t n a m e , \ n         p o r t :   t h i s . p o r t , \ n         s e c u r e :   t h i s . s e c u r e , \ n         p a t h :   t h i s . p a t h , \ n         q u e r y :   q u e r y , \ n         f o r c e J S O N P :   t h i s . f o r c e J S O N P , \ n         j s o n p :   t h i s . j s o n p , \ n         f o r c e B a s e 6 4 :   t h i s . f o r c e B a s e 6 4 , \ n         e n a b l e s X D R :   t h i s . e n a b l e s X D R , \ n         t i m e s t a m p R e q u e s t s :   t h i s . t i m e s t a m p R e q u e s t s , \ n         t i m e s t a m p P a r a m :   t h i s . t i m e s t a m p P a r a m , \ n         p o l i c y P o r t :   t h i s . p o l i c y P o r t , \ n         s o c k e t :   t h i s , \ n         p f x :   t h i s . p f x , \ n         k e y :   t h i s . k e y , \ n         p a s s p h r a s e :   t h i s . p a s s p h r a s e , \ n         c e r t :   t h i s . c e r t , \ n         c a :   t h i s . c a , \ n         c i p h e r s :   t h i s . c i p h e r s , \ n         r e j e c t U n a u t h o r i z e d :   t h i s . r e j e c t U n a u t h o r i z e d , \ n         p e r M e s s a g e D e f l a t e :   t h i s . p e r M e s s a g e D e f l a t e , \ n         e x t r a H e a d e r s :   t h i s . e x t r a H e a d e r s , \ n         f o r c e N o d e :   t h i s . f o r c e N o d e , \ n         l o c a l A d d r e s s :   t h i s . l o c a l A d d r e s s \ n     } ) ; \ n \ n     r e t u r n   t r a n s p o r t ; \ n } ; \ n \ n f u n c t i o n   c l o n e   ( o b j )   { \ n     v a r   o   =   { } ; \ n     f o r   ( v a r   i   i n   o b j )   { \ n         i f   ( o b j . h a s O w n P r o p e r t y ( i ) )   { \ n             o [ i ]   =   o b j [ i ] ; \ n         } \ n     } \ n     r e t u r n   o ; \ n } \ n \ n / * * \ n   *   I n i t i a l i z e s   t r a n s p o r t   t o   u s e   a n d   s t a r t s   p r o b e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n S o c k e t . p r o t o t y p e . o p e n   =   f u n c t i o n   ( )   { \ n     v a r   t r a n s p o r t ; \ n     i f   ( t h i s . r e m e m b e r U p g r a d e   & &   S o c k e t . p r i o r W e b s o c k e t S u c c e s s   & &   t h i s . t r a n s p o r t s . i n d e x O f ( ' w e b s o c k e t ' )   ! = =   - 1 )   { \ n         t r a n s p o r t   =   ' w e b s o c k e t ' ; \ n     }   e l s e   i f   ( 0   = = =   t h i s . t r a n s p o r t s . l e n g t h )   { \ n         / /   E m i t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   o n   n e x t   t i c k   s o   i t   c a n   b e   l i s t e n e d   t o \ n         v a r   s e l f   =   t h i s ; \ n         s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             s e l f . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   ' N o   t r a n s p o r t s   a v a i l a b l e ' ) ; \ n         } ,   0 ) ; \ n         r e t u r n ; \ n     }   e l s e   { \ n         t r a n s p o r t   =   t h i s . t r a n s p o r t s [ 0 ] ; \ n     } \ n     t h i s . r e a d y S t a t e   =   ' o p e n i n g ' ; \ n \ n     / /   R e t r y   w i t h   t h e   n e x t   t r a n s p o r t   i f   t h e   t r a n s p o r t   i s   d i s a b l e d   ( j s o n p :   f a l s e ) \ n     t r y   { \ n         t r a n s p o r t   =   t h i s . c r e a t e T r a n s p o r t ( t r a n s p o r t ) ; \ n     }   c a t c h   ( e )   { \ n         t h i s . t r a n s p o r t s . s h i f t ( ) ; \ n         t h i s . o p e n ( ) ; \ n         r e t u r n ; \ n     } \ n \ n     t r a n s p o r t . o p e n ( ) ; \ n     t h i s . s e t T r a n s p o r t ( t r a n s p o r t ) ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   c u r r e n t   t r a n s p o r t .   D i s a b l e s   t h e   e x i s t i n g   o n e   ( i f   a n y ) . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . s e t T r a n s p o r t   =   f u n c t i o n   ( t r a n s p o r t )   { \ n     d e b u g ( ' s e t t i n g   t r a n s p o r t   % s ' ,   t r a n s p o r t . n a m e ) ; \ n     v a r   s e l f   =   t h i s ; \ n \ n     i f   ( t h i s . t r a n s p o r t )   { \ n         d e b u g ( ' c l e a r i n g   e x i s t i n g   t r a n s p o r t   % s ' ,   t h i s . t r a n s p o r t . n a m e ) ; \ n         t h i s . t r a n s p o r t . r e m o v e A l l L i s t e n e r s ( ) ; \ n     } \ n \ n     / /   s e t   u p   t r a n s p o r t \ n     t h i s . t r a n s p o r t   =   t r a n s p o r t ; \ n \ n     / /   s e t   u p   t r a n s p o r t   l i s t e n e r s \ n     t r a n s p o r t \ n     . o n ( ' d r a i n ' ,   f u n c t i o n   ( )   { \ n         s e l f . o n D r a i n ( ) ; \ n     } ) \ n     . o n ( ' p a c k e t ' ,   f u n c t i o n   ( p a c k e t )   { \ n         s e l f . o n P a c k e t ( p a c k e t ) ; \ n     } ) \ n     . o n ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   f u n c t i o n   ( e )   { \ n         s e l f . o n E r r o r ( e ) ; \ n     } ) \ n     . o n ( ' c l o s e ' ,   f u n c t i o n   ( )   { \ n         s e l f . o n C l o s e ( ' t r a n s p o r t   c l o s e ' ) ; \ n     } ) ; \ n } ; \ n \ n / * * \ n   *   P r o b e s   a   t r a n s p o r t . \ n   * \ n   *   @ p a r a m   { S t r i n g }   t r a n s p o r t   n a m e \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . p r o b e   =   f u n c t i o n   ( n a m e )   { \ n     d e b u g ( ' p r o b i n g   t r a n s p o r t   \ " % s \ " ' ,   n a m e ) ; \ n     v a r   t r a n s p o r t   =   t h i s . c r e a t e T r a n s p o r t ( n a m e ,   {   p r o b e :   1   } ) ; \ n     v a r    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m   =   f a l s e ; \ n     v a r   s e l f   =   t h i s ; \ n \ n     S o c k e t . p r i o r W e b s o c k e t S u c c e s s   =   f a l s e ; \ n \ n     f u n c t i o n   o n T r a n s p o r t O p e n   ( )   { \ n         i f   ( s e l f . o n l y B i n a r y U p g r a d e s )   { \ n             v a r   u p g r a d e L o s e s B i n a r y   =   ! t h i s . s u p p o r t s B i n a r y   & &   s e l f . t r a n s p o r t . s u p p o r t s B i n a r y ; \ n              [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m   =    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m   | |   u p g r a d e L o s e s B i n a r y ; \ n         } \ n         i f   (  [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n ; \ n \ n         d e b u g ( ' p r o b e   t r a n s p o r t   \ " % s \ "   o p e n e d ' ,   n a m e ) ; \ n         t r a n s p o r t . s e n d ( [ {   t y p e :   ' p i n g ' ,   d a t a :   ' p r o b e '   } ] ) ; \ n         t r a n s p o r t . o n c e ( ' p a c k e t ' ,   f u n c t i o n   ( m s g )   { \ n             i f   (  [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n ; \ n             i f   ( ' p o n g '   = = =   m s g . t y p e   & &   ' p r o b e '   = = =   m s g . d a t a )   { \ n                 d e b u g ( ' p r o b e   t r a n s p o r t   \ " % s \ "   p o n g ' ,   n a m e ) ; \ n                 s e l f . u p g r a d i n g   =   t r u e ; \ n                 s e l f . e m i t ( ' u p g r a d i n g ' ,   t r a n s p o r t ) ; \ n                 i f   ( ! t r a n s p o r t )   r e t u r n ; \ n                 S o c k e t . p r i o r W e b s o c k e t S u c c e s s   =   ' w e b s o c k e t '   = = =   t r a n s p o r t . n a m e ; \ n \ n                 d e b u g ( ' p a u s i n g   c u r r e n t   t r a n s p o r t   \ " % s \ " ' ,   s e l f . t r a n s p o r t . n a m e ) ; \ n                 s e l f . t r a n s p o r t . p a u s e ( f u n c t i o n   ( )   { \ n                     i f   (  [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n ; \ n                     i f   ( ' c l o s e d '   = = =   s e l f . r e a d y S t a t e )   r e t u r n ; \ n                     d e b u g ( ' c h a n g i n g   t r a n s p o r t   a n d   s e n d i n g   u p g r a d e   p a c k e t ' ) ; \ n \ n                     c l e a n u p ( ) ; \ n \ n                     s e l f . s e t T r a n s p o r t ( t r a n s p o r t ) ; \ n                     t r a n s p o r t . s e n d ( [ {   t y p e :   ' u p g r a d e '   } ] ) ; \ n                     s e l f . e m i t ( ' u p g r a d e ' ,   t r a n s p o r t ) ; \ n                     t r a n s p o r t   =   n u l l ; \ n                     s e l f . u p g r a d i n g   =   f a l s e ; \ n                     s e l f . f l u s h ( ) ; \ n                 } ) ; \ n             }   e l s e   { \ n                 d e b u g ( ' p r o b e   t r a n s p o r t   \ " % s \ "    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   n a m e ) ; \ n                 v a r   e r r   =   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o b e    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n                 e r r . t r a n s p o r t   =   t r a n s p o r t . n a m e ; \ n                 s e l f . e m i t ( ' u p g r a d e E r r o r ' ,   e r r ) ; \ n             } \ n         } ) ; \ n     } \ n \ n     f u n c t i o n   f r e e z e T r a n s p o r t   ( )   { \ n         i f   (  [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m )   r e t u r n ; \ n \ n         / /   A n y   c a l l b a c k   c a l l e d   b y   t r a n s p o r t   s h o u l d   b e   i g n o r e d   s i n c e   n o w \ n          [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m   =   t r u e ; \ n \ n         c l e a n u p ( ) ; \ n \ n         t r a n s p o r t . c l o s e ( ) ; \ n         t r a n s p o r t   =   n u l l ; \ n     } \ n \ n     / /   H a n d l e   a n y    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   t h a t   h a p p e n s   w h i l e   p r o b i n g \ n     f u n c t i o n   o n e r r o r   ( e r r )   { \ n         v a r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   =   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' p r o b e    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m :   '   +   e r r ) ; \ n          [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . t r a n s p o r t   =   t r a n s p o r t . n a m e ; \ n \ n         f r e e z e T r a n s p o r t ( ) ; \ n \ n         d e b u g ( ' p r o b e   t r a n s p o r t   \ " % s \ "    [ 1 m  [ 3 1 m f a i l e d  [ 3 9 m  [ 2 2 m  [ 1 m   b e c a u s e   o f    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m :   % s ' ,   n a m e ,   e r r ) ; \ n \ n         s e l f . e m i t ( ' u p g r a d e E r r o r ' ,    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ) ; \ n     } \ n \ n     f u n c t i o n   o n T r a n s p o r t C l o s e   ( )   { \ n         o n e r r o r ( ' t r a n s p o r t   c l o s e d ' ) ; \ n     } \ n \ n     / /   W h e n   t h e   s o c k e t   i s   c l o s e d   w h i l e   w e ' r e   p r o b i n g \ n     f u n c t i o n   o n c l o s e   ( )   { \ n         o n e r r o r ( ' s o c k e t   c l o s e d ' ) ; \ n     } \ n \ n     / /   W h e n   t h e   s o c k e t   i s   u p g r a d e d   w h i l e   w e ' r e   p r o b i n g \ n     f u n c t i o n   o n u p g r a d e   ( t o )   { \ n         i f   ( t r a n s p o r t   & &   t o . n a m e   ! = =   t r a n s p o r t . n a m e )   { \ n             d e b u g ( ' \ " % s \ "   w o r k s   -   a b o r t i n g   \ " % s \ " ' ,   t o . n a m e ,   t r a n s p o r t . n a m e ) ; \ n             f r e e z e T r a n s p o r t ( ) ; \ n         } \ n     } \ n \ n     / /   R e m o v e   a l l   l i s t e n e r s   o n   t h e   t r a n s p o r t   a n d   o n   s e l f \ n     f u n c t i o n   c l e a n u p   ( )   { \ n         t r a n s p o r t . r e m o v e L i s t e n e r ( ' o p e n ' ,   o n T r a n s p o r t O p e n ) ; \ n         t r a n s p o r t . r e m o v e L i s t e n e r ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   o n e r r o r ) ; \ n         t r a n s p o r t . r e m o v e L i s t e n e r ( ' c l o s e ' ,   o n T r a n s p o r t C l o s e ) ; \ n         s e l f . r e m o v e L i s t e n e r ( ' c l o s e ' ,   o n c l o s e ) ; \ n         s e l f . r e m o v e L i s t e n e r ( ' u p g r a d i n g ' ,   o n u p g r a d e ) ; \ n     } \ n \ n     t r a n s p o r t . o n c e ( ' o p e n ' ,   o n T r a n s p o r t O p e n ) ; \ n     t r a n s p o r t . o n c e ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   o n e r r o r ) ; \ n     t r a n s p o r t . o n c e ( ' c l o s e ' ,   o n T r a n s p o r t C l o s e ) ; \ n \ n     t h i s . o n c e ( ' c l o s e ' ,   o n c l o s e ) ; \ n     t h i s . o n c e ( ' u p g r a d i n g ' ,   o n u p g r a d e ) ; \ n \ n     t r a n s p o r t . o p e n ( ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w h e n   c o n n e c t i o n   i s   d e e m e d   o p e n . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n O p e n   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' s o c k e t   o p e n ' ) ; \ n     t h i s . r e a d y S t a t e   =   ' o p e n ' ; \ n     S o c k e t . p r i o r W e b s o c k e t S u c c e s s   =   ' w e b s o c k e t '   = = =   t h i s . t r a n s p o r t . n a m e ; \ n     t h i s . e m i t ( ' o p e n ' ) ; \ n     t h i s . f l u s h ( ) ; \ n \ n     / /   w e   c h e c k   f o r   ` r e a d y S t a t e `   i n   c a s e   a n   ` o p e n ` \ n     / /   l i s t e n e r   a l r e a d y   c l o s e d   t h e   s o c k e t \ n     i f   ( ' o p e n '   = = =   t h i s . r e a d y S t a t e   & &   t h i s . u p g r a d e   & &   t h i s . t r a n s p o r t . p a u s e )   { \ n         d e b u g ( ' s t a r t i n g   u p g r a d e   p r o b e s ' ) ; \ n         f o r   ( v a r   i   =   0 ,   l   =   t h i s . u p g r a d e s . l e n g t h ;   i   <   l ;   i + + )   { \ n             t h i s . p r o b e ( t h i s . u p g r a d e s [ i ] ) ; \ n         } \ n     } \ n } ; \ n \ n / * * \ n   *   H a n d l e s   a   p a c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n P a c k e t   =   f u n c t i o n   ( p a c k e t )   { \ n     i f   ( ' o p e n i n g '   = = =   t h i s . r e a d y S t a t e   | |   ' o p e n '   = = =   t h i s . r e a d y S t a t e   | | \ n             ' c l o s i n g '   = = =   t h i s . r e a d y S t a t e )   { \ n         d e b u g ( ' s o c k e t   r e c e i v e :   t y p e   \ " % s \ " ,   d a t a   \ " % s \ " ' ,   p a c k e t . t y p e ,   p a c k e t . d a t a ) ; \ n \ n         t h i s . e m i t ( ' p a c k e t ' ,   p a c k e t ) ; \ n \ n         / /   S o c k e t   i s   l i v e   -   a n y   p a c k e t   c o u n t s \ n         t h i s . e m i t ( ' h e a r t b e a t ' ) ; \ n \ n         s w i t c h   ( p a c k e t . t y p e )   { \ n             c a s e   ' o p e n ' : \ n                 t h i s . o n H a n d s h a k e ( p a r s e j s o n ( p a c k e t . d a t a ) ) ; \ n                 b r e a k ; \ n \ n             c a s e   ' p o n g ' : \ n                 t h i s . s e t P i n g ( ) ; \ n                 t h i s . e m i t ( ' p o n g ' ) ; \ n                 b r e a k ; \ n \ n             c a s e   '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' : \ n                 v a r   e r r   =   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' s e r v e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ) ; \ n                 e r r . c o d e   =   p a c k e t . d a t a ; \ n                 t h i s . o n E r r o r ( e r r ) ; \ n                 b r e a k ; \ n \ n             c a s e   ' m e s s a g e ' : \ n                 t h i s . e m i t ( ' d a t a ' ,   p a c k e t . d a t a ) ; \ n                 t h i s . e m i t ( ' m e s s a g e ' ,   p a c k e t . d a t a ) ; \ n                 b r e a k ; \ n         } \ n     }   e l s e   { \ n         d e b u g ( ' p a c k e t   r e c e i v e d   w i t h   s o c k e t   r e a d y S t a t e   \ " % s \ " ' ,   t h i s . r e a d y S t a t e ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   h a n d s h a k e   c o m p l e t i o n . \ n   * \ n   *   @ p a r a m   { O b j e c t }   h a n d s h a k e   o b j \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n H a n d s h a k e   =   f u n c t i o n   ( d a t a )   { \ n     t h i s . e m i t ( ' h a n d s h a k e ' ,   d a t a ) ; \ n     t h i s . i d   =   d a t a . s i d ; \ n     t h i s . t r a n s p o r t . q u e r y . s i d   =   d a t a . s i d ; \ n     t h i s . u p g r a d e s   =   t h i s . f i l t e r U p g r a d e s ( d a t a . u p g r a d e s ) ; \ n     t h i s . p i n g I n t e r v a l   =   d a t a . p i n g I n t e r v a l ; \ n     t h i s . p i n g T i m e o u t   =   d a t a . p i n g T i m e o u t ; \ n     t h i s . o n O p e n ( ) ; \ n     / /   I n   c a s e   o p e n   h a n d l e r   c l o s e s   s o c k e t \ n     i f   ( ' c l o s e d '   = = =   t h i s . r e a d y S t a t e )   r e t u r n ; \ n     t h i s . s e t P i n g ( ) ; \ n \ n     / /   P r o l o n g   l i v e n e s s   o f   s o c k e t   o n   h e a r t b e a t \ n     t h i s . r e m o v e L i s t e n e r ( ' h e a r t b e a t ' ,   t h i s . o n H e a r t b e a t ) ; \ n     t h i s . o n ( ' h e a r t b e a t ' ,   t h i s . o n H e a r t b e a t ) ; \ n } ; \ n \ n / * * \ n   *   R e s e t s   p i n g   t i m e o u t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n H e a r t b e a t   =   f u n c t i o n   ( t i m e o u t )   { \ n     c l e a r T i m e o u t ( t h i s . p i n g T i m e o u t T i m e r ) ; \ n     v a r   s e l f   =   t h i s ; \ n     s e l f . p i n g T i m e o u t T i m e r   =   s e t T i m e o u t ( f u n c t i o n   ( )   { \ n         i f   ( ' c l o s e d '   = = =   s e l f . r e a d y S t a t e )   r e t u r n ; \ n         s e l f . o n C l o s e ( ' p i n g   t i m e o u t ' ) ; \ n     } ,   t i m e o u t   | |   ( s e l f . p i n g I n t e r v a l   +   s e l f . p i n g T i m e o u t ) ) ; \ n } ; \ n \ n / * * \ n   *   P i n g s   s e r v e r   e v e r y   ` t h i s . p i n g I n t e r v a l `   a n d   e x p e c t s   r e s p o n s e \ n   *   w i t h i n   ` t h i s . p i n g T i m e o u t `   o r   c l o s e s   c o n n e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . s e t P i n g   =   f u n c t i o n   ( )   { \ n     v a r   s e l f   =   t h i s ; \ n     c l e a r T i m e o u t ( s e l f . p i n g I n t e r v a l T i m e r ) ; \ n     s e l f . p i n g I n t e r v a l T i m e r   =   s e t T i m e o u t ( f u n c t i o n   ( )   { \ n         d e b u g ( ' w r i t i n g   p i n g   p a c k e t   -   e x p e c t i n g   p o n g   w i t h i n   % s m s ' ,   s e l f . p i n g T i m e o u t ) ; \ n         s e l f . p i n g ( ) ; \ n         s e l f . o n H e a r t b e a t ( s e l f . p i n g T i m e o u t ) ; \ n     } ,   s e l f . p i n g I n t e r v a l ) ; \ n } ; \ n \ n / * * \ n *   S e n d s   a   p i n g   p a c k e t . \ n * \ n *   @ a p i   p r i v a t e \ n * / \ n \ n S o c k e t . p r o t o t y p e . p i n g   =   f u n c t i o n   ( )   { \ n     v a r   s e l f   =   t h i s ; \ n     t h i s . s e n d P a c k e t ( ' p i n g ' ,   f u n c t i o n   ( )   { \ n         s e l f . e m i t ( ' p i n g ' ) ; \ n     } ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   o n   ` d r a i n `   e v e n t \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n D r a i n   =   f u n c t i o n   ( )   { \ n     t h i s . w r i t e B u f f e r . s p l i c e ( 0 ,   t h i s . p r e v B u f f e r L e n ) ; \ n \ n     / /   s e t t i n g   p r e v B u f f e r L e n   =   0   i s   v e r y   i m p o r t a n t \ n     / /   f o r   e x a m p l e ,   w h e n   u p g r a d i n g ,   u p g r a d e   p a c k e t   i s   s e n t   o v e r , \ n     / /   a n d   a   n o n z e r o   p r e v B u f f e r L e n   c o u l d   c a u s e   p r o b l e m s   o n   ` d r a i n ` \ n     t h i s . p r e v B u f f e r L e n   =   0 ; \ n \ n     i f   ( 0   = = =   t h i s . w r i t e B u f f e r . l e n g t h )   { \ n         t h i s . e m i t ( ' d r a i n ' ) ; \ n     }   e l s e   { \ n         t h i s . f l u s h ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   F l u s h   w r i t e   b u f f e r s . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . f l u s h   =   f u n c t i o n   ( )   { \ n     i f   ( ' c l o s e d '   ! = =   t h i s . r e a d y S t a t e   & &   t h i s . t r a n s p o r t . w r i t a b l e   & & \ n         ! t h i s . u p g r a d i n g   & &   t h i s . w r i t e B u f f e r . l e n g t h )   { \ n         d e b u g ( ' f l u s h i n g   % d   p a c k e t s   i n   s o c k e t ' ,   t h i s . w r i t e B u f f e r . l e n g t h ) ; \ n         t h i s . t r a n s p o r t . s e n d ( t h i s . w r i t e B u f f e r ) ; \ n         / /   k e e p   t r a c k   o f   c u r r e n t   l e n g t h   o f   w r i t e B u f f e r \ n         / /   s p l i c e   w r i t e B u f f e r   a n d   c a l l b a c k B u f f e r   o n   ` d r a i n ` \ n         t h i s . p r e v B u f f e r L e n   =   t h i s . w r i t e B u f f e r . l e n g t h ; \ n         t h i s . e m i t ( ' f l u s h ' ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   S e n d s   a   m e s s a g e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   m e s s a g e . \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k   f u n c t i o n . \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s . \ n   *   @ r e t u r n   { S o c k e t }   f o r   c h a i n i n g . \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . w r i t e   = \ n S o c k e t . p r o t o t y p e . s e n d   =   f u n c t i o n   ( m s g ,   o p t i o n s ,   f n )   { \ n     t h i s . s e n d P a c k e t ( ' m e s s a g e ' ,   m s g ,   o p t i o n s ,   f n ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e n d s   a   p a c k e t . \ n   * \ n   *   @ p a r a m   { S t r i n g }   p a c k e t   t y p e . \ n   *   @ p a r a m   { S t r i n g }   d a t a . \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s . \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k   f u n c t i o n . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . s e n d P a c k e t   =   f u n c t i o n   ( t y p e ,   d a t a ,   o p t i o n s ,   f n )   { \ n     i f   ( ' f u n c t i o n '   = = =   t y p e o f   d a t a )   { \ n         f n   =   d a t a ; \ n         d a t a   =   u n d e f i n e d ; \ n     } \ n \ n     i f   ( ' f u n c t i o n '   = = =   t y p e o f   o p t i o n s )   { \ n         f n   =   o p t i o n s ; \ n         o p t i o n s   =   n u l l ; \ n     } \ n \ n     i f   ( ' c l o s i n g '   = = =   t h i s . r e a d y S t a t e   | |   ' c l o s e d '   = = =   t h i s . r e a d y S t a t e )   { \ n         r e t u r n ; \ n     } \ n \ n     o p t i o n s   =   o p t i o n s   | |   { } ; \ n     o p t i o n s . c o m p r e s s   =   f a l s e   ! = =   o p t i o n s . c o m p r e s s ; \ n \ n     v a r   p a c k e t   =   { \ n         t y p e :   t y p e , \ n         d a t a :   d a t a , \ n         o p t i o n s :   o p t i o n s \ n     } ; \ n     t h i s . e m i t ( ' p a c k e t C r e a t e ' ,   p a c k e t ) ; \ n     t h i s . w r i t e B u f f e r . p u s h ( p a c k e t ) ; \ n     i f   ( f n )   t h i s . o n c e ( ' f l u s h ' ,   f n ) ; \ n     t h i s . f l u s h ( ) ; \ n } ; \ n \ n / * * \ n   *   C l o s e s   t h e   c o n n e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . c l o s e   =   f u n c t i o n   ( )   { \ n     i f   ( ' o p e n i n g '   = = =   t h i s . r e a d y S t a t e   | |   ' o p e n '   = = =   t h i s . r e a d y S t a t e )   { \ n         t h i s . r e a d y S t a t e   =   ' c l o s i n g ' ; \ n \ n         v a r   s e l f   =   t h i s ; \ n \ n         i f   ( t h i s . w r i t e B u f f e r . l e n g t h )   { \ n             t h i s . o n c e ( ' d r a i n ' ,   f u n c t i o n   ( )   { \ n                 i f   ( t h i s . u p g r a d i n g )   { \ n                     w a i t F o r U p g r a d e ( ) ; \ n                 }   e l s e   { \ n                     c l o s e ( ) ; \ n                 } \ n             } ) ; \ n         }   e l s e   i f   ( t h i s . u p g r a d i n g )   { \ n             w a i t F o r U p g r a d e ( ) ; \ n         }   e l s e   { \ n             c l o s e ( ) ; \ n         } \ n     } \ n \ n     f u n c t i o n   c l o s e   ( )   { \ n         s e l f . o n C l o s e ( ' f o r c e d   c l o s e ' ) ; \ n         d e b u g ( ' s o c k e t   c l o s i n g   -   t e l l i n g   t r a n s p o r t   t o   c l o s e ' ) ; \ n         s e l f . t r a n s p o r t . c l o s e ( ) ; \ n     } \ n \ n     f u n c t i o n   c l e a n u p A n d C l o s e   ( )   { \ n         s e l f . r e m o v e L i s t e n e r ( ' u p g r a d e ' ,   c l e a n u p A n d C l o s e ) ; \ n         s e l f . r e m o v e L i s t e n e r ( ' u p g r a d e E r r o r ' ,   c l e a n u p A n d C l o s e ) ; \ n         c l o s e ( ) ; \ n     } \ n \ n     f u n c t i o n   w a i t F o r U p g r a d e   ( )   { \ n         / /   w a i t   f o r   u p g r a d e   t o   f i n i s h   s i n c e   w e   c a n ' t   s e n d   p a c k e t s   w h i l e   p a u s i n g   a   t r a n s p o r t \ n         s e l f . o n c e ( ' u p g r a d e ' ,   c l e a n u p A n d C l o s e ) ; \ n         s e l f . o n c e ( ' u p g r a d e E r r o r ' ,   c l e a n u p A n d C l o s e ) ; \ n     } \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   t r a n s p o r t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n E r r o r   =   f u n c t i o n   ( e r r )   { \ n     d e b u g ( ' s o c k e t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   % j ' ,   e r r ) ; \ n     S o c k e t . p r i o r W e b s o c k e t S u c c e s s   =   f a l s e ; \ n     t h i s . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     t h i s . o n C l o s e ( ' t r a n s p o r t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   t r a n s p o r t   c l o s e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n C l o s e   =   f u n c t i o n   ( r e a s o n ,   d e s c )   { \ n     i f   ( ' o p e n i n g '   = = =   t h i s . r e a d y S t a t e   | |   ' o p e n '   = = =   t h i s . r e a d y S t a t e   | |   ' c l o s i n g '   = = =   t h i s . r e a d y S t a t e )   { \ n         d e b u g ( ' s o c k e t   c l o s e   w i t h   r e a s o n :   \ " % s \ " ' ,   r e a s o n ) ; \ n         v a r   s e l f   =   t h i s ; \ n \ n         / /   c l e a r   t i m e r s \ n         c l e a r T i m e o u t ( t h i s . p i n g I n t e r v a l T i m e r ) ; \ n         c l e a r T i m e o u t ( t h i s . p i n g T i m e o u t T i m e r ) ; \ n \ n         / /   s t o p   e v e n t   f r o m   f i r i n g   a g a i n   f o r   t r a n s p o r t \ n         t h i s . t r a n s p o r t . r e m o v e A l l L i s t e n e r s ( ' c l o s e ' ) ; \ n \ n         / /   e n s u r e   t r a n s p o r t   w o n ' t   s t a y   o p e n \ n         t h i s . t r a n s p o r t . c l o s e ( ) ; \ n \ n         / /   i g n o r e   f u r t h e r   t r a n s p o r t   c o m m u n i c a t i o n \ n         t h i s . t r a n s p o r t . r e m o v e A l l L i s t e n e r s ( ) ; \ n \ n         / /   s e t   r e a d y   s t a t e \ n         t h i s . r e a d y S t a t e   =   ' c l o s e d ' ; \ n \ n         / /   c l e a r   s e s s i o n   i d \ n         t h i s . i d   =   n u l l ; \ n \ n         / /   e m i t   c l o s e   e v e n t \ n         t h i s . e m i t ( ' c l o s e ' ,   r e a s o n ,   d e s c ) ; \ n \ n         / /   c l e a n   b u f f e r s   a f t e r ,   s o   u s e r s   c a n   s t i l l \ n         / /   g r a b   t h e   b u f f e r s   o n   ` c l o s e `   e v e n t \ n         s e l f . w r i t e B u f f e r   =   [ ] ; \ n         s e l f . p r e v B u f f e r L e n   =   0 ; \ n     } \ n } ; \ n \ n / * * \ n   *   F i l t e r s   u p g r a d e s ,   r e t u r n i n g   o n l y   t h o s e   m a t c h i n g   c l i e n t   t r a n s p o r t s . \ n   * \ n   *   @ p a r a m   { A r r a y }   s e r v e r   u p g r a d e s \ n   *   @ a p i   p r i v a t e \ n   * \ n   * / \ n \ n S o c k e t . p r o t o t y p e . f i l t e r U p g r a d e s   =   f u n c t i o n   ( u p g r a d e s )   { \ n     v a r   f i l t e r e d U p g r a d e s   =   [ ] ; \ n     f o r   ( v a r   i   =   0 ,   j   =   u p g r a d e s . l e n g t h ;   i   <   j ;   i + + )   { \ n         i f   ( ~ i n d e x ( t h i s . t r a n s p o r t s ,   u p g r a d e s [ i ] ) )   f i l t e r e d U p g r a d e s . p u s h ( u p g r a d e s [ i ] ) ; \ n     } \ n     r e t u r n   f i l t e r e d U p g r a d e s ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / s o c k e t . j s \ n / /   m o d u l e   i d   =   2 0 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s \ n   * / \ n \ n v a r   X M L H t t p R e q u e s t   =   r e q u i r e ( ' x m l h t t p r e q u e s t - s s l ' ) ; \ n v a r   X H R   =   r e q u i r e ( ' . / p o l l i n g - x h r ' ) ; \ n v a r   J S O N P   =   r e q u i r e ( ' . / p o l l i n g - j s o n p ' ) ; \ n v a r   w e b s o c k e t   =   r e q u i r e ( ' . / w e b s o c k e t ' ) ; \ n \ n / * * \ n   *   E x p o r t   t r a n s p o r t s . \ n   * / \ n \ n e x p o r t s . p o l l i n g   =   p o l l i n g ; \ n e x p o r t s . w e b s o c k e t   =   w e b s o c k e t ; \ n \ n / * * \ n   *   P o l l i n g   t r a n s p o r t   p o l y m o r p h i c   c o n s t r u c t o r . \ n   *   D e c i d e s   o n   x h r   v s   j s o n p   b a s e d   o n   f e a t u r e   d e t e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   p o l l i n g   ( o p t s )   { \ n     v a r   x h r ; \ n     v a r   x d   =   f a l s e ; \ n     v a r   x s   =   f a l s e ; \ n     v a r   j s o n p   =   f a l s e   ! = =   o p t s . j s o n p ; \ n \ n     i f   ( g l o b a l . l o c a t i o n )   { \ n         v a r   i s S S L   =   ' h t t p s : '   = = =   l o c a t i o n . p r o t o c o l ; \ n         v a r   p o r t   =   l o c a t i o n . p o r t ; \ n \ n         / /   s o m e   u s e r   a g e n t s   h a v e   e m p t y   ` l o c a t i o n . p o r t ` \ n         i f   ( ! p o r t )   { \ n             p o r t   =   i s S S L   ?   4 4 3   :   8 0 ; \ n         } \ n \ n         x d   =   o p t s . h o s t n a m e   ! = =   l o c a t i o n . h o s t n a m e   | |   p o r t   ! = =   o p t s . p o r t ; \ n         x s   =   o p t s . s e c u r e   ! = =   i s S S L ; \ n     } \ n \ n     o p t s . x d o m a i n   =   x d ; \ n     o p t s . x s c h e m e   =   x s ; \ n     x h r   =   n e w   X M L H t t p R e q u e s t ( o p t s ) ; \ n \ n     i f   ( ' o p e n '   i n   x h r   & &   ! o p t s . f o r c e J S O N P )   { \ n         r e t u r n   n e w   X H R ( o p t s ) ; \ n     }   e l s e   { \ n         i f   ( ! j s o n p )   t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' J S O N P   d i s a b l e d ' ) ; \ n         r e t u r n   n e w   J S O N P ( o p t s ) ; \ n     } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / i n d e x . j s \ n / /   m o d u l e   i d   =   2 1 \ n / /   m o d u l e   c h u n k s   =   0 " , " / /   b r o w s e r   s h i m   f o r   x m l h t t p r e q u e s t   m o d u l e \ n \ n v a r   h a s C O R S   =   r e q u i r e ( ' h a s - c o r s ' ) ; \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n   ( o p t s )   { \ n     v a r   x d o m a i n   =   o p t s . x d o m a i n ; \ n \ n     / /   s c h e m e    [ 1 m  [ 3 3 m m u s t  [ 3 9 m  [ 2 2 m  [ 1 m   b e   s a m e   w h e n   u s i g n   X D o m a i n R e q u e s t \ n     / /   h t t p : / / b l o g s . m s d n . c o m / b / i e i n t e r n a l s / a r c h i v e / 2 0 1 0 / 0 5 / 1 3 / x d o m a i n r e q u e s t - r e s t r i c t i o n s - l i m i t a t i o n s - a n d - w o r k a r o u n d s . a s p x \ n     v a r   x s c h e m e   =   o p t s . x s c h e m e ; \ n \ n     / /   X D o m a i n R e q u e s t   h a s   a   f l o w   o f   n o t   s e n d i n g   c o o k i e ,   t h e r e f o r e   i t   s h o u l d   b e   d i s a b l e d   a s   a   d e f a u l t . \ n     / /   h t t p s : / / g i t h u b . c o m / A u t o m a t t i c / e n g i n e . i o - c l i e n t / p u l l / 2 1 7 \ n     v a r   e n a b l e s X D R   =   o p t s . e n a b l e s X D R ; \ n \ n     / /   X M L H t t p R e q u e s t   c a n   b e   d i s a b l e d   o n   I E \ n     t r y   { \ n         i f   ( ' u n d e f i n e d '   ! = =   t y p e o f   X M L H t t p R e q u e s t   & &   ( ! x d o m a i n   | |   h a s C O R S ) )   { \ n             r e t u r n   n e w   X M L H t t p R e q u e s t ( ) ; \ n         } \ n     }   c a t c h   ( e )   {   } \ n \ n     / /   U s e   X D o m a i n R e q u e s t   f o r   I E 8   i f   e n a b l e s X D R   i s   t r u e \ n     / /   b e c a u s e   l o a d i n g   b a r   k e e p s   f l a s h i n g   w h e n   u s i n g   j s o n p - p o l l i n g \ n     / /   h t t p s : / / g i t h u b . c o m / y u j i o s a k a / s o c k e . i o - i e 8 - l o a d i n g - e x a m p l e \ n     t r y   { \ n         i f   ( ' u n d e f i n e d '   ! = =   t y p e o f   X D o m a i n R e q u e s t   & &   ! x s c h e m e   & &   e n a b l e s X D R )   { \ n             r e t u r n   n e w   X D o m a i n R e q u e s t ( ) ; \ n         } \ n     }   c a t c h   ( e )   {   } \ n \ n     i f   ( ! x d o m a i n )   { \ n         t r y   { \ n             r e t u r n   n e w   g l o b a l [ [ ' A c t i v e ' ] . c o n c a t ( ' O b j e c t ' ) . j o i n ( ' X ' ) ] ( ' M i c r o s o f t . X M L H T T P ' ) ; \ n         }   c a t c h   ( e )   {   } \ n     } \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / x m l h t t p r e q u e s t . j s \ n / /   m o d u l e   i d   =   2 2 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * \ n   *   L o g i c   b o r r o w e d   f r o m   M o d e r n i z r : \ n   * \ n   *       -   h t t p s : / / g i t h u b . c o m / M o d e r n i z r / M o d e r n i z r / b l o b / m a s t e r / f e a t u r e - d e t e c t s / c o r s . j s \ n   * / \ n \ n t r y   { \ n     m o d u l e . e x p o r t s   =   t y p e o f   X M L H t t p R e q u e s t   ! = =   ' u n d e f i n e d '   & & \ n         ' w i t h C r e d e n t i a l s '   i n   n e w   X M L H t t p R e q u e s t ( ) ; \ n }   c a t c h   ( e r r )   { \ n     / /   i f   X M L H t t p   s u p p o r t   i s   d i s a b l e d   i n   I E   t h e n   i t   w i l l   t h r o w \ n     / /   w h e n   t r y i n g   t o   c r e a t e \ n     m o d u l e . e x p o r t s   =   f a l s e ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / h a s - c o r s / i n d e x . j s \ n / /   m o d u l e   i d   =   2 3 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   r e q u i r e m e n t s . \ n   * / \ n \ n v a r   X M L H t t p R e q u e s t   =   r e q u i r e ( ' x m l h t t p r e q u e s t - s s l ' ) ; \ n v a r   P o l l i n g   =   r e q u i r e ( ' . / p o l l i n g ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   i n h e r i t   =   r e q u i r e ( ' c o m p o n e n t - i n h e r i t ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' e n g i n e . i o - c l i e n t : p o l l i n g - x h r ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   X H R ; \ n m o d u l e . e x p o r t s . R e q u e s t   =   R e q u e s t ; \ n \ n / * * \ n   *   E m p t y   f u n c t i o n \ n   * / \ n \ n f u n c t i o n   e m p t y   ( )   { } \ n \ n / * * \ n   *   X H R   P o l l i n g   c o n s t r u c t o r . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   X H R   ( o p t s )   { \ n     P o l l i n g . c a l l ( t h i s ,   o p t s ) ; \ n     t h i s . r e q u e s t T i m e o u t   =   o p t s . r e q u e s t T i m e o u t ; \ n \ n     i f   ( g l o b a l . l o c a t i o n )   { \ n         v a r   i s S S L   =   ' h t t p s : '   = = =   l o c a t i o n . p r o t o c o l ; \ n         v a r   p o r t   =   l o c a t i o n . p o r t ; \ n \ n         / /   s o m e   u s e r   a g e n t s   h a v e   e m p t y   ` l o c a t i o n . p o r t ` \ n         i f   ( ! p o r t )   { \ n             p o r t   =   i s S S L   ?   4 4 3   :   8 0 ; \ n         } \ n \ n         t h i s . x d   =   o p t s . h o s t n a m e   ! = =   g l o b a l . l o c a t i o n . h o s t n a m e   | | \ n             p o r t   ! = =   o p t s . p o r t ; \ n         t h i s . x s   =   o p t s . s e c u r e   ! = =   i s S S L ; \ n     }   e l s e   { \ n         t h i s . e x t r a H e a d e r s   =   o p t s . e x t r a H e a d e r s ; \ n     } \ n } \ n \ n / * * \ n   *   I n h e r i t s   f r o m   P o l l i n g . \ n   * / \ n \ n i n h e r i t ( X H R ,   P o l l i n g ) ; \ n \ n / * * \ n   *   X H R   s u p p o r t s   b i n a r y \ n   * / \ n \ n X H R . p r o t o t y p e . s u p p o r t s B i n a r y   =   t r u e ; \ n \ n / * * \ n   *   C r e a t e s   a   r e q u e s t . \ n   * \ n   *   @ p a r a m   { S t r i n g }   m e t h o d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n X H R . p r o t o t y p e . r e q u e s t   =   f u n c t i o n   ( o p t s )   { \ n     o p t s   =   o p t s   | |   { } ; \ n     o p t s . u r i   =   t h i s . u r i ( ) ; \ n     o p t s . x d   =   t h i s . x d ; \ n     o p t s . x s   =   t h i s . x s ; \ n     o p t s . a g e n t   =   t h i s . a g e n t   | |   f a l s e ; \ n     o p t s . s u p p o r t s B i n a r y   =   t h i s . s u p p o r t s B i n a r y ; \ n     o p t s . e n a b l e s X D R   =   t h i s . e n a b l e s X D R ; \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     o p t s . p f x   =   t h i s . p f x ; \ n     o p t s . k e y   =   t h i s . k e y ; \ n     o p t s . p a s s p h r a s e   =   t h i s . p a s s p h r a s e ; \ n     o p t s . c e r t   =   t h i s . c e r t ; \ n     o p t s . c a   =   t h i s . c a ; \ n     o p t s . c i p h e r s   =   t h i s . c i p h e r s ; \ n     o p t s . r e j e c t U n a u t h o r i z e d   =   t h i s . r e j e c t U n a u t h o r i z e d ; \ n     o p t s . r e q u e s t T i m e o u t   =   t h i s . r e q u e s t T i m e o u t ; \ n \ n     / /   o t h e r   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     o p t s . e x t r a H e a d e r s   =   t h i s . e x t r a H e a d e r s ; \ n \ n     r e t u r n   n e w   R e q u e s t ( o p t s ) ; \ n } ; \ n \ n / * * \ n   *   S e n d s   d a t a . \ n   * \ n   *   @ p a r a m   { S t r i n g }   d a t a   t o   s e n d . \ n   *   @ p a r a m   { F u n c t i o n }   c a l l e d   u p o n   f l u s h . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n X H R . p r o t o t y p e . d o W r i t e   =   f u n c t i o n   ( d a t a ,   f n )   { \ n     v a r   i s B i n a r y   =   t y p e o f   d a t a   ! = =   ' s t r i n g '   & &   d a t a   ! = =   u n d e f i n e d ; \ n     v a r   r e q   =   t h i s . r e q u e s t ( {   m e t h o d :   ' P O S T ' ,   d a t a :   d a t a ,   i s B i n a r y :   i s B i n a r y   } ) ; \ n     v a r   s e l f   =   t h i s ; \ n     r e q . o n ( ' s u c c e s s ' ,   f n ) ; \ n     r e q . o n ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   f u n c t i o n   ( e r r )   { \ n         s e l f . o n E r r o r ( ' x h r   p o s t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     } ) ; \ n     t h i s . s e n d X h r   =   r e q ; \ n } ; \ n \ n / * * \ n   *   S t a r t s   a   p o l l   c y c l e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n X H R . p r o t o t y p e . d o P o l l   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' x h r   p o l l ' ) ; \ n     v a r   r e q   =   t h i s . r e q u e s t ( ) ; \ n     v a r   s e l f   =   t h i s ; \ n     r e q . o n ( ' d a t a ' ,   f u n c t i o n   ( d a t a )   { \ n         s e l f . o n D a t a ( d a t a ) ; \ n     } ) ; \ n     r e q . o n ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   f u n c t i o n   ( e r r )   { \ n         s e l f . o n E r r o r ( ' x h r   p o l l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     } ) ; \ n     t h i s . p o l l X h r   =   r e q ; \ n } ; \ n \ n / * * \ n   *   R e q u e s t   c o n s t r u c t o r \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   R e q u e s t   ( o p t s )   { \ n     t h i s . m e t h o d   =   o p t s . m e t h o d   | |   ' G E T ' ; \ n     t h i s . u r i   =   o p t s . u r i ; \ n     t h i s . x d   =   ! ! o p t s . x d ; \ n     t h i s . x s   =   ! ! o p t s . x s ; \ n     t h i s . a s y n c   =   f a l s e   ! = =   o p t s . a s y n c ; \ n     t h i s . d a t a   =   u n d e f i n e d   ! = =   o p t s . d a t a   ?   o p t s . d a t a   :   n u l l ; \ n     t h i s . a g e n t   =   o p t s . a g e n t ; \ n     t h i s . i s B i n a r y   =   o p t s . i s B i n a r y ; \ n     t h i s . s u p p o r t s B i n a r y   =   o p t s . s u p p o r t s B i n a r y ; \ n     t h i s . e n a b l e s X D R   =   o p t s . e n a b l e s X D R ; \ n     t h i s . r e q u e s t T i m e o u t   =   o p t s . r e q u e s t T i m e o u t ; \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     t h i s . p f x   =   o p t s . p f x ; \ n     t h i s . k e y   =   o p t s . k e y ; \ n     t h i s . p a s s p h r a s e   =   o p t s . p a s s p h r a s e ; \ n     t h i s . c e r t   =   o p t s . c e r t ; \ n     t h i s . c a   =   o p t s . c a ; \ n     t h i s . c i p h e r s   =   o p t s . c i p h e r s ; \ n     t h i s . r e j e c t U n a u t h o r i z e d   =   o p t s . r e j e c t U n a u t h o r i z e d ; \ n \ n     / /   o t h e r   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     t h i s . e x t r a H e a d e r s   =   o p t s . e x t r a H e a d e r s ; \ n \ n     t h i s . c r e a t e ( ) ; \ n } \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r ` . \ n   * / \ n \ n E m i t t e r ( R e q u e s t . p r o t o t y p e ) ; \ n \ n / * * \ n   *   C r e a t e s   t h e   X H R   o b j e c t   a n d   s e n d s   t h e   r e q u e s t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . c r e a t e   =   f u n c t i o n   ( )   { \ n     v a r   o p t s   =   {   a g e n t :   t h i s . a g e n t ,   x d o m a i n :   t h i s . x d ,   x s c h e m e :   t h i s . x s ,   e n a b l e s X D R :   t h i s . e n a b l e s X D R   } ; \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     o p t s . p f x   =   t h i s . p f x ; \ n     o p t s . k e y   =   t h i s . k e y ; \ n     o p t s . p a s s p h r a s e   =   t h i s . p a s s p h r a s e ; \ n     o p t s . c e r t   =   t h i s . c e r t ; \ n     o p t s . c a   =   t h i s . c a ; \ n     o p t s . c i p h e r s   =   t h i s . c i p h e r s ; \ n     o p t s . r e j e c t U n a u t h o r i z e d   =   t h i s . r e j e c t U n a u t h o r i z e d ; \ n \ n     v a r   x h r   =   t h i s . x h r   =   n e w   X M L H t t p R e q u e s t ( o p t s ) ; \ n     v a r   s e l f   =   t h i s ; \ n \ n     t r y   { \ n         d e b u g ( ' x h r   o p e n   % s :   % s ' ,   t h i s . m e t h o d ,   t h i s . u r i ) ; \ n         x h r . o p e n ( t h i s . m e t h o d ,   t h i s . u r i ,   t h i s . a s y n c ) ; \ n         t r y   { \ n             i f   ( t h i s . e x t r a H e a d e r s )   { \ n                 x h r . s e t D i s a b l e H e a d e r C h e c k ( t r u e ) ; \ n                 f o r   ( v a r   i   i n   t h i s . e x t r a H e a d e r s )   { \ n                     i f   ( t h i s . e x t r a H e a d e r s . h a s O w n P r o p e r t y ( i ) )   { \ n                         x h r . s e t R e q u e s t H e a d e r ( i ,   t h i s . e x t r a H e a d e r s [ i ] ) ; \ n                     } \ n                 } \ n             } \ n         }   c a t c h   ( e )   { } \ n         i f   ( t h i s . s u p p o r t s B i n a r y )   { \ n             / /   T h i s   h a s   t o   b e   d o n e   a f t e r   o p e n   b e c a u s e   F i r e f o x   i s   s t u p i d \ n             / /   h t t p : / / s t a c k o v e r f l o w . c o m / q u e s t i o n s / 1 3 2 1 6 9 0 3 / g e t - b i n a r y - d a t a - w i t h - x m l h t t p r e q u e s t - i n - a - f i r e f o x - e x t e n s i o n \ n             x h r . r e s p o n s e T y p e   =   ' a r r a y b u f f e r ' ; \ n         } \ n \ n         i f   ( ' P O S T '   = = =   t h i s . m e t h o d )   { \ n             t r y   { \ n                 i f   ( t h i s . i s B i n a r y )   { \ n                     x h r . s e t R e q u e s t H e a d e r ( ' C o n t e n t - t y p e ' ,   ' a p p l i c a t i o n / o c t e t - s t r e a m ' ) ; \ n                 }   e l s e   { \ n                     x h r . s e t R e q u e s t H e a d e r ( ' C o n t e n t - t y p e ' ,   ' t e x t / p l a i n ; c h a r s e t = U T F - 8 ' ) ; \ n                 } \ n             }   c a t c h   ( e )   { } \ n         } \ n \ n         t r y   { \ n             x h r . s e t R e q u e s t H e a d e r ( ' A c c e p t ' ,   ' * / * ' ) ; \ n         }   c a t c h   ( e )   { } \ n \ n         / /   i e 6   c h e c k \ n         i f   ( ' w i t h C r e d e n t i a l s '   i n   x h r )   { \ n             x h r . w i t h C r e d e n t i a l s   =   t r u e ; \ n         } \ n \ n         i f   ( t h i s . r e q u e s t T i m e o u t )   { \ n             x h r . t i m e o u t   =   t h i s . r e q u e s t T i m e o u t ; \ n         } \ n \ n         i f   ( t h i s . h a s X D R ( ) )   { \ n             x h r . o n l o a d   =   f u n c t i o n   ( )   { \ n                 s e l f . o n L o a d ( ) ; \ n             } ; \ n             x h r . o n e r r o r   =   f u n c t i o n   ( )   { \ n                 s e l f . o n E r r o r ( x h r . r e s p o n s e T e x t ) ; \ n             } ; \ n         }   e l s e   { \ n             x h r . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { \ n                 i f   ( 4   ! = =   x h r . r e a d y S t a t e )   r e t u r n ; \ n                 i f   ( 2 0 0   = = =   x h r . s t a t u s   | |   1 2 2 3   = = =   x h r . s t a t u s )   { \ n                     s e l f . o n L o a d ( ) ; \ n                 }   e l s e   { \ n                     / /   m a k e   s u r e   t h e   `  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m `   e v e n t   h a n d l e r   t h a t ' s   u s e r - s e t \ n                     / /   d o e s   n o t   t h r o w   i n   t h e   s a m e   t i c k   a n d   g e t s   c a u g h t   h e r e \ n                     s e t T i m e o u t ( f u n c t i o n   ( )   { \ n                         s e l f . o n E r r o r ( x h r . s t a t u s ) ; \ n                     } ,   0 ) ; \ n                 } \ n             } ; \ n         } \ n \ n         d e b u g ( ' x h r   d a t a   % s ' ,   t h i s . d a t a ) ; \ n         x h r . s e n d ( t h i s . d a t a ) ; \ n     }   c a t c h   ( e )   { \ n         / /   N e e d   t o   d e f e r   s i n c e   . c r e a t e ( )   i s   c a l l e d   d i r e c t l y   f h r o m   t h e   c o n s t r u c t o r \ n         / /   a n d   t h u s   t h e   '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m '   e v e n t   c a n   o n l y   b e   o n l y   b o u n d   * a f t e r *   t h i s   e x c e p t i o n \ n         / /   o c c u r s .     T h e r e f o r e ,   a l s o ,   w e   c a n n o t   t h r o w   h e r e   a t   a l l . \ n         s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             s e l f . o n E r r o r ( e ) ; \ n         } ,   0 ) ; \ n         r e t u r n ; \ n     } \ n \ n     i f   ( g l o b a l . d o c u m e n t )   { \ n         t h i s . i n d e x   =   R e q u e s t . r e q u e s t s C o u n t + + ; \ n         R e q u e s t . r e q u e s t s [ t h i s . i n d e x ]   =   t h i s ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   s u c c e s s f u l   r e s p o n s e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . o n S u c c e s s   =   f u n c t i o n   ( )   { \ n     t h i s . e m i t ( ' s u c c e s s ' ) ; \ n     t h i s . c l e a n u p ( ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   i f   w e   h a v e   d a t a . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . o n D a t a   =   f u n c t i o n   ( d a t a )   { \ n     t h i s . e m i t ( ' d a t a ' ,   d a t a ) ; \ n     t h i s . o n S u c c e s s ( ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . o n E r r o r   =   f u n c t i o n   ( e r r )   { \ n     t h i s . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     t h i s . c l e a n u p ( t r u e ) ; \ n } ; \ n \ n / * * \ n   *   C l e a n s   u p   h o u s e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . c l e a n u p   =   f u n c t i o n   ( f r o m E r r o r )   { \ n     i f   ( ' u n d e f i n e d '   = = =   t y p e o f   t h i s . x h r   | |   n u l l   = = =   t h i s . x h r )   { \ n         r e t u r n ; \ n     } \ n     / /   x m l h t t p r e q u e s t \ n     i f   ( t h i s . h a s X D R ( ) )   { \ n         t h i s . x h r . o n l o a d   =   t h i s . x h r . o n e r r o r   =   e m p t y ; \ n     }   e l s e   { \ n         t h i s . x h r . o n r e a d y s t a t e c h a n g e   =   e m p t y ; \ n     } \ n \ n     i f   ( f r o m E r r o r )   { \ n         t r y   { \ n             t h i s . x h r . a b o r t ( ) ; \ n         }   c a t c h   ( e )   { } \ n     } \ n \ n     i f   ( g l o b a l . d o c u m e n t )   { \ n         d e l e t e   R e q u e s t . r e q u e s t s [ t h i s . i n d e x ] ; \ n     } \ n \ n     t h i s . x h r   =   n u l l ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   l o a d . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . o n L o a d   =   f u n c t i o n   ( )   { \ n     v a r   d a t a ; \ n     t r y   { \ n         v a r   c o n t e n t T y p e ; \ n         t r y   { \ n             c o n t e n t T y p e   =   t h i s . x h r . g e t R e s p o n s e H e a d e r ( ' C o n t e n t - T y p e ' ) . s p l i t ( ' ; ' ) [ 0 ] ; \ n         }   c a t c h   ( e )   { } \ n         i f   ( c o n t e n t T y p e   = = =   ' a p p l i c a t i o n / o c t e t - s t r e a m ' )   { \ n             d a t a   =   t h i s . x h r . r e s p o n s e   | |   t h i s . x h r . r e s p o n s e T e x t ; \ n         }   e l s e   { \ n             i f   ( ! t h i s . s u p p o r t s B i n a r y )   { \ n                 d a t a   =   t h i s . x h r . r e s p o n s e T e x t ; \ n             }   e l s e   { \ n                 t r y   { \ n                     d a t a   =   S t r i n g . f r o m C h a r C o d e . a p p l y ( n u l l ,   n e w   U i n t 8 A r r a y ( t h i s . x h r . r e s p o n s e ) ) ; \ n                 }   c a t c h   ( e )   { \ n                     v a r   u i 8 A r r   =   n e w   U i n t 8 A r r a y ( t h i s . x h r . r e s p o n s e ) ; \ n                     v a r   d a t a A r r a y   =   [ ] ; \ n                     f o r   ( v a r   i d x   =   0 ,   l e n g t h   =   u i 8 A r r . l e n g t h ;   i d x   <   l e n g t h ;   i d x + + )   { \ n                         d a t a A r r a y . p u s h ( u i 8 A r r [ i d x ] ) ; \ n                     } \ n \ n                     d a t a   =   S t r i n g . f r o m C h a r C o d e . a p p l y ( n u l l ,   d a t a A r r a y ) ; \ n                 } \ n             } \ n         } \ n     }   c a t c h   ( e )   { \ n         t h i s . o n E r r o r ( e ) ; \ n     } \ n     i f   ( n u l l   ! =   d a t a )   { \ n         t h i s . o n D a t a ( d a t a ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C h e c k   i f   i t   h a s   X D o m a i n R e q u e s t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . h a s X D R   =   f u n c t i o n   ( )   { \ n     r e t u r n   ' u n d e f i n e d '   ! = =   t y p e o f   g l o b a l . X D o m a i n R e q u e s t   & &   ! t h i s . x s   & &   t h i s . e n a b l e s X D R ; \ n } ; \ n \ n / * * \ n   *   A b o r t s   t h e   r e q u e s t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n R e q u e s t . p r o t o t y p e . a b o r t   =   f u n c t i o n   ( )   { \ n     t h i s . c l e a n u p ( ) ; \ n } ; \ n \ n / * * \ n   *   A b o r t s   p e n d i n g   r e q u e s t s   w h e n   u n l o a d i n g   t h e   w i n d o w .   T h i s   i s   n e e d e d   t o   p r e v e n t \ n   *   m e m o r y   l e a k s   ( e . g .   w h e n   u s i n g   I E )   a n d   t o   e n s u r e   t h a t   n o   s p u r i o u s    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i s \ n   *   e m i t t e d . \ n   * / \ n \ n R e q u e s t . r e q u e s t s C o u n t   =   0 ; \ n R e q u e s t . r e q u e s t s   =   { } ; \ n \ n i f   ( g l o b a l . d o c u m e n t )   { \ n     i f   ( g l o b a l . a t t a c h E v e n t )   { \ n         g l o b a l . a t t a c h E v e n t ( ' o n u n l o a d ' ,   u n l o a d H a n d l e r ) ; \ n     }   e l s e   i f   ( g l o b a l . a d d E v e n t L i s t e n e r )   { \ n         g l o b a l . a d d E v e n t L i s t e n e r ( ' b e f o r e u n l o a d ' ,   u n l o a d H a n d l e r ,   f a l s e ) ; \ n     } \ n } \ n \ n f u n c t i o n   u n l o a d H a n d l e r   ( )   { \ n     f o r   ( v a r   i   i n   R e q u e s t . r e q u e s t s )   { \ n         i f   ( R e q u e s t . r e q u e s t s . h a s O w n P r o p e r t y ( i ) )   { \ n             R e q u e s t . r e q u e s t s [ i ] . a b o r t ( ) ; \ n         } \ n     } \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g - x h r . j s \ n / /   m o d u l e   i d   =   2 4 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   T r a n s p o r t   =   r e q u i r e ( ' . . / t r a n s p o r t ' ) ; \ n v a r   p a r s e q s   =   r e q u i r e ( ' p a r s e q s ' ) ; \ n v a r   p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n v a r   i n h e r i t   =   r e q u i r e ( ' c o m p o n e n t - i n h e r i t ' ) ; \ n v a r   y e a s t   =   r e q u i r e ( ' y e a s t ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' e n g i n e . i o - c l i e n t : p o l l i n g ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   P o l l i n g ; \ n \ n / * * \ n   *   I s   X H R 2   s u p p o r t e d ? \ n   * / \ n \ n v a r   h a s X H R 2   =   ( f u n c t i o n   ( )   { \ n     v a r   X M L H t t p R e q u e s t   =   r e q u i r e ( ' x m l h t t p r e q u e s t - s s l ' ) ; \ n     v a r   x h r   =   n e w   X M L H t t p R e q u e s t ( {   x d o m a i n :   f a l s e   } ) ; \ n     r e t u r n   n u l l   ! =   x h r . r e s p o n s e T y p e ; \ n } ) ( ) ; \ n \ n / * * \ n   *   P o l l i n g   i n t e r f a c e . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   P o l l i n g   ( o p t s )   { \ n     v a r   f o r c e B a s e 6 4   =   ( o p t s   & &   o p t s . f o r c e B a s e 6 4 ) ; \ n     i f   ( ! h a s X H R 2   | |   f o r c e B a s e 6 4 )   { \ n         t h i s . s u p p o r t s B i n a r y   =   f a l s e ; \ n     } \ n     T r a n s p o r t . c a l l ( t h i s ,   o p t s ) ; \ n } \ n \ n / * * \ n   *   I n h e r i t s   f r o m   T r a n s p o r t . \ n   * / \ n \ n i n h e r i t ( P o l l i n g ,   T r a n s p o r t ) ; \ n \ n / * * \ n   *   T r a n s p o r t   n a m e . \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . n a m e   =   ' p o l l i n g ' ; \ n \ n / * * \ n   *   O p e n s   t h e   s o c k e t   ( t r i g g e r s   p o l l i n g ) .   W e   w r i t e   a   P I N G   m e s s a g e   t o   d e t e r m i n e \ n   *   w h e n   t h e   t r a n s p o r t   i s   o p e n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . d o O p e n   =   f u n c t i o n   ( )   { \ n     t h i s . p o l l ( ) ; \ n } ; \ n \ n / * * \ n   *   P a u s e s   p o l l i n g . \ n   * \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k   u p o n   b u f f e r s   a r e   f l u s h e d   a n d   t r a n s p o r t   i s   p a u s e d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . p a u s e   =   f u n c t i o n   ( o n P a u s e )   { \ n     v a r   s e l f   =   t h i s ; \ n \ n     t h i s . r e a d y S t a t e   =   ' p a u s i n g ' ; \ n \ n     f u n c t i o n   p a u s e   ( )   { \ n         d e b u g ( ' p a u s e d ' ) ; \ n         s e l f . r e a d y S t a t e   =   ' p a u s e d ' ; \ n         o n P a u s e ( ) ; \ n     } \ n \ n     i f   ( t h i s . p o l l i n g   | |   ! t h i s . w r i t a b l e )   { \ n         v a r   t o t a l   =   0 ; \ n \ n         i f   ( t h i s . p o l l i n g )   { \ n             d e b u g ( ' w e   a r e   c u r r e n t l y   p o l l i n g   -   w a i t i n g   t o   p a u s e ' ) ; \ n             t o t a l + + ; \ n             t h i s . o n c e ( ' p o l l C o m p l e t e ' ,   f u n c t i o n   ( )   { \ n                 d e b u g ( ' p r e - p a u s e   p o l l i n g   c o m p l e t e ' ) ; \ n                 - - t o t a l   | |   p a u s e ( ) ; \ n             } ) ; \ n         } \ n \ n         i f   ( ! t h i s . w r i t a b l e )   { \ n             d e b u g ( ' w e   a r e   c u r r e n t l y   w r i t i n g   -   w a i t i n g   t o   p a u s e ' ) ; \ n             t o t a l + + ; \ n             t h i s . o n c e ( ' d r a i n ' ,   f u n c t i o n   ( )   { \ n                 d e b u g ( ' p r e - p a u s e   w r i t i n g   c o m p l e t e ' ) ; \ n                 - - t o t a l   | |   p a u s e ( ) ; \ n             } ) ; \ n         } \ n     }   e l s e   { \ n         p a u s e ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   S t a r t s   p o l l i n g   c y c l e . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . p o l l   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' p o l l i n g ' ) ; \ n     t h i s . p o l l i n g   =   t r u e ; \ n     t h i s . d o P o l l ( ) ; \ n     t h i s . e m i t ( ' p o l l ' ) ; \ n } ; \ n \ n / * * \ n   *   O v e r l o a d s   o n D a t a   t o   d e t e c t   p a y l o a d s . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . o n D a t a   =   f u n c t i o n   ( d a t a )   { \ n     v a r   s e l f   =   t h i s ; \ n     d e b u g ( ' p o l l i n g   g o t   d a t a   % s ' ,   d a t a ) ; \ n     v a r   c a l l b a c k   =   f u n c t i o n   ( p a c k e t ,   i n d e x ,   t o t a l )   { \ n         / /   i f   i t s   t h e   f i r s t   m e s s a g e   w e   c o n s i d e r   t h e   t r a n s p o r t   o p e n \ n         i f   ( ' o p e n i n g '   = = =   s e l f . r e a d y S t a t e )   { \ n             s e l f . o n O p e n ( ) ; \ n         } \ n \ n         / /   i f   i t s   a   c l o s e   p a c k e t ,   w e   c l o s e   t h e   o n g o i n g   r e q u e s t s \ n         i f   ( ' c l o s e '   = = =   p a c k e t . t y p e )   { \ n             s e l f . o n C l o s e ( ) ; \ n             r e t u r n   f a l s e ; \ n         } \ n \ n         / /   o t h e r w i s e   b y p a s s   o n D a t a   a n d   h a n d l e   t h e   m e s s a g e \ n         s e l f . o n P a c k e t ( p a c k e t ) ; \ n     } ; \ n \ n     / /   d e c o d e   p a y l o a d \ n     p a r s e r . d e c o d e P a y l o a d ( d a t a ,   t h i s . s o c k e t . b i n a r y T y p e ,   c a l l b a c k ) ; \ n \ n     / /   i f   a n   e v e n t   d i d   n o t   t r i g g e r   c l o s i n g \ n     i f   ( ' c l o s e d '   ! = =   t h i s . r e a d y S t a t e )   { \ n         / /   i f   w e   g o t   d a t a   w e ' r e   n o t   p o l l i n g \ n         t h i s . p o l l i n g   =   f a l s e ; \ n         t h i s . e m i t ( ' p o l l C o m p l e t e ' ) ; \ n \ n         i f   ( ' o p e n '   = = =   t h i s . r e a d y S t a t e )   { \ n             t h i s . p o l l ( ) ; \ n         }   e l s e   { \ n             d e b u g ( ' i g n o r i n g   p o l l   -   t r a n s p o r t   s t a t e   \ " % s \ " ' ,   t h i s . r e a d y S t a t e ) ; \ n         } \ n     } \ n } ; \ n \ n / * * \ n   *   F o r   p o l l i n g ,   s e n d   a   c l o s e   p a c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . d o C l o s e   =   f u n c t i o n   ( )   { \ n     v a r   s e l f   =   t h i s ; \ n \ n     f u n c t i o n   c l o s e   ( )   { \ n         d e b u g ( ' w r i t i n g   c l o s e   p a c k e t ' ) ; \ n         s e l f . w r i t e ( [ {   t y p e :   ' c l o s e '   } ] ) ; \ n     } \ n \ n     i f   ( ' o p e n '   = = =   t h i s . r e a d y S t a t e )   { \ n         d e b u g ( ' t r a n s p o r t   o p e n   -   c l o s i n g ' ) ; \ n         c l o s e ( ) ; \ n     }   e l s e   { \ n         / /   i n   c a s e   w e ' r e   t r y i n g   t o   c l o s e   w h i l e \ n         / /   h a n d s h a k i n g   i s   i n   p r o g r e s s   ( G H - 1 6 4 ) \ n         d e b u g ( ' t r a n s p o r t   n o t   o p e n   -   d e f e r r i n g   c l o s e ' ) ; \ n         t h i s . o n c e ( ' o p e n ' ,   c l o s e ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   W r i t e s   a   p a c k e t s   p a y l o a d . \ n   * \ n   *   @ p a r a m   { A r r a y }   d a t a   p a c k e t s \ n   *   @ p a r a m   { F u n c t i o n }   d r a i n   c a l l b a c k \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . w r i t e   =   f u n c t i o n   ( p a c k e t s )   { \ n     v a r   s e l f   =   t h i s ; \ n     t h i s . w r i t a b l e   =   f a l s e ; \ n     v a r   c a l l b a c k f n   =   f u n c t i o n   ( )   { \ n         s e l f . w r i t a b l e   =   t r u e ; \ n         s e l f . e m i t ( ' d r a i n ' ) ; \ n     } ; \ n \ n     p a r s e r . e n c o d e P a y l o a d ( p a c k e t s ,   t h i s . s u p p o r t s B i n a r y ,   f u n c t i o n   ( d a t a )   { \ n         s e l f . d o W r i t e ( d a t a ,   c a l l b a c k f n ) ; \ n     } ) ; \ n } ; \ n \ n / * * \ n   *   G e n e r a t e s   u r i   f o r   c o n n e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n P o l l i n g . p r o t o t y p e . u r i   =   f u n c t i o n   ( )   { \ n     v a r   q u e r y   =   t h i s . q u e r y   | |   { } ; \ n     v a r   s c h e m a   =   t h i s . s e c u r e   ?   ' h t t p s '   :   ' h t t p ' ; \ n     v a r   p o r t   =   ' ' ; \ n \ n     / /   c a c h e   b u s t i n g   i s   f o r c e d \ n     i f   ( f a l s e   ! = =   t h i s . t i m e s t a m p R e q u e s t s )   { \ n         q u e r y [ t h i s . t i m e s t a m p P a r a m ]   =   y e a s t ( ) ; \ n     } \ n \ n     i f   ( ! t h i s . s u p p o r t s B i n a r y   & &   ! q u e r y . s i d )   { \ n         q u e r y . b 6 4   =   1 ; \ n     } \ n \ n     q u e r y   =   p a r s e q s . e n c o d e ( q u e r y ) ; \ n \ n     / /   a v o i d   p o r t   i f   d e f a u l t   f o r   s c h e m a \ n     i f   ( t h i s . p o r t   & &   ( ( ' h t t p s '   = = =   s c h e m a   & &   N u m b e r ( t h i s . p o r t )   ! = =   4 4 3 )   | | \ n           ( ' h t t p '   = = =   s c h e m a   & &   N u m b e r ( t h i s . p o r t )   ! = =   8 0 ) ) )   { \ n         p o r t   =   ' : '   +   t h i s . p o r t ; \ n     } \ n \ n     / /   p r e p e n d   ?   t o   q u e r y \ n     i f   ( q u e r y . l e n g t h )   { \ n         q u e r y   =   ' ? '   +   q u e r y ; \ n     } \ n \ n     v a r   i p v 6   =   t h i s . h o s t n a m e . i n d e x O f ( ' : ' )   ! = =   - 1 ; \ n     r e t u r n   s c h e m a   +   ' : / / '   +   ( i p v 6   ?   ' [ '   +   t h i s . h o s t n a m e   +   ' ] '   :   t h i s . h o s t n a m e )   +   p o r t   +   t h i s . p a t h   +   q u e r y ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g . j s \ n / /   m o d u l e   i d   =   2 5 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   T r a n s p o r t ; \ n \ n / * * \ n   *   T r a n s p o r t   a b s t r a c t   c o n s t r u c t o r . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t i o n s . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n f u n c t i o n   T r a n s p o r t   ( o p t s )   { \ n     t h i s . p a t h   =   o p t s . p a t h ; \ n     t h i s . h o s t n a m e   =   o p t s . h o s t n a m e ; \ n     t h i s . p o r t   =   o p t s . p o r t ; \ n     t h i s . s e c u r e   =   o p t s . s e c u r e ; \ n     t h i s . q u e r y   =   o p t s . q u e r y ; \ n     t h i s . t i m e s t a m p P a r a m   =   o p t s . t i m e s t a m p P a r a m ; \ n     t h i s . t i m e s t a m p R e q u e s t s   =   o p t s . t i m e s t a m p R e q u e s t s ; \ n     t h i s . r e a d y S t a t e   =   ' ' ; \ n     t h i s . a g e n t   =   o p t s . a g e n t   | |   f a l s e ; \ n     t h i s . s o c k e t   =   o p t s . s o c k e t ; \ n     t h i s . e n a b l e s X D R   =   o p t s . e n a b l e s X D R ; \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     t h i s . p f x   =   o p t s . p f x ; \ n     t h i s . k e y   =   o p t s . k e y ; \ n     t h i s . p a s s p h r a s e   =   o p t s . p a s s p h r a s e ; \ n     t h i s . c e r t   =   o p t s . c e r t ; \ n     t h i s . c a   =   o p t s . c a ; \ n     t h i s . c i p h e r s   =   o p t s . c i p h e r s ; \ n     t h i s . r e j e c t U n a u t h o r i z e d   =   o p t s . r e j e c t U n a u t h o r i z e d ; \ n     t h i s . f o r c e N o d e   =   o p t s . f o r c e N o d e ; \ n \ n     / /   o t h e r   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     t h i s . e x t r a H e a d e r s   =   o p t s . e x t r a H e a d e r s ; \ n     t h i s . l o c a l A d d r e s s   =   o p t s . l o c a l A d d r e s s ; \ n } \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r ` . \ n   * / \ n \ n E m i t t e r ( T r a n s p o r t . p r o t o t y p e ) ; \ n \ n / * * \ n   *   E m i t s   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r \ n   *   @ r e t u r n   { T r a n s p o r t }   f o r   c h a i n i n g \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o n E r r o r   =   f u n c t i o n   ( m s g ,   d e s c )   { \ n     v a r   e r r   =   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( m s g ) ; \ n     e r r . t y p e   =   ' T r a n s p o r t E r r o r ' ; \ n     e r r . d e s c r i p t i o n   =   d e s c ; \ n     t h i s . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   O p e n s   t h e   t r a n s p o r t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o p e n   =   f u n c t i o n   ( )   { \ n     i f   ( ' c l o s e d '   = = =   t h i s . r e a d y S t a t e   | |   ' '   = = =   t h i s . r e a d y S t a t e )   { \ n         t h i s . r e a d y S t a t e   =   ' o p e n i n g ' ; \ n         t h i s . d o O p e n ( ) ; \ n     } \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   C l o s e s   t h e   t r a n s p o r t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . c l o s e   =   f u n c t i o n   ( )   { \ n     i f   ( ' o p e n i n g '   = = =   t h i s . r e a d y S t a t e   | |   ' o p e n '   = = =   t h i s . r e a d y S t a t e )   { \ n         t h i s . d o C l o s e ( ) ; \ n         t h i s . o n C l o s e ( ) ; \ n     } \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e n d s   m u l t i p l e   p a c k e t s . \ n   * \ n   *   @ p a r a m   { A r r a y }   p a c k e t s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . s e n d   =   f u n c t i o n   ( p a c k e t s )   { \ n     i f   ( ' o p e n '   = = =   t h i s . r e a d y S t a t e )   { \ n         t h i s . w r i t e ( p a c k e t s ) ; \ n     }   e l s e   { \ n         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' T r a n s p o r t   n o t   o p e n ' ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   o p e n \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o n O p e n   =   f u n c t i o n   ( )   { \ n     t h i s . r e a d y S t a t e   =   ' o p e n ' ; \ n     t h i s . w r i t a b l e   =   t r u e ; \ n     t h i s . e m i t ( ' o p e n ' ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w i t h   d a t a . \ n   * \ n   *   @ p a r a m   { S t r i n g }   d a t a \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o n D a t a   =   f u n c t i o n   ( d a t a )   { \ n     v a r   p a c k e t   =   p a r s e r . d e c o d e P a c k e t ( d a t a ,   t h i s . s o c k e t . b i n a r y T y p e ) ; \ n     t h i s . o n P a c k e t ( p a c k e t ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w i t h   a   d e c o d e d   p a c k e t . \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o n P a c k e t   =   f u n c t i o n   ( p a c k e t )   { \ n     t h i s . e m i t ( ' p a c k e t ' ,   p a c k e t ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   c l o s e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n T r a n s p o r t . p r o t o t y p e . o n C l o s e   =   f u n c t i o n   ( )   { \ n     t h i s . r e a d y S t a t e   =   ' c l o s e d ' ; \ n     t h i s . e m i t ( ' c l o s e ' ) ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t . j s \ n / /   m o d u l e   i d   =   2 6 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   k e y s   =   r e q u i r e ( ' . / k e y s ' ) ; \ n v a r   h a s B i n a r y   =   r e q u i r e ( ' h a s - b i n a r y ' ) ; \ n v a r   s l i c e B u f f e r   =   r e q u i r e ( ' a r r a y b u f f e r . s l i c e ' ) ; \ n v a r   a f t e r   =   r e q u i r e ( ' a f t e r ' ) ; \ n v a r   u t f 8   =   r e q u i r e ( ' w t f - 8 ' ) ; \ n \ n v a r   b a s e 6 4 e n c o d e r ; \ n i f   ( g l o b a l   & &   g l o b a l . A r r a y B u f f e r )   { \ n     b a s e 6 4 e n c o d e r   =   r e q u i r e ( ' b a s e 6 4 - a r r a y b u f f e r ' ) ; \ n } \ n \ n / * * \ n   *   C h e c k   i f   w e   a r e   r u n n i n g   a n   a n d r o i d   b r o w s e r .   T h a t   r e q u i r e s   u s   t o   u s e \ n   *   A r r a y B u f f e r   w i t h   p o l l i n g   t r a n s p o r t s . . . \ n   * \ n   *   h t t p : / / g h i n d a . n e t / j p e g - b l o b - a j a x - a n d r o i d / \ n   * / \ n \ n v a r   i s A n d r o i d   =   t y p e o f   n a v i g a t o r   ! = =   ' u n d e f i n e d '   & &   / A n d r o i d / i . t e s t ( n a v i g a t o r . u s e r A g e n t ) ; \ n \ n / * * \ n   *   C h e c k   i f   w e   a r e   r u n n i n g   i n   P h a n t o m J S . \ n   *   U p l o a d i n g   a   B l o b   w i t h   P h a n t o m J S   d o e s   n o t   w o r k   c o r r e c t l y ,   a s   r e p o r t e d   h e r e : \ n   *   h t t p s : / / g i t h u b . c o m / a r i y a / p h a n t o m j s / i s s u e s / 1 1 3 9 5 \ n   *   @ t y p e   b o o l e a n \ n   * / \ n v a r   i s P h a n t o m J S   =   t y p e o f   n a v i g a t o r   ! = =   ' u n d e f i n e d '   & &   / P h a n t o m J S / i . t e s t ( n a v i g a t o r . u s e r A g e n t ) ; \ n \ n / * * \ n   *   W h e n   t r u e ,   a v o i d s   u s i n g   B l o b s   t o   e n c o d e   p a y l o a d s . \ n   *   @ t y p e   b o o l e a n \ n   * / \ n v a r   d o n t S e n d B l o b s   =   i s A n d r o i d   | |   i s P h a n t o m J S ; \ n \ n / * * \ n   *   C u r r e n t   p r o t o c o l   v e r s i o n . \ n   * / \ n \ n e x p o r t s . p r o t o c o l   =   3 ; \ n \ n / * * \ n   *   P a c k e t   t y p e s . \ n   * / \ n \ n v a r   p a c k e t s   =   e x p o r t s . p a c k e t s   =   { \ n         o p e n :           0         / /   n o n - w s \ n     ,   c l o s e :         1         / /   n o n - w s \ n     ,   p i n g :           2 \ n     ,   p o n g :           3 \ n     ,   m e s s a g e :     4 \ n     ,   u p g r a d e :     5 \ n     ,   n o o p :           6 \ n } ; \ n \ n v a r   p a c k e t s l i s t   =   k e y s ( p a c k e t s ) ; \ n \ n / * * \ n   *   P r e m a d e    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   p a c k e t . \ n   * / \ n \ n v a r   e r r   =   {   t y p e :   '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   d a t a :   ' p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m '   } ; \ n \ n / * * \ n   *   C r e a t e   a   b l o b   a p i   e v e n   f o r   b l o b   b u i l d e r   w h e n   v e n d o r   p r e f i x e s   e x i s t \ n   * / \ n \ n v a r   B l o b   =   r e q u i r e ( ' b l o b ' ) ; \ n \ n / * * \ n   *   E n c o d e s   a   p a c k e t . \ n   * \ n   *           < p a c k e t   t y p e   i d >   [   < d a t a >   ] \ n   * \ n   *   E x a m p l e : \ n   * \ n   *           5 h e l l o   w o r l d \ n   *           3 \ n   *           4 \ n   * \ n   *   B i n a r y   i s   e n c o d e d   i n   a n   i d e n t i c a l   p r i n c i p l e \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n e x p o r t s . e n c o d e P a c k e t   =   f u n c t i o n   ( p a c k e t ,   s u p p o r t s B i n a r y ,   u t f 8 e n c o d e ,   c a l l b a c k )   { \ n     i f   ( ' f u n c t i o n '   = =   t y p e o f   s u p p o r t s B i n a r y )   { \ n         c a l l b a c k   =   s u p p o r t s B i n a r y ; \ n         s u p p o r t s B i n a r y   =   f a l s e ; \ n     } \ n \ n     i f   ( ' f u n c t i o n '   = =   t y p e o f   u t f 8 e n c o d e )   { \ n         c a l l b a c k   =   u t f 8 e n c o d e ; \ n         u t f 8 e n c o d e   =   n u l l ; \ n     } \ n \ n     v a r   d a t a   =   ( p a c k e t . d a t a   = = =   u n d e f i n e d ) \ n         ?   u n d e f i n e d \ n         :   p a c k e t . d a t a . b u f f e r   | |   p a c k e t . d a t a ; \ n \ n     i f   ( g l o b a l . A r r a y B u f f e r   & &   d a t a   i n s t a n c e o f   A r r a y B u f f e r )   { \ n         r e t u r n   e n c o d e A r r a y B u f f e r ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k ) ; \ n     }   e l s e   i f   ( B l o b   & &   d a t a   i n s t a n c e o f   g l o b a l . B l o b )   { \ n         r e t u r n   e n c o d e B l o b ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k ) ; \ n     } \ n \ n     / /   m i g h t   b e   a n   o b j e c t   w i t h   {   b a s e 6 4 :   t r u e ,   d a t a :   d a t a A s B a s e 6 4 S t r i n g   } \ n     i f   ( d a t a   & &   d a t a . b a s e 6 4 )   { \ n         r e t u r n   e n c o d e B a s e 6 4 O b j e c t ( p a c k e t ,   c a l l b a c k ) ; \ n     } \ n \ n     / /   S e n d i n g   d a t a   a s   a   u t f - 8   s t r i n g \ n     v a r   e n c o d e d   =   p a c k e t s [ p a c k e t . t y p e ] ; \ n \ n     / /   d a t a   f r a g m e n t   i s   o p t i o n a l \ n     i f   ( u n d e f i n e d   ! = =   p a c k e t . d a t a )   { \ n         e n c o d e d   + =   u t f 8 e n c o d e   ?   u t f 8 . e n c o d e ( S t r i n g ( p a c k e t . d a t a ) )   :   S t r i n g ( p a c k e t . d a t a ) ; \ n     } \ n \ n     r e t u r n   c a l l b a c k ( ' '   +   e n c o d e d ) ; \ n \ n } ; \ n \ n f u n c t i o n   e n c o d e B a s e 6 4 O b j e c t ( p a c k e t ,   c a l l b a c k )   { \ n     / /   p a c k e t   d a t a   i s   a n   o b j e c t   {   b a s e 6 4 :   t r u e ,   d a t a :   d a t a A s B a s e 6 4 S t r i n g   } \ n     v a r   m e s s a g e   =   ' b '   +   e x p o r t s . p a c k e t s [ p a c k e t . t y p e ]   +   p a c k e t . d a t a . d a t a ; \ n     r e t u r n   c a l l b a c k ( m e s s a g e ) ; \ n } \ n \ n / * * \ n   *   E n c o d e   p a c k e t   h e l p e r s   f o r   b i n a r y   t y p e s \ n   * / \ n \ n f u n c t i o n   e n c o d e A r r a y B u f f e r ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k )   { \ n     i f   ( ! s u p p o r t s B i n a r y )   { \ n         r e t u r n   e x p o r t s . e n c o d e B a s e 6 4 P a c k e t ( p a c k e t ,   c a l l b a c k ) ; \ n     } \ n \ n     v a r   d a t a   =   p a c k e t . d a t a ; \ n     v a r   c o n t e n t A r r a y   =   n e w   U i n t 8 A r r a y ( d a t a ) ; \ n     v a r   r e s u l t B u f f e r   =   n e w   U i n t 8 A r r a y ( 1   +   d a t a . b y t e L e n g t h ) ; \ n \ n     r e s u l t B u f f e r [ 0 ]   =   p a c k e t s [ p a c k e t . t y p e ] ; \ n     f o r   ( v a r   i   =   0 ;   i   <   c o n t e n t A r r a y . l e n g t h ;   i + + )   { \ n         r e s u l t B u f f e r [ i + 1 ]   =   c o n t e n t A r r a y [ i ] ; \ n     } \ n \ n     r e t u r n   c a l l b a c k ( r e s u l t B u f f e r . b u f f e r ) ; \ n } \ n \ n f u n c t i o n   e n c o d e B l o b A s A r r a y B u f f e r ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k )   { \ n     i f   ( ! s u p p o r t s B i n a r y )   { \ n         r e t u r n   e x p o r t s . e n c o d e B a s e 6 4 P a c k e t ( p a c k e t ,   c a l l b a c k ) ; \ n     } \ n \ n     v a r   f r   =   n e w   F i l e R e a d e r ( ) ; \ n     f r . o n l o a d   =   f u n c t i o n ( )   { \ n         p a c k e t . d a t a   =   f r . r e s u l t ; \ n         e x p o r t s . e n c o d e P a c k e t ( p a c k e t ,   s u p p o r t s B i n a r y ,   t r u e ,   c a l l b a c k ) ; \ n     } ; \ n     r e t u r n   f r . r e a d A s A r r a y B u f f e r ( p a c k e t . d a t a ) ; \ n } \ n \ n f u n c t i o n   e n c o d e B l o b ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k )   { \ n     i f   ( ! s u p p o r t s B i n a r y )   { \ n         r e t u r n   e x p o r t s . e n c o d e B a s e 6 4 P a c k e t ( p a c k e t ,   c a l l b a c k ) ; \ n     } \ n \ n     i f   ( d o n t S e n d B l o b s )   { \ n         r e t u r n   e n c o d e B l o b A s A r r a y B u f f e r ( p a c k e t ,   s u p p o r t s B i n a r y ,   c a l l b a c k ) ; \ n     } \ n \ n     v a r   l e n g t h   =   n e w   U i n t 8 A r r a y ( 1 ) ; \ n     l e n g t h [ 0 ]   =   p a c k e t s [ p a c k e t . t y p e ] ; \ n     v a r   b l o b   =   n e w   B l o b ( [ l e n g t h . b u f f e r ,   p a c k e t . d a t a ] ) ; \ n \ n     r e t u r n   c a l l b a c k ( b l o b ) ; \ n } \ n \ n / * * \ n   *   E n c o d e s   a   p a c k e t   w i t h   b i n a r y   d a t a   i n   a   b a s e 6 4   s t r i n g \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t ,   h a s   ` t y p e `   a n d   ` d a t a ` \ n   *   @ r e t u r n   { S t r i n g }   b a s e 6 4   e n c o d e d   m e s s a g e \ n   * / \ n \ n e x p o r t s . e n c o d e B a s e 6 4 P a c k e t   =   f u n c t i o n ( p a c k e t ,   c a l l b a c k )   { \ n     v a r   m e s s a g e   =   ' b '   +   e x p o r t s . p a c k e t s [ p a c k e t . t y p e ] ; \ n     i f   ( B l o b   & &   p a c k e t . d a t a   i n s t a n c e o f   g l o b a l . B l o b )   { \ n         v a r   f r   =   n e w   F i l e R e a d e r ( ) ; \ n         f r . o n l o a d   =   f u n c t i o n ( )   { \ n             v a r   b 6 4   =   f r . r e s u l t . s p l i t ( ' , ' ) [ 1 ] ; \ n             c a l l b a c k ( m e s s a g e   +   b 6 4 ) ; \ n         } ; \ n         r e t u r n   f r . r e a d A s D a t a U R L ( p a c k e t . d a t a ) ; \ n     } \ n \ n     v a r   b 6 4 d a t a ; \ n     t r y   { \ n         b 6 4 d a t a   =   S t r i n g . f r o m C h a r C o d e . a p p l y ( n u l l ,   n e w   U i n t 8 A r r a y ( p a c k e t . d a t a ) ) ; \ n     }   c a t c h   ( e )   { \ n         / /   i P h o n e   S a f a r i   d o e s n ' t   l e t   y o u   a p p l y   w i t h   t y p e d   a r r a y s \ n         v a r   t y p e d   =   n e w   U i n t 8 A r r a y ( p a c k e t . d a t a ) ; \ n         v a r   b a s i c   =   n e w   A r r a y ( t y p e d . l e n g t h ) ; \ n         f o r   ( v a r   i   =   0 ;   i   <   t y p e d . l e n g t h ;   i + + )   { \ n             b a s i c [ i ]   =   t y p e d [ i ] ; \ n         } \ n         b 6 4 d a t a   =   S t r i n g . f r o m C h a r C o d e . a p p l y ( n u l l ,   b a s i c ) ; \ n     } \ n     m e s s a g e   + =   g l o b a l . b t o a ( b 6 4 d a t a ) ; \ n     r e t u r n   c a l l b a c k ( m e s s a g e ) ; \ n } ; \ n \ n / * * \ n   *   D e c o d e s   a   p a c k e t .   C h a n g e s   f o r m a t   t o   B l o b   i f   r e q u e s t e d . \ n   * \ n   *   @ r e t u r n   { O b j e c t }   w i t h   ` t y p e `   a n d   ` d a t a `   ( i f   a n y ) \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n e x p o r t s . d e c o d e P a c k e t   =   f u n c t i o n   ( d a t a ,   b i n a r y T y p e ,   u t f 8 d e c o d e )   { \ n     i f   ( d a t a   = = =   u n d e f i n e d )   { \ n         r e t u r n   e r r ; \ n     } \ n     / /   S t r i n g   d a t a \ n     i f   ( t y p e o f   d a t a   = =   ' s t r i n g ' )   { \ n         i f   ( d a t a . c h a r A t ( 0 )   = =   ' b ' )   { \ n             r e t u r n   e x p o r t s . d e c o d e B a s e 6 4 P a c k e t ( d a t a . s u b s t r ( 1 ) ,   b i n a r y T y p e ) ; \ n         } \ n \ n         i f   ( u t f 8 d e c o d e )   { \ n             d a t a   =   t r y D e c o d e ( d a t a ) ; \ n             i f   ( d a t a   = = =   f a l s e )   { \ n                 r e t u r n   e r r ; \ n             } \ n         } \ n         v a r   t y p e   =   d a t a . c h a r A t ( 0 ) ; \ n \ n         i f   ( N u m b e r ( t y p e )   ! =   t y p e   | |   ! p a c k e t s l i s t [ t y p e ] )   { \ n             r e t u r n   e r r ; \ n         } \ n \ n         i f   ( d a t a . l e n g t h   >   1 )   { \ n             r e t u r n   {   t y p e :   p a c k e t s l i s t [ t y p e ] ,   d a t a :   d a t a . s u b s t r i n g ( 1 )   } ; \ n         }   e l s e   { \ n             r e t u r n   {   t y p e :   p a c k e t s l i s t [ t y p e ]   } ; \ n         } \ n     } \ n \ n     v a r   a s A r r a y   =   n e w   U i n t 8 A r r a y ( d a t a ) ; \ n     v a r   t y p e   =   a s A r r a y [ 0 ] ; \ n     v a r   r e s t   =   s l i c e B u f f e r ( d a t a ,   1 ) ; \ n     i f   ( B l o b   & &   b i n a r y T y p e   = = =   ' b l o b ' )   { \ n         r e s t   =   n e w   B l o b ( [ r e s t ] ) ; \ n     } \ n     r e t u r n   {   t y p e :   p a c k e t s l i s t [ t y p e ] ,   d a t a :   r e s t   } ; \ n } ; \ n \ n f u n c t i o n   t r y D e c o d e ( d a t a )   { \ n     t r y   { \ n         d a t a   =   u t f 8 . d e c o d e ( d a t a ) ; \ n     }   c a t c h   ( e )   { \ n         r e t u r n   f a l s e ; \ n     } \ n     r e t u r n   d a t a ; \ n } \ n \ n / * * \ n   *   D e c o d e s   a   p a c k e t   e n c o d e d   i n   a   b a s e 6 4   s t r i n g \ n   * \ n   *   @ p a r a m   { S t r i n g }   b a s e 6 4   e n c o d e d   m e s s a g e \ n   *   @ r e t u r n   { O b j e c t }   w i t h   ` t y p e `   a n d   ` d a t a `   ( i f   a n y ) \ n   * / \ n \ n e x p o r t s . d e c o d e B a s e 6 4 P a c k e t   =   f u n c t i o n ( m s g ,   b i n a r y T y p e )   { \ n     v a r   t y p e   =   p a c k e t s l i s t [ m s g . c h a r A t ( 0 ) ] ; \ n     i f   ( ! b a s e 6 4 e n c o d e r )   { \ n         r e t u r n   {   t y p e :   t y p e ,   d a t a :   {   b a s e 6 4 :   t r u e ,   d a t a :   m s g . s u b s t r ( 1 )   }   } ; \ n     } \ n \ n     v a r   d a t a   =   b a s e 6 4 e n c o d e r . d e c o d e ( m s g . s u b s t r ( 1 ) ) ; \ n \ n     i f   ( b i n a r y T y p e   = = =   ' b l o b '   & &   B l o b )   { \ n         d a t a   =   n e w   B l o b ( [ d a t a ] ) ; \ n     } \ n \ n     r e t u r n   {   t y p e :   t y p e ,   d a t a :   d a t a   } ; \ n } ; \ n \ n / * * \ n   *   E n c o d e s   m u l t i p l e   m e s s a g e s   ( p a y l o a d ) . \ n   * \ n   *           < l e n g t h > : d a t a \ n   * \ n   *   E x a m p l e : \ n   * \ n   *           1 1 : h e l l o   w o r l d 2 : h i \ n   * \ n   *   I f   a n y   c o n t e n t s   a r e   b i n a r y ,   t h e y   w i l l   b e   e n c o d e d   a s   b a s e 6 4   s t r i n g s .   B a s e 6 4 \ n   *   e n c o d e d   s t r i n g s   a r e   m a r k e d   w i t h   a   b   b e f o r e   t h e   l e n g t h   s p e c i f i e r \ n   * \ n   *   @ p a r a m   { A r r a y }   p a c k e t s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n e x p o r t s . e n c o d e P a y l o a d   =   f u n c t i o n   ( p a c k e t s ,   s u p p o r t s B i n a r y ,   c a l l b a c k )   { \ n     i f   ( t y p e o f   s u p p o r t s B i n a r y   = =   ' f u n c t i o n ' )   { \ n         c a l l b a c k   =   s u p p o r t s B i n a r y ; \ n         s u p p o r t s B i n a r y   =   n u l l ; \ n     } \ n \ n     v a r   i s B i n a r y   =   h a s B i n a r y ( p a c k e t s ) ; \ n \ n     i f   ( s u p p o r t s B i n a r y   & &   i s B i n a r y )   { \ n         i f   ( B l o b   & &   ! d o n t S e n d B l o b s )   { \ n             r e t u r n   e x p o r t s . e n c o d e P a y l o a d A s B l o b ( p a c k e t s ,   c a l l b a c k ) ; \ n         } \ n \ n         r e t u r n   e x p o r t s . e n c o d e P a y l o a d A s A r r a y B u f f e r ( p a c k e t s ,   c a l l b a c k ) ; \ n     } \ n \ n     i f   ( ! p a c k e t s . l e n g t h )   { \ n         r e t u r n   c a l l b a c k ( ' 0 : ' ) ; \ n     } \ n \ n     f u n c t i o n   s e t L e n g t h H e a d e r ( m e s s a g e )   { \ n         r e t u r n   m e s s a g e . l e n g t h   +   ' : '   +   m e s s a g e ; \ n     } \ n \ n     f u n c t i o n   e n c o d e O n e ( p a c k e t ,   d o n e C a l l b a c k )   { \ n         e x p o r t s . e n c o d e P a c k e t ( p a c k e t ,   ! i s B i n a r y   ?   f a l s e   :   s u p p o r t s B i n a r y ,   t r u e ,   f u n c t i o n ( m e s s a g e )   { \ n             d o n e C a l l b a c k ( n u l l ,   s e t L e n g t h H e a d e r ( m e s s a g e ) ) ; \ n         } ) ; \ n     } \ n \ n     m a p ( p a c k e t s ,   e n c o d e O n e ,   f u n c t i o n ( e r r ,   r e s u l t s )   { \ n         r e t u r n   c a l l b a c k ( r e s u l t s . j o i n ( ' ' ) ) ; \ n     } ) ; \ n } ; \ n \ n / * * \ n   *   A s y n c   a r r a y   m a p   u s i n g   a f t e r \ n   * / \ n \ n f u n c t i o n   m a p ( a r y ,   e a c h ,   d o n e )   { \ n     v a r   r e s u l t   =   n e w   A r r a y ( a r y . l e n g t h ) ; \ n     v a r   n e x t   =   a f t e r ( a r y . l e n g t h ,   d o n e ) ; \ n \ n     v a r   e a c h W i t h I n d e x   =   f u n c t i o n ( i ,   e l ,   c b )   { \ n         e a c h ( e l ,   f u n c t i o n (  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ,   m s g )   { \ n             r e s u l t [ i ]   =   m s g ; \ n             c b (  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ,   r e s u l t ) ; \ n         } ) ; \ n     } ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   a r y . l e n g t h ;   i + + )   { \ n         e a c h W i t h I n d e x ( i ,   a r y [ i ] ,   n e x t ) ; \ n     } \ n } \ n \ n / * \ n   *   D e c o d e s   d a t a   w h e n   a   p a y l o a d   i s   m a y b e   e x p e c t e d .   P o s s i b l e   b i n a r y   c o n t e n t s   a r e \ n   *   d e c o d e d   f r o m   t h e i r   b a s e 6 4   r e p r e s e n t a t i o n \ n   * \ n   *   @ p a r a m   { S t r i n g }   d a t a ,   c a l l b a c k   m e t h o d \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . d e c o d e P a y l o a d   =   f u n c t i o n   ( d a t a ,   b i n a r y T y p e ,   c a l l b a c k )   { \ n     i f   ( t y p e o f   d a t a   ! =   ' s t r i n g ' )   { \ n         r e t u r n   e x p o r t s . d e c o d e P a y l o a d A s B i n a r y ( d a t a ,   b i n a r y T y p e ,   c a l l b a c k ) ; \ n     } \ n \ n     i f   ( t y p e o f   b i n a r y T y p e   = = =   ' f u n c t i o n ' )   { \ n         c a l l b a c k   =   b i n a r y T y p e ; \ n         b i n a r y T y p e   =   n u l l ; \ n     } \ n \ n     v a r   p a c k e t ; \ n     i f   ( d a t a   = =   ' ' )   { \ n         / /   p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   -   i g n o r i n g   p a y l o a d \ n         r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n     } \ n \ n     v a r   l e n g t h   =   ' ' \ n         ,   n ,   m s g ; \ n \ n     f o r   ( v a r   i   =   0 ,   l   =   d a t a . l e n g t h ;   i   <   l ;   i + + )   { \ n         v a r   c h r   =   d a t a . c h a r A t ( i ) ; \ n \ n         i f   ( ' : '   ! =   c h r )   { \ n             l e n g t h   + =   c h r ; \ n         }   e l s e   { \ n             i f   ( ' '   = =   l e n g t h   | |   ( l e n g t h   ! =   ( n   =   N u m b e r ( l e n g t h ) ) ) )   { \ n                 / /   p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   -   i g n o r i n g   p a y l o a d \ n                 r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n             } \ n \ n             m s g   =   d a t a . s u b s t r ( i   +   1 ,   n ) ; \ n \ n             i f   ( l e n g t h   ! =   m s g . l e n g t h )   { \ n                 / /   p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   -   i g n o r i n g   p a y l o a d \ n                 r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n             } \ n \ n             i f   ( m s g . l e n g t h )   { \ n                 p a c k e t   =   e x p o r t s . d e c o d e P a c k e t ( m s g ,   b i n a r y T y p e ,   t r u e ) ; \ n \ n                 i f   ( e r r . t y p e   = =   p a c k e t . t y p e   & &   e r r . d a t a   = =   p a c k e t . d a t a )   { \ n                     / /   p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   i n   i n d i v i d u a l   p a c k e t   -   i g n o r i n g   p a y l o a d \ n                     r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n                 } \ n \ n                 v a r   r e t   =   c a l l b a c k ( p a c k e t ,   i   +   n ,   l ) ; \ n                 i f   ( f a l s e   = = =   r e t )   r e t u r n ; \ n             } \ n \ n             / /   a d v a n c e   c u r s o r \ n             i   + =   n ; \ n             l e n g t h   =   ' ' ; \ n         } \ n     } \ n \ n     i f   ( l e n g t h   ! =   ' ' )   { \ n         / /   p a r s e r    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   -   i g n o r i n g   p a y l o a d \ n         r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n     } \ n \ n } ; \ n \ n / * * \ n   *   E n c o d e s   m u l t i p l e   m e s s a g e s   ( p a y l o a d )   a s   b i n a r y . \ n   * \ n   *   < 1   =   b i n a r y ,   0   =   s t r i n g > < n u m b e r   f r o m   0 - 9 > < n u m b e r   f r o m   0 - 9 > [ . . . ] < n u m b e r \ n   *   2 5 5 > < d a t a > \ n   * \ n   *   E x a m p l e : \ n   *   1   3   2 5 5   1   2   3 ,   i f   t h e   b i n a r y   c o n t e n t s   a r e   i n t e r p r e t e d   a s   8   b i t   i n t e g e r s \ n   * \ n   *   @ p a r a m   { A r r a y }   p a c k e t s \ n   *   @ r e t u r n   { A r r a y B u f f e r }   e n c o d e d   p a y l o a d \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n e x p o r t s . e n c o d e P a y l o a d A s A r r a y B u f f e r   =   f u n c t i o n ( p a c k e t s ,   c a l l b a c k )   { \ n     i f   ( ! p a c k e t s . l e n g t h )   { \ n         r e t u r n   c a l l b a c k ( n e w   A r r a y B u f f e r ( 0 ) ) ; \ n     } \ n \ n     f u n c t i o n   e n c o d e O n e ( p a c k e t ,   d o n e C a l l b a c k )   { \ n         e x p o r t s . e n c o d e P a c k e t ( p a c k e t ,   t r u e ,   t r u e ,   f u n c t i o n ( d a t a )   { \ n             r e t u r n   d o n e C a l l b a c k ( n u l l ,   d a t a ) ; \ n         } ) ; \ n     } \ n \ n     m a p ( p a c k e t s ,   e n c o d e O n e ,   f u n c t i o n ( e r r ,   e n c o d e d P a c k e t s )   { \ n         v a r   t o t a l L e n g t h   =   e n c o d e d P a c k e t s . r e d u c e ( f u n c t i o n ( a c c ,   p )   { \ n             v a r   l e n ; \ n             i f   ( t y p e o f   p   = = =   ' s t r i n g ' ) { \ n                 l e n   =   p . l e n g t h ; \ n             }   e l s e   { \ n                 l e n   =   p . b y t e L e n g t h ; \ n             } \ n             r e t u r n   a c c   +   l e n . t o S t r i n g ( ) . l e n g t h   +   l e n   +   2 ;   / /   s t r i n g / b i n a r y   i d e n t i f i e r   +   s e p a r a t o r   =   2 \ n         } ,   0 ) ; \ n \ n         v a r   r e s u l t A r r a y   =   n e w   U i n t 8 A r r a y ( t o t a l L e n g t h ) ; \ n \ n         v a r   b u f f e r I n d e x   =   0 ; \ n         e n c o d e d P a c k e t s . f o r E a c h ( f u n c t i o n ( p )   { \ n             v a r   i s S t r i n g   =   t y p e o f   p   = = =   ' s t r i n g ' ; \ n             v a r   a b   =   p ; \ n             i f   ( i s S t r i n g )   { \ n                 v a r   v i e w   =   n e w   U i n t 8 A r r a y ( p . l e n g t h ) ; \ n                 f o r   ( v a r   i   =   0 ;   i   <   p . l e n g t h ;   i + + )   { \ n                     v i e w [ i ]   =   p . c h a r C o d e A t ( i ) ; \ n                 } \ n                 a b   =   v i e w . b u f f e r ; \ n             } \ n \ n             i f   ( i s S t r i n g )   {   / /   n o t   t r u e   b i n a r y \ n                 r e s u l t A r r a y [ b u f f e r I n d e x + + ]   =   0 ; \ n             }   e l s e   {   / /   t r u e   b i n a r y \ n                 r e s u l t A r r a y [ b u f f e r I n d e x + + ]   =   1 ; \ n             } \ n \ n             v a r   l e n S t r   =   a b . b y t e L e n g t h . t o S t r i n g ( ) ; \ n             f o r   ( v a r   i   =   0 ;   i   <   l e n S t r . l e n g t h ;   i + + )   { \ n                 r e s u l t A r r a y [ b u f f e r I n d e x + + ]   =   p a r s e I n t ( l e n S t r [ i ] ) ; \ n             } \ n             r e s u l t A r r a y [ b u f f e r I n d e x + + ]   =   2 5 5 ; \ n \ n             v a r   v i e w   =   n e w   U i n t 8 A r r a y ( a b ) ; \ n             f o r   ( v a r   i   =   0 ;   i   <   v i e w . l e n g t h ;   i + + )   { \ n                 r e s u l t A r r a y [ b u f f e r I n d e x + + ]   =   v i e w [ i ] ; \ n             } \ n         } ) ; \ n \ n         r e t u r n   c a l l b a c k ( r e s u l t A r r a y . b u f f e r ) ; \ n     } ) ; \ n } ; \ n \ n / * * \ n   *   E n c o d e   a s   B l o b \ n   * / \ n \ n e x p o r t s . e n c o d e P a y l o a d A s B l o b   =   f u n c t i o n ( p a c k e t s ,   c a l l b a c k )   { \ n     f u n c t i o n   e n c o d e O n e ( p a c k e t ,   d o n e C a l l b a c k )   { \ n         e x p o r t s . e n c o d e P a c k e t ( p a c k e t ,   t r u e ,   t r u e ,   f u n c t i o n ( e n c o d e d )   { \ n             v a r   b i n a r y I d e n t i f i e r   =   n e w   U i n t 8 A r r a y ( 1 ) ; \ n             b i n a r y I d e n t i f i e r [ 0 ]   =   1 ; \ n             i f   ( t y p e o f   e n c o d e d   = = =   ' s t r i n g ' )   { \ n                 v a r   v i e w   =   n e w   U i n t 8 A r r a y ( e n c o d e d . l e n g t h ) ; \ n                 f o r   ( v a r   i   =   0 ;   i   <   e n c o d e d . l e n g t h ;   i + + )   { \ n                     v i e w [ i ]   =   e n c o d e d . c h a r C o d e A t ( i ) ; \ n                 } \ n                 e n c o d e d   =   v i e w . b u f f e r ; \ n                 b i n a r y I d e n t i f i e r [ 0 ]   =   0 ; \ n             } \ n \ n             v a r   l e n   =   ( e n c o d e d   i n s t a n c e o f   A r r a y B u f f e r ) \ n                 ?   e n c o d e d . b y t e L e n g t h \ n                 :   e n c o d e d . s i z e ; \ n \ n             v a r   l e n S t r   =   l e n . t o S t r i n g ( ) ; \ n             v a r   l e n g t h A r y   =   n e w   U i n t 8 A r r a y ( l e n S t r . l e n g t h   +   1 ) ; \ n             f o r   ( v a r   i   =   0 ;   i   <   l e n S t r . l e n g t h ;   i + + )   { \ n                 l e n g t h A r y [ i ]   =   p a r s e I n t ( l e n S t r [ i ] ) ; \ n             } \ n             l e n g t h A r y [ l e n S t r . l e n g t h ]   =   2 5 5 ; \ n \ n             i f   ( B l o b )   { \ n                 v a r   b l o b   =   n e w   B l o b ( [ b i n a r y I d e n t i f i e r . b u f f e r ,   l e n g t h A r y . b u f f e r ,   e n c o d e d ] ) ; \ n                 d o n e C a l l b a c k ( n u l l ,   b l o b ) ; \ n             } \ n         } ) ; \ n     } \ n \ n     m a p ( p a c k e t s ,   e n c o d e O n e ,   f u n c t i o n ( e r r ,   r e s u l t s )   { \ n         r e t u r n   c a l l b a c k ( n e w   B l o b ( r e s u l t s ) ) ; \ n     } ) ; \ n } ; \ n \ n / * \ n   *   D e c o d e s   d a t a   w h e n   a   p a y l o a d   i s   m a y b e   e x p e c t e d .   S t r i n g s   a r e   d e c o d e d   b y \ n   *   i n t e r p r e t i n g   e a c h   b y t e   a s   a   k e y   c o d e   f o r   e n t r i e s   m a r k e d   t o   s t a r t   w i t h   0 .   S e e \ n   *   d e s c r i p t i o n   o f   e n c o d e P a y l o a d A s B i n a r y \ n   * \ n   *   @ p a r a m   { A r r a y B u f f e r }   d a t a ,   c a l l b a c k   m e t h o d \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n e x p o r t s . d e c o d e P a y l o a d A s B i n a r y   =   f u n c t i o n   ( d a t a ,   b i n a r y T y p e ,   c a l l b a c k )   { \ n     i f   ( t y p e o f   b i n a r y T y p e   = = =   ' f u n c t i o n ' )   { \ n         c a l l b a c k   =   b i n a r y T y p e ; \ n         b i n a r y T y p e   =   n u l l ; \ n     } \ n \ n     v a r   b u f f e r T a i l   =   d a t a ; \ n     v a r   b u f f e r s   =   [ ] ; \ n \ n     v a r   n u m b e r T o o L o n g   =   f a l s e ; \ n     w h i l e   ( b u f f e r T a i l . b y t e L e n g t h   >   0 )   { \ n         v a r   t a i l A r r a y   =   n e w   U i n t 8 A r r a y ( b u f f e r T a i l ) ; \ n         v a r   i s S t r i n g   =   t a i l A r r a y [ 0 ]   = = =   0 ; \ n         v a r   m s g L e n g t h   =   ' ' ; \ n \ n         f o r   ( v a r   i   =   1 ;   ;   i + + )   { \ n             i f   ( t a i l A r r a y [ i ]   = =   2 5 5 )   b r e a k ; \ n \ n             i f   ( m s g L e n g t h . l e n g t h   >   3 1 0 )   { \ n                 n u m b e r T o o L o n g   =   t r u e ; \ n                 b r e a k ; \ n             } \ n \ n             m s g L e n g t h   + =   t a i l A r r a y [ i ] ; \ n         } \ n \ n         i f ( n u m b e r T o o L o n g )   r e t u r n   c a l l b a c k ( e r r ,   0 ,   1 ) ; \ n \ n         b u f f e r T a i l   =   s l i c e B u f f e r ( b u f f e r T a i l ,   2   +   m s g L e n g t h . l e n g t h ) ; \ n         m s g L e n g t h   =   p a r s e I n t ( m s g L e n g t h ) ; \ n \ n         v a r   m s g   =   s l i c e B u f f e r ( b u f f e r T a i l ,   0 ,   m s g L e n g t h ) ; \ n         i f   ( i s S t r i n g )   { \ n             t r y   { \ n                 m s g   =   S t r i n g . f r o m C h a r C o d e . a p p l y ( n u l l ,   n e w   U i n t 8 A r r a y ( m s g ) ) ; \ n             }   c a t c h   ( e )   { \ n                 / /   i P h o n e   S a f a r i   d o e s n ' t   l e t   y o u   a p p l y   t o   t y p e d   a r r a y s \ n                 v a r   t y p e d   =   n e w   U i n t 8 A r r a y ( m s g ) ; \ n                 m s g   =   ' ' ; \ n                 f o r   ( v a r   i   =   0 ;   i   <   t y p e d . l e n g t h ;   i + + )   { \ n                     m s g   + =   S t r i n g . f r o m C h a r C o d e ( t y p e d [ i ] ) ; \ n                 } \ n             } \ n         } \ n \ n         b u f f e r s . p u s h ( m s g ) ; \ n         b u f f e r T a i l   =   s l i c e B u f f e r ( b u f f e r T a i l ,   m s g L e n g t h ) ; \ n     } \ n \ n     v a r   t o t a l   =   b u f f e r s . l e n g t h ; \ n     b u f f e r s . f o r E a c h ( f u n c t i o n ( b u f f e r ,   i )   { \ n         c a l l b a c k ( e x p o r t s . d e c o d e P a c k e t ( b u f f e r ,   b i n a r y T y p e ,   t r u e ) ,   i ,   t o t a l ) ; \ n     } ) ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - p a r s e r / l i b / b r o w s e r . j s \ n / /   m o d u l e   i d   =   2 7 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   G e t s   t h e   k e y s   f o r   a n   o b j e c t . \ n   * \ n   *   @ r e t u r n   { A r r a y }   k e y s \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n m o d u l e . e x p o r t s   =   O b j e c t . k e y s   | |   f u n c t i o n   k e y s   ( o b j ) { \ n     v a r   a r r   =   [ ] ; \ n     v a r   h a s   =   O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y ; \ n \ n     f o r   ( v a r   i   i n   o b j )   { \ n         i f   ( h a s . c a l l ( o b j ,   i ) )   { \ n             a r r . p u s h ( i ) ; \ n         } \ n     } \ n     r e t u r n   a r r ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - p a r s e r / l i b / k e y s . j s \ n / /   m o d u l e   i d   =   2 8 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * \ n   *   M o d u l e   r e q u i r e m e n t s . \ n   * / \ n \ n v a r   i s A r r a y   =   r e q u i r e ( ' i s a r r a y ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   h a s B i n a r y ; \ n \ n / * * \ n   *   C h e c k s   f o r   b i n a r y   d a t a . \ n   * \ n   *   R i g h t   n o w   o n l y   B u f f e r   a n d   A r r a y B u f f e r   a r e   s u p p o r t e d . . \ n   * \ n   *   @ p a r a m   { O b j e c t }   a n y t h i n g \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   h a s B i n a r y ( d a t a )   { \ n \ n     f u n c t i o n   _ h a s B i n a r y ( o b j )   { \ n         i f   ( ! o b j )   r e t u r n   f a l s e ; \ n \ n         i f   (   ( g l o b a l . B u f f e r   & &   g l o b a l . B u f f e r . i s B u f f e r   & &   g l o b a l . B u f f e r . i s B u f f e r ( o b j ) )   | | \ n                   ( g l o b a l . A r r a y B u f f e r   & &   o b j   i n s t a n c e o f   A r r a y B u f f e r )   | | \ n                   ( g l o b a l . B l o b   & &   o b j   i n s t a n c e o f   B l o b )   | | \ n                   ( g l o b a l . F i l e   & &   o b j   i n s t a n c e o f   F i l e ) \ n                 )   { \ n             r e t u r n   t r u e ; \ n         } \ n \ n         i f   ( i s A r r a y ( o b j ) )   { \ n             f o r   ( v a r   i   =   0 ;   i   <   o b j . l e n g t h ;   i + + )   { \ n                     i f   ( _ h a s B i n a r y ( o b j [ i ] ) )   { \ n                             r e t u r n   t r u e ; \ n                     } \ n             } \ n         }   e l s e   i f   ( o b j   & &   ' o b j e c t '   = =   t y p e o f   o b j )   { \ n             / /   s e e :   h t t p s : / / g i t h u b . c o m / A u t o m a t t i c / h a s - b i n a r y / p u l l / 4 \ n             i f   ( o b j . t o J S O N   & &   ' f u n c t i o n '   = =   t y p e o f   o b j . t o J S O N )   { \ n                 o b j   =   o b j . t o J S O N ( ) ; \ n             } \ n \ n             f o r   ( v a r   k e y   i n   o b j )   { \ n                 i f   ( O b j e c t . p r o t o t y p e . h a s O w n P r o p e r t y . c a l l ( o b j ,   k e y )   & &   _ h a s B i n a r y ( o b j [ k e y ] ) )   { \ n                     r e t u r n   t r u e ; \ n                 } \ n             } \ n         } \ n \ n         r e t u r n   f a l s e ; \ n     } \ n \ n     r e t u r n   _ h a s B i n a r y ( d a t a ) ; \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / h a s - b i n a r y / i n d e x . j s \ n / /   m o d u l e   i d   =   2 9 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   A n   a b s t r a c t i o n   f o r   s l i c i n g   a n   a r r a y b u f f e r   e v e n   w h e n \ n   *   A r r a y B u f f e r . p r o t o t y p e . s l i c e   i s    [ 1 m  [ 3 1 m n o t   s u p p o r t e d  [ 3 9 m  [ 2 2 m  [ 1 m \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( a r r a y b u f f e r ,   s t a r t ,   e n d )   { \ n     v a r   b y t e s   =   a r r a y b u f f e r . b y t e L e n g t h ; \ n     s t a r t   =   s t a r t   | |   0 ; \ n     e n d   =   e n d   | |   b y t e s ; \ n \ n     i f   ( a r r a y b u f f e r . s l i c e )   {   r e t u r n   a r r a y b u f f e r . s l i c e ( s t a r t ,   e n d ) ;   } \ n \ n     i f   ( s t a r t   <   0 )   {   s t a r t   + =   b y t e s ;   } \ n     i f   ( e n d   <   0 )   {   e n d   + =   b y t e s ;   } \ n     i f   ( e n d   >   b y t e s )   {   e n d   =   b y t e s ;   } \ n \ n     i f   ( s t a r t   > =   b y t e s   | |   s t a r t   > =   e n d   | |   b y t e s   = = =   0 )   { \ n         r e t u r n   n e w   A r r a y B u f f e r ( 0 ) ; \ n     } \ n \ n     v a r   a b v   =   n e w   U i n t 8 A r r a y ( a r r a y b u f f e r ) ; \ n     v a r   r e s u l t   =   n e w   U i n t 8 A r r a y ( e n d   -   s t a r t ) ; \ n     f o r   ( v a r   i   =   s t a r t ,   i i   =   0 ;   i   <   e n d ;   i + + ,   i i + + )   { \ n         r e s u l t [ i i ]   =   a b v [ i ] ; \ n     } \ n     r e t u r n   r e s u l t . b u f f e r ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / a r r a y b u f f e r . s l i c e / i n d e x . j s \ n / /   m o d u l e   i d   =   3 0 \ n / /   m o d u l e   c h u n k s   =   0 " , " m o d u l e . e x p o r t s   =   a f t e r \ n \ n f u n c t i o n   a f t e r ( c o u n t ,   c a l l b a c k ,   e r r _ c b )   { \ n         v a r   b a i l   =   f a l s e \ n         e r r _ c b   =   e r r _ c b   | |   n o o p \ n         p r o x y . c o u n t   =   c o u n t \ n \ n         r e t u r n   ( c o u n t   = = =   0 )   ?   c a l l b a c k ( )   :   p r o x y \ n \ n         f u n c t i o n   p r o x y ( e r r ,   r e s u l t )   { \ n                 i f   ( p r o x y . c o u n t   < =   0 )   { \ n                         t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' a f t e r   c a l l e d   t o o   m a n y   t i m e s ' ) \ n                 } \ n                 - - p r o x y . c o u n t \ n \ n                 / /   a f t e r   f i r s t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ,   r e s t   a r e   p a s s e d   t o   e r r _ c b \ n                 i f   ( e r r )   { \ n                         b a i l   =   t r u e \ n                         c a l l b a c k ( e r r ) \ n                         / /   f u t u r e    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   c a l l b a c k s   w i l l   g o   t o    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m   h a n d l e r \ n                         c a l l b a c k   =   e r r _ c b \ n                 }   e l s e   i f   ( p r o x y . c o u n t   = = =   0   & &   ! b a i l )   { \ n                         c a l l b a c k ( n u l l ,   r e s u l t ) \ n                 } \ n         } \ n } \ n \ n f u n c t i o n   n o o p ( )   { } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / a f t e r / i n d e x . j s \ n / /   m o d u l e   i d   =   3 1 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * !   h t t p s : / / m t h s . b e / w t f 8   v 1 . 0 . 0   b y   @ m a t h i a s   * / \ n ; ( f u n c t i o n ( r o o t )   { \ n \ n \ t / /   D e t e c t   f r e e   v a r i a b l e s   ` e x p o r t s ` \ n \ t v a r   f r e e E x p o r t s   =   t y p e o f   e x p o r t s   = =   ' o b j e c t '   & &   e x p o r t s ; \ n \ n \ t / /   D e t e c t   f r e e   v a r i a b l e   ` m o d u l e ` \ n \ t v a r   f r e e M o d u l e   =   t y p e o f   m o d u l e   = =   ' o b j e c t '   & &   m o d u l e   & & \ n \ t \ t m o d u l e . e x p o r t s   = =   f r e e E x p o r t s   & &   m o d u l e ; \ n \ n \ t / /   D e t e c t   f r e e   v a r i a b l e   ` g l o b a l ` ,   f r o m   N o d e . j s   o r   B r o w s e r i f i e d   c o d e , \ n \ t / /   a n d   u s e   i t   a s   ` r o o t ` \ n \ t v a r   f r e e G l o b a l   =   t y p e o f   g l o b a l   = =   ' o b j e c t '   & &   g l o b a l ; \ n \ t i f   ( f r e e G l o b a l . g l o b a l   = = =   f r e e G l o b a l   | |   f r e e G l o b a l . w i n d o w   = = =   f r e e G l o b a l )   { \ n \ t \ t r o o t   =   f r e e G l o b a l ; \ n \ t } \ n \ n \ t / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / \ n \ n \ t v a r   s t r i n g F r o m C h a r C o d e   =   S t r i n g . f r o m C h a r C o d e ; \ n \ n \ t / /   T a k e n   f r o m   h t t p s : / / m t h s . b e / p u n y c o d e \ n \ t f u n c t i o n   u c s 2 d e c o d e ( s t r i n g )   { \ n \ t \ t v a r   o u t p u t   =   [ ] ; \ n \ t \ t v a r   c o u n t e r   =   0 ; \ n \ t \ t v a r   l e n g t h   =   s t r i n g . l e n g t h ; \ n \ t \ t v a r   v a l u e ; \ n \ t \ t v a r   e x t r a ; \ n \ t \ t w h i l e   ( c o u n t e r   <   l e n g t h )   { \ n \ t \ t \ t v a l u e   =   s t r i n g . c h a r C o d e A t ( c o u n t e r + + ) ; \ n \ t \ t \ t i f   ( v a l u e   > =   0 x D 8 0 0   & &   v a l u e   < =   0 x D B F F   & &   c o u n t e r   <   l e n g t h )   { \ n \ t \ t \ t \ t / /   h i g h   s u r r o g a t e ,   a n d   t h e r e   i s   a   n e x t   c h a r a c t e r \ n \ t \ t \ t \ t e x t r a   =   s t r i n g . c h a r C o d e A t ( c o u n t e r + + ) ; \ n \ t \ t \ t \ t i f   ( ( e x t r a   &   0 x F C 0 0 )   = =   0 x D C 0 0 )   {   / /   l o w   s u r r o g a t e \ n \ t \ t \ t \ t \ t o u t p u t . p u s h ( ( ( v a l u e   &   0 x 3 F F )   < <   1 0 )   +   ( e x t r a   &   0 x 3 F F )   +   0 x 1 0 0 0 0 ) ; \ n \ t \ t \ t \ t }   e l s e   { \ n \ t \ t \ t \ t \ t / /   u n m a t c h e d   s u r r o g a t e ;   o n l y   a p p e n d   t h i s   c o d e   u n i t ,   i n   c a s e   t h e   n e x t \ n \ t \ t \ t \ t \ t / /   c o d e   u n i t   i s   t h e   h i g h   s u r r o g a t e   o f   a   s u r r o g a t e   p a i r \ n \ t \ t \ t \ t \ t o u t p u t . p u s h ( v a l u e ) ; \ n \ t \ t \ t \ t \ t c o u n t e r - - ; \ n \ t \ t \ t \ t } \ n \ t \ t \ t }   e l s e   { \ n \ t \ t \ t \ t o u t p u t . p u s h ( v a l u e ) ; \ n \ t \ t \ t } \ n \ t \ t } \ n \ t \ t r e t u r n   o u t p u t ; \ n \ t } \ n \ n \ t / /   T a k e n   f r o m   h t t p s : / / m t h s . b e / p u n y c o d e \ n \ t f u n c t i o n   u c s 2 e n c o d e ( a r r a y )   { \ n \ t \ t v a r   l e n g t h   =   a r r a y . l e n g t h ; \ n \ t \ t v a r   i n d e x   =   - 1 ; \ n \ t \ t v a r   v a l u e ; \ n \ t \ t v a r   o u t p u t   =   ' ' ; \ n \ t \ t w h i l e   ( + + i n d e x   <   l e n g t h )   { \ n \ t \ t \ t v a l u e   =   a r r a y [ i n d e x ] ; \ n \ t \ t \ t i f   ( v a l u e   >   0 x F F F F )   { \ n \ t \ t \ t \ t v a l u e   - =   0 x 1 0 0 0 0 ; \ n \ t \ t \ t \ t o u t p u t   + =   s t r i n g F r o m C h a r C o d e ( v a l u e   > > >   1 0   &   0 x 3 F F   |   0 x D 8 0 0 ) ; \ n \ t \ t \ t \ t v a l u e   =   0 x D C 0 0   |   v a l u e   &   0 x 3 F F ; \ n \ t \ t \ t } \ n \ t \ t \ t o u t p u t   + =   s t r i n g F r o m C h a r C o d e ( v a l u e ) ; \ n \ t \ t } \ n \ t \ t r e t u r n   o u t p u t ; \ n \ t } \ n \ n \ t / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / \ n \ n \ t f u n c t i o n   c r e a t e B y t e ( c o d e P o i n t ,   s h i f t )   { \ n \ t \ t r e t u r n   s t r i n g F r o m C h a r C o d e ( ( ( c o d e P o i n t   > >   s h i f t )   &   0 x 3 F )   |   0 x 8 0 ) ; \ n \ t } \ n \ n \ t f u n c t i o n   e n c o d e C o d e P o i n t ( c o d e P o i n t )   { \ n \ t \ t i f   ( ( c o d e P o i n t   &   0 x F F F F F F 8 0 )   = =   0 )   {   / /   1 - b y t e   s e q u e n c e \ n \ t \ t \ t r e t u r n   s t r i n g F r o m C h a r C o d e ( c o d e P o i n t ) ; \ n \ t \ t } \ n \ t \ t v a r   s y m b o l   =   ' ' ; \ n \ t \ t i f   ( ( c o d e P o i n t   &   0 x F F F F F 8 0 0 )   = =   0 )   {   / /   2 - b y t e   s e q u e n c e \ n \ t \ t \ t s y m b o l   =   s t r i n g F r o m C h a r C o d e ( ( ( c o d e P o i n t   > >   6 )   &   0 x 1 F )   |   0 x C 0 ) ; \ n \ t \ t } \ n \ t \ t e l s e   i f   ( ( c o d e P o i n t   &   0 x F F F F 0 0 0 0 )   = =   0 )   {   / /   3 - b y t e   s e q u e n c e \ n \ t \ t \ t s y m b o l   =   s t r i n g F r o m C h a r C o d e ( ( ( c o d e P o i n t   > >   1 2 )   &   0 x 0 F )   |   0 x E 0 ) ; \ n \ t \ t \ t s y m b o l   + =   c r e a t e B y t e ( c o d e P o i n t ,   6 ) ; \ n \ t \ t } \ n \ t \ t e l s e   i f   ( ( c o d e P o i n t   &   0 x F F E 0 0 0 0 0 )   = =   0 )   {   / /   4 - b y t e   s e q u e n c e \ n \ t \ t \ t s y m b o l   =   s t r i n g F r o m C h a r C o d e ( ( ( c o d e P o i n t   > >   1 8 )   &   0 x 0 7 )   |   0 x F 0 ) ; \ n \ t \ t \ t s y m b o l   + =   c r e a t e B y t e ( c o d e P o i n t ,   1 2 ) ; \ n \ t \ t \ t s y m b o l   + =   c r e a t e B y t e ( c o d e P o i n t ,   6 ) ; \ n \ t \ t } \ n \ t \ t s y m b o l   + =   s t r i n g F r o m C h a r C o d e ( ( c o d e P o i n t   &   0 x 3 F )   |   0 x 8 0 ) ; \ n \ t \ t r e t u r n   s y m b o l ; \ n \ t } \ n \ n \ t f u n c t i o n   w t f 8 e n c o d e ( s t r i n g )   { \ n \ t \ t v a r   c o d e P o i n t s   =   u c s 2 d e c o d e ( s t r i n g ) ; \ n \ t \ t v a r   l e n g t h   =   c o d e P o i n t s . l e n g t h ; \ n \ t \ t v a r   i n d e x   =   - 1 ; \ n \ t \ t v a r   c o d e P o i n t ; \ n \ t \ t v a r   b y t e S t r i n g   =   ' ' ; \ n \ t \ t w h i l e   ( + + i n d e x   <   l e n g t h )   { \ n \ t \ t \ t c o d e P o i n t   =   c o d e P o i n t s [ i n d e x ] ; \ n \ t \ t \ t b y t e S t r i n g   + =   e n c o d e C o d e P o i n t ( c o d e P o i n t ) ; \ n \ t \ t } \ n \ t \ t r e t u r n   b y t e S t r i n g ; \ n \ t } \ n \ n \ t / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / \ n \ n \ t f u n c t i o n   r e a d C o n t i n u a t i o n B y t e ( )   { \ n \ t \ t i f   ( b y t e I n d e x   > =   b y t e C o u n t )   { \ n \ t \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   b y t e   i n d e x ' ) ; \ n \ t \ t } \ n \ n \ t \ t v a r   c o n t i n u a t i o n B y t e   =   b y t e A r r a y [ b y t e I n d e x ]   &   0 x F F ; \ n \ t \ t b y t e I n d e x + + ; \ n \ n \ t \ t i f   ( ( c o n t i n u a t i o n B y t e   &   0 x C 0 )   = =   0 x 8 0 )   { \ n \ t \ t \ t r e t u r n   c o n t i n u a t i o n B y t e   &   0 x 3 F ; \ n \ t \ t } \ n \ n \ t \ t / /   I f   w e   e n d   u p   h e r e ,   i t   s   n o t   a   c o n t i n u a t i o n   b y t e . \ n \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   c o n t i n u a t i o n   b y t e ' ) ; \ n \ t } \ n \ n \ t f u n c t i o n   d e c o d e S y m b o l ( )   { \ n \ t \ t v a r   b y t e 1 ; \ n \ t \ t v a r   b y t e 2 ; \ n \ t \ t v a r   b y t e 3 ; \ n \ t \ t v a r   b y t e 4 ; \ n \ t \ t v a r   c o d e P o i n t ; \ n \ n \ t \ t i f   ( b y t e I n d e x   >   b y t e C o u n t )   { \ n \ t \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   b y t e   i n d e x ' ) ; \ n \ t \ t } \ n \ n \ t \ t i f   ( b y t e I n d e x   = =   b y t e C o u n t )   { \ n \ t \ t \ t r e t u r n   f a l s e ; \ n \ t \ t } \ n \ n \ t \ t / /   R e a d   t h e   f i r s t   b y t e . \ n \ t \ t b y t e 1   =   b y t e A r r a y [ b y t e I n d e x ]   &   0 x F F ; \ n \ t \ t b y t e I n d e x + + ; \ n \ n \ t \ t / /   1 - b y t e   s e q u e n c e   ( n o   c o n t i n u a t i o n   b y t e s ) \ n \ t \ t i f   ( ( b y t e 1   &   0 x 8 0 )   = =   0 )   { \ n \ t \ t \ t r e t u r n   b y t e 1 ; \ n \ t \ t } \ n \ n \ t \ t / /   2 - b y t e   s e q u e n c e \ n \ t \ t i f   ( ( b y t e 1   &   0 x E 0 )   = =   0 x C 0 )   { \ n \ t \ t \ t v a r   b y t e 2   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t c o d e P o i n t   =   ( ( b y t e 1   &   0 x 1 F )   < <   6 )   |   b y t e 2 ; \ n \ t \ t \ t i f   ( c o d e P o i n t   > =   0 x 8 0 )   { \ n \ t \ t \ t \ t r e t u r n   c o d e P o i n t ; \ n \ t \ t \ t }   e l s e   { \ n \ t \ t \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   c o n t i n u a t i o n   b y t e ' ) ; \ n \ t \ t \ t } \ n \ t \ t } \ n \ n \ t \ t / /   3 - b y t e   s e q u e n c e   ( m a y   i n c l u d e   u n p a i r e d   s u r r o g a t e s ) \ n \ t \ t i f   ( ( b y t e 1   &   0 x F 0 )   = =   0 x E 0 )   { \ n \ t \ t \ t b y t e 2   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t b y t e 3   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t c o d e P o i n t   =   ( ( b y t e 1   &   0 x 0 F )   < <   1 2 )   |   ( b y t e 2   < <   6 )   |   b y t e 3 ; \ n \ t \ t \ t i f   ( c o d e P o i n t   > =   0 x 0 8 0 0 )   { \ n \ t \ t \ t \ t r e t u r n   c o d e P o i n t ; \ n \ t \ t \ t }   e l s e   { \ n \ t \ t \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   c o n t i n u a t i o n   b y t e ' ) ; \ n \ t \ t \ t } \ n \ t \ t } \ n \ n \ t \ t / /   4 - b y t e   s e q u e n c e \ n \ t \ t i f   ( ( b y t e 1   &   0 x F 8 )   = =   0 x F 0 )   { \ n \ t \ t \ t b y t e 2   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t b y t e 3   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t b y t e 4   =   r e a d C o n t i n u a t i o n B y t e ( ) ; \ n \ t \ t \ t c o d e P o i n t   =   ( ( b y t e 1   &   0 x 0 F )   < <   0 x 1 2 )   |   ( b y t e 2   < <   0 x 0 C )   | \ n \ t \ t \ t \ t ( b y t e 3   < <   0 x 0 6 )   |   b y t e 4 ; \ n \ t \ t \ t i f   ( c o d e P o i n t   > =   0 x 0 1 0 0 0 0   & &   c o d e P o i n t   < =   0 x 1 0 F F F F )   { \ n \ t \ t \ t \ t r e t u r n   c o d e P o i n t ; \ n \ t \ t \ t } \ n \ t \ t } \ n \ n \ t \ t t h r o w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( '  [ 1 m  [ 3 1 m I n v a l i d  [ 3 9 m  [ 2 2 m  [ 1 m   W T F - 8   d e t e c t e d ' ) ; \ n \ t } \ n \ n \ t v a r   b y t e A r r a y ; \ n \ t v a r   b y t e C o u n t ; \ n \ t v a r   b y t e I n d e x ; \ n \ t f u n c t i o n   w t f 8 d e c o d e ( b y t e S t r i n g )   { \ n \ t \ t b y t e A r r a y   =   u c s 2 d e c o d e ( b y t e S t r i n g ) ; \ n \ t \ t b y t e C o u n t   =   b y t e A r r a y . l e n g t h ; \ n \ t \ t b y t e I n d e x   =   0 ; \ n \ t \ t v a r   c o d e P o i n t s   =   [ ] ; \ n \ t \ t v a r   t m p ; \ n \ t \ t w h i l e   ( ( t m p   =   d e c o d e S y m b o l ( ) )   ! = =   f a l s e )   { \ n \ t \ t \ t c o d e P o i n t s . p u s h ( t m p ) ; \ n \ t \ t } \ n \ t \ t r e t u r n   u c s 2 e n c o d e ( c o d e P o i n t s ) ; \ n \ t } \ n \ n \ t / * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * / \ n \ n \ t v a r   w t f 8   =   { \ n \ t \ t ' v e r s i o n ' :   ' 1 . 0 . 0 ' , \ n \ t \ t ' e n c o d e ' :   w t f 8 e n c o d e , \ n \ t \ t ' d e c o d e ' :   w t f 8 d e c o d e \ n \ t } ; \ n \ n \ t / /   S o m e   A M D   b u i l d   o p t i m i z e r s ,   l i k e   r . j s ,   c h e c k   f o r   s p e c i f i c   c o n d i t i o n   p a t t e r n s \ n \ t / /   l i k e   t h e   f o l l o w i n g : \ n \ t i f   ( \ n \ t \ t t y p e o f   d e f i n e   = =   ' f u n c t i o n '   & & \ n \ t \ t t y p e o f   d e f i n e . a m d   = =   ' o b j e c t '   & & \ n \ t \ t d e f i n e . a m d \ n \ t )   { \ n \ t \ t d e f i n e ( f u n c t i o n ( )   { \ n \ t \ t \ t r e t u r n   w t f 8 ; \ n \ t \ t } ) ; \ n \ t } \ t e l s e   i f   ( f r e e E x p o r t s   & &   ! f r e e E x p o r t s . n o d e T y p e )   { \ n \ t \ t i f   ( f r e e M o d u l e )   {   / /   i n   N o d e . j s   o r   R i n g o J S   v 0 . 8 . 0 + \ n \ t \ t \ t f r e e M o d u l e . e x p o r t s   =   w t f 8 ; \ n \ t \ t }   e l s e   {   / /   i n   N a r w h a l   o r   R i n g o J S   v 0 . 7 . 0 - \ n \ t \ t \ t v a r   o b j e c t   =   { } ; \ n \ t \ t \ t v a r   h a s O w n P r o p e r t y   =   o b j e c t . h a s O w n P r o p e r t y ; \ n \ t \ t \ t f o r   ( v a r   k e y   i n   w t f 8 )   { \ n \ t \ t \ t \ t h a s O w n P r o p e r t y . c a l l ( w t f 8 ,   k e y )   & &   ( f r e e E x p o r t s [ k e y ]   =   w t f 8 [ k e y ] ) ; \ n \ t \ t \ t } \ n \ t \ t } \ n \ t }   e l s e   {   / /   i n   R h i n o   o r   a   w e b   b r o w s e r \ n \ t \ t r o o t . w t f 8   =   w t f 8 ; \ n \ t } \ n \ n } ( t h i s ) ) ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / w t f - 8 / w t f - 8 . j s \ n / /   m o d u l e   i d   =   3 2 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * \ n   *   b a s e 6 4 - a r r a y b u f f e r \ n   *   h t t p s : / / g i t h u b . c o m / n i k l a s v h / b a s e 6 4 - a r r a y b u f f e r \ n   * \ n   *   C o p y r i g h t   ( c )   2 0 1 2   N i k l a s   v o n   H e r t z e n \ n   *   L i c e n s e d   u n d e r   t h e   M I T   l i c e n s e . \ n   * / \ n ( f u n c t i o n ( ) { \ n     \ " u s e   s t r i c t \ " ; \ n \ n     v a r   c h a r s   =   \ " A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 + / \ " ; \ n \ n     / /   U s e   a   l o o k u p   t a b l e   t o   f i n d   t h e   i n d e x . \ n     v a r   l o o k u p   =   n e w   U i n t 8 A r r a y ( 2 5 6 ) ; \ n     f o r   ( v a r   i   =   0 ;   i   <   c h a r s . l e n g t h ;   i + + )   { \ n         l o o k u p [ c h a r s . c h a r C o d e A t ( i ) ]   =   i ; \ n     } \ n \ n     e x p o r t s . e n c o d e   =   f u n c t i o n ( a r r a y b u f f e r )   { \ n         v a r   b y t e s   =   n e w   U i n t 8 A r r a y ( a r r a y b u f f e r ) , \ n         i ,   l e n   =   b y t e s . l e n g t h ,   b a s e 6 4   =   \ " \ " ; \ n \ n         f o r   ( i   =   0 ;   i   <   l e n ;   i + = 3 )   { \ n             b a s e 6 4   + =   c h a r s [ b y t e s [ i ]   > >   2 ] ; \ n             b a s e 6 4   + =   c h a r s [ ( ( b y t e s [ i ]   &   3 )   < <   4 )   |   ( b y t e s [ i   +   1 ]   > >   4 ) ] ; \ n             b a s e 6 4   + =   c h a r s [ ( ( b y t e s [ i   +   1 ]   &   1 5 )   < <   2 )   |   ( b y t e s [ i   +   2 ]   > >   6 ) ] ; \ n             b a s e 6 4   + =   c h a r s [ b y t e s [ i   +   2 ]   &   6 3 ] ; \ n         } \ n \ n         i f   ( ( l e n   %   3 )   = = =   2 )   { \ n             b a s e 6 4   =   b a s e 6 4 . s u b s t r i n g ( 0 ,   b a s e 6 4 . l e n g t h   -   1 )   +   \ " = \ " ; \ n         }   e l s e   i f   ( l e n   %   3   = = =   1 )   { \ n             b a s e 6 4   =   b a s e 6 4 . s u b s t r i n g ( 0 ,   b a s e 6 4 . l e n g t h   -   2 )   +   \ " = = \ " ; \ n         } \ n \ n         r e t u r n   b a s e 6 4 ; \ n     } ; \ n \ n     e x p o r t s . d e c o d e   =     f u n c t i o n ( b a s e 6 4 )   { \ n         v a r   b u f f e r L e n g t h   =   b a s e 6 4 . l e n g t h   *   0 . 7 5 , \ n         l e n   =   b a s e 6 4 . l e n g t h ,   i ,   p   =   0 , \ n         e n c o d e d 1 ,   e n c o d e d 2 ,   e n c o d e d 3 ,   e n c o d e d 4 ; \ n \ n         i f   ( b a s e 6 4 [ b a s e 6 4 . l e n g t h   -   1 ]   = = =   \ " = \ " )   { \ n             b u f f e r L e n g t h - - ; \ n             i f   ( b a s e 6 4 [ b a s e 6 4 . l e n g t h   -   2 ]   = = =   \ " = \ " )   { \ n                 b u f f e r L e n g t h - - ; \ n             } \ n         } \ n \ n         v a r   a r r a y b u f f e r   =   n e w   A r r a y B u f f e r ( b u f f e r L e n g t h ) , \ n         b y t e s   =   n e w   U i n t 8 A r r a y ( a r r a y b u f f e r ) ; \ n \ n         f o r   ( i   =   0 ;   i   <   l e n ;   i + = 4 )   { \ n             e n c o d e d 1   =   l o o k u p [ b a s e 6 4 . c h a r C o d e A t ( i ) ] ; \ n             e n c o d e d 2   =   l o o k u p [ b a s e 6 4 . c h a r C o d e A t ( i + 1 ) ] ; \ n             e n c o d e d 3   =   l o o k u p [ b a s e 6 4 . c h a r C o d e A t ( i + 2 ) ] ; \ n             e n c o d e d 4   =   l o o k u p [ b a s e 6 4 . c h a r C o d e A t ( i + 3 ) ] ; \ n \ n             b y t e s [ p + + ]   =   ( e n c o d e d 1   < <   2 )   |   ( e n c o d e d 2   > >   4 ) ; \ n             b y t e s [ p + + ]   =   ( ( e n c o d e d 2   &   1 5 )   < <   4 )   |   ( e n c o d e d 3   > >   2 ) ; \ n             b y t e s [ p + + ]   =   ( ( e n c o d e d 3   &   3 )   < <   6 )   |   ( e n c o d e d 4   &   6 3 ) ; \ n         } \ n \ n         r e t u r n   a r r a y b u f f e r ; \ n     } ; \ n } ) ( ) ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / b a s e 6 4 - a r r a y b u f f e r / l i b / b a s e 6 4 - a r r a y b u f f e r . j s \ n / /   m o d u l e   i d   =   3 3 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   C r e a t e   a   b l o b   b u i l d e r   e v e n   w h e n   v e n d o r   p r e f i x e s   e x i s t \ n   * / \ n \ n v a r   B l o b B u i l d e r   =   g l o b a l . B l o b B u i l d e r \ n     | |   g l o b a l . W e b K i t B l o b B u i l d e r \ n     | |   g l o b a l . M S B l o b B u i l d e r \ n     | |   g l o b a l . M o z B l o b B u i l d e r ; \ n \ n / * * \ n   *   C h e c k   i f   B l o b   c o n s t r u c t o r   i s   s u p p o r t e d \ n   * / \ n \ n v a r   b l o b S u p p o r t e d   =   ( f u n c t i o n ( )   { \ n     t r y   { \ n         v a r   a   =   n e w   B l o b ( [ ' h i ' ] ) ; \ n         r e t u r n   a . s i z e   = = =   2 ; \ n     }   c a t c h ( e )   { \ n         r e t u r n   f a l s e ; \ n     } \ n } ) ( ) ; \ n \ n / * * \ n   *   C h e c k   i f   B l o b   c o n s t r u c t o r   s u p p o r t s   A r r a y B u f f e r V i e w s \ n   *   F a i l s   i n   S a f a r i   6 ,   s o   w e   n e e d   t o   m a p   t o   A r r a y B u f f e r s   t h e r e . \ n   * / \ n \ n v a r   b l o b S u p p o r t s A r r a y B u f f e r V i e w   =   b l o b S u p p o r t e d   & &   ( f u n c t i o n ( )   { \ n     t r y   { \ n         v a r   b   =   n e w   B l o b ( [ n e w   U i n t 8 A r r a y ( [ 1 , 2 ] ) ] ) ; \ n         r e t u r n   b . s i z e   = = =   2 ; \ n     }   c a t c h ( e )   { \ n         r e t u r n   f a l s e ; \ n     } \ n } ) ( ) ; \ n \ n / * * \ n   *   C h e c k   i f   B l o b B u i l d e r   i s   s u p p o r t e d \ n   * / \ n \ n v a r   b l o b B u i l d e r S u p p o r t e d   =   B l o b B u i l d e r \ n     & &   B l o b B u i l d e r . p r o t o t y p e . a p p e n d \ n     & &   B l o b B u i l d e r . p r o t o t y p e . g e t B l o b ; \ n \ n / * * \ n   *   H e l p e r   f u n c t i o n   t h a t   m a p s   A r r a y B u f f e r V i e w s   t o   A r r a y B u f f e r s \ n   *   U s e d   b y   B l o b B u i l d e r   c o n s t r u c t o r   a n d   o l d   b r o w s e r s   t h a t   d i d n ' t \ n   *   s u p p o r t   i t   i n   t h e   B l o b   c o n s t r u c t o r . \ n   * / \ n \ n f u n c t i o n   m a p A r r a y B u f f e r V i e w s ( a r y )   { \ n     f o r   ( v a r   i   =   0 ;   i   <   a r y . l e n g t h ;   i + + )   { \ n         v a r   c h u n k   =   a r y [ i ] ; \ n         i f   ( c h u n k . b u f f e r   i n s t a n c e o f   A r r a y B u f f e r )   { \ n             v a r   b u f   =   c h u n k . b u f f e r ; \ n \ n             / /   i f   t h i s   i s   a   s u b a r r a y ,   m a k e   a   c o p y   s o   w e   o n l y \ n             / /   i n c l u d e   t h e   s u b a r r a y   r e g i o n   f r o m   t h e   u n d e r l y i n g   b u f f e r \ n             i f   ( c h u n k . b y t e L e n g t h   ! = =   b u f . b y t e L e n g t h )   { \ n                 v a r   c o p y   =   n e w   U i n t 8 A r r a y ( c h u n k . b y t e L e n g t h ) ; \ n                 c o p y . s e t ( n e w   U i n t 8 A r r a y ( b u f ,   c h u n k . b y t e O f f s e t ,   c h u n k . b y t e L e n g t h ) ) ; \ n                 b u f   =   c o p y . b u f f e r ; \ n             } \ n \ n             a r y [ i ]   =   b u f ; \ n         } \ n     } \ n } \ n \ n f u n c t i o n   B l o b B u i l d e r C o n s t r u c t o r ( a r y ,   o p t i o n s )   { \ n     o p t i o n s   =   o p t i o n s   | |   { } ; \ n \ n     v a r   b b   =   n e w   B l o b B u i l d e r ( ) ; \ n     m a p A r r a y B u f f e r V i e w s ( a r y ) ; \ n \ n     f o r   ( v a r   i   =   0 ;   i   <   a r y . l e n g t h ;   i + + )   { \ n         b b . a p p e n d ( a r y [ i ] ) ; \ n     } \ n \ n     r e t u r n   ( o p t i o n s . t y p e )   ?   b b . g e t B l o b ( o p t i o n s . t y p e )   :   b b . g e t B l o b ( ) ; \ n } ; \ n \ n f u n c t i o n   B l o b C o n s t r u c t o r ( a r y ,   o p t i o n s )   { \ n     m a p A r r a y B u f f e r V i e w s ( a r y ) ; \ n     r e t u r n   n e w   B l o b ( a r y ,   o p t i o n s   | |   { } ) ; \ n } ; \ n \ n m o d u l e . e x p o r t s   =   ( f u n c t i o n ( )   { \ n     i f   ( b l o b S u p p o r t e d )   { \ n         r e t u r n   b l o b S u p p o r t s A r r a y B u f f e r V i e w   ?   g l o b a l . B l o b   :   B l o b C o n s t r u c t o r ; \ n     }   e l s e   i f   ( b l o b B u i l d e r S u p p o r t e d )   { \ n         r e t u r n   B l o b B u i l d e r C o n s t r u c t o r ; \ n     }   e l s e   { \ n         r e t u r n   u n d e f i n e d ; \ n     } \ n } ) ( ) ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / b l o b / i n d e x . j s \ n / /   m o d u l e   i d   =   3 4 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ r \ n / * * \ r \ n   *   E x p o s e   ` E m i t t e r ` . \ r \ n   * / \ r \ n \ r \ n i f   ( t y p e o f   m o d u l e   ! = =   ' u n d e f i n e d ' )   { \ r \ n     m o d u l e . e x p o r t s   =   E m i t t e r ; \ r \ n } \ r \ n \ r \ n / * * \ r \ n   *   I n i t i a l i z e   a   n e w   ` E m i t t e r ` . \ r \ n   * \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n f u n c t i o n   E m i t t e r ( o b j )   { \ r \ n     i f   ( o b j )   r e t u r n   m i x i n ( o b j ) ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   M i x i n   t h e   e m i t t e r   p r o p e r t i e s . \ r \ n   * \ r \ n   *   @ p a r a m   { O b j e c t }   o b j \ r \ n   *   @ r e t u r n   { O b j e c t } \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n f u n c t i o n   m i x i n ( o b j )   { \ r \ n     f o r   ( v a r   k e y   i n   E m i t t e r . p r o t o t y p e )   { \ r \ n         o b j [ k e y ]   =   E m i t t e r . p r o t o t y p e [ k e y ] ; \ r \ n     } \ r \ n     r e t u r n   o b j ; \ r \ n } \ r \ n \ r \ n / * * \ r \ n   *   L i s t e n   o n   t h e   g i v e n   ` e v e n t `   w i t h   ` f n ` . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ p a r a m   { F u n c t i o n }   f n \ r \ n   *   @ r e t u r n   { E m i t t e r } \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . o n   = \ r \ n E m i t t e r . p r o t o t y p e . a d d E v e n t L i s t e n e r   =   f u n c t i o n ( e v e n t ,   f n ) { \ r \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ r \ n     ( t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ]   =   t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ]   | |   [ ] ) \ r \ n         . p u s h ( f n ) ; \ r \ n     r e t u r n   t h i s ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   A d d s   a n   ` e v e n t `   l i s t e n e r   t h a t   w i l l   b e   i n v o k e d   a   s i n g l e \ r \ n   *   t i m e   t h e n   a u t o m a t i c a l l y   r e m o v e d . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ p a r a m   { F u n c t i o n }   f n \ r \ n   *   @ r e t u r n   { E m i t t e r } \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . o n c e   =   f u n c t i o n ( e v e n t ,   f n ) { \ r \ n     f u n c t i o n   o n ( )   { \ r \ n         t h i s . o f f ( e v e n t ,   o n ) ; \ r \ n         f n . a p p l y ( t h i s ,   a r g u m e n t s ) ; \ r \ n     } \ r \ n \ r \ n     o n . f n   =   f n ; \ r \ n     t h i s . o n ( e v e n t ,   o n ) ; \ r \ n     r e t u r n   t h i s ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   R e m o v e   t h e   g i v e n   c a l l b a c k   f o r   ` e v e n t `   o r   a l l \ r \ n   *   r e g i s t e r e d   c a l l b a c k s . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ p a r a m   { F u n c t i o n }   f n \ r \ n   *   @ r e t u r n   { E m i t t e r } \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . o f f   = \ r \ n E m i t t e r . p r o t o t y p e . r e m o v e L i s t e n e r   = \ r \ n E m i t t e r . p r o t o t y p e . r e m o v e A l l L i s t e n e r s   = \ r \ n E m i t t e r . p r o t o t y p e . r e m o v e E v e n t L i s t e n e r   =   f u n c t i o n ( e v e n t ,   f n ) { \ r \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ r \ n \ r \ n     / /   a l l \ r \ n     i f   ( 0   = =   a r g u m e n t s . l e n g t h )   { \ r \ n         t h i s . _ c a l l b a c k s   =   { } ; \ r \ n         r e t u r n   t h i s ; \ r \ n     } \ r \ n \ r \ n     / /   s p e c i f i c   e v e n t \ r \ n     v a r   c a l l b a c k s   =   t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ] ; \ r \ n     i f   ( ! c a l l b a c k s )   r e t u r n   t h i s ; \ r \ n \ r \ n     / /   r e m o v e   a l l   h a n d l e r s \ r \ n     i f   ( 1   = =   a r g u m e n t s . l e n g t h )   { \ r \ n         d e l e t e   t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ] ; \ r \ n         r e t u r n   t h i s ; \ r \ n     } \ r \ n \ r \ n     / /   r e m o v e   s p e c i f i c   h a n d l e r \ r \ n     v a r   c b ; \ r \ n     f o r   ( v a r   i   =   0 ;   i   <   c a l l b a c k s . l e n g t h ;   i + + )   { \ r \ n         c b   =   c a l l b a c k s [ i ] ; \ r \ n         i f   ( c b   = = =   f n   | |   c b . f n   = = =   f n )   { \ r \ n             c a l l b a c k s . s p l i c e ( i ,   1 ) ; \ r \ n             b r e a k ; \ r \ n         } \ r \ n     } \ r \ n     r e t u r n   t h i s ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   E m i t   ` e v e n t `   w i t h   t h e   g i v e n   a r g s . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ p a r a m   { M i x e d }   . . . \ r \ n   *   @ r e t u r n   { E m i t t e r } \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . e m i t   =   f u n c t i o n ( e v e n t ) { \ r \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ r \ n     v a r   a r g s   =   [ ] . s l i c e . c a l l ( a r g u m e n t s ,   1 ) \ r \ n         ,   c a l l b a c k s   =   t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ] ; \ r \ n \ r \ n     i f   ( c a l l b a c k s )   { \ r \ n         c a l l b a c k s   =   c a l l b a c k s . s l i c e ( 0 ) ; \ r \ n         f o r   ( v a r   i   =   0 ,   l e n   =   c a l l b a c k s . l e n g t h ;   i   <   l e n ;   + + i )   { \ r \ n             c a l l b a c k s [ i ] . a p p l y ( t h i s ,   a r g s ) ; \ r \ n         } \ r \ n     } \ r \ n \ r \ n     r e t u r n   t h i s ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   R e t u r n   a r r a y   o f   c a l l b a c k s   f o r   ` e v e n t ` . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ r e t u r n   { A r r a y } \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . l i s t e n e r s   =   f u n c t i o n ( e v e n t ) { \ r \ n     t h i s . _ c a l l b a c k s   =   t h i s . _ c a l l b a c k s   | |   { } ; \ r \ n     r e t u r n   t h i s . _ c a l l b a c k s [ ' $ '   +   e v e n t ]   | |   [ ] ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   C h e c k   i f   t h i s   e m i t t e r   h a s   ` e v e n t `   h a n d l e r s . \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   e v e n t \ r \ n   *   @ r e t u r n   { B o o l e a n } \ r \ n   *   @ a p i   p u b l i c \ r \ n   * / \ r \ n \ r \ n E m i t t e r . p r o t o t y p e . h a s L i s t e n e r s   =   f u n c t i o n ( e v e n t ) { \ r \ n     r e t u r n   ! !   t h i s . l i s t e n e r s ( e v e n t ) . l e n g t h ; \ r \ n } ; \ r \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / c o m p o n e n t - e m i t t e r / i n d e x . j s \ n / /   m o d u l e   i d   =   3 5 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ r \ n   *   C o m p i l e s   a   q u e r y s t r i n g \ r \ n   *   R e t u r n s   s t r i n g   r e p r e s e n t a t i o n   o f   t h e   o b j e c t \ r \ n   * \ r \ n   *   @ p a r a m   { O b j e c t } \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n e x p o r t s . e n c o d e   =   f u n c t i o n   ( o b j )   { \ r \ n     v a r   s t r   =   ' ' ; \ r \ n \ r \ n     f o r   ( v a r   i   i n   o b j )   { \ r \ n         i f   ( o b j . h a s O w n P r o p e r t y ( i ) )   { \ r \ n             i f   ( s t r . l e n g t h )   s t r   + =   ' & ' ; \ r \ n             s t r   + =   e n c o d e U R I C o m p o n e n t ( i )   +   ' = '   +   e n c o d e U R I C o m p o n e n t ( o b j [ i ] ) ; \ r \ n         } \ r \ n     } \ r \ n \ r \ n     r e t u r n   s t r ; \ r \ n } ; \ r \ n \ r \ n / * * \ r \ n   *   P a r s e s   a   s i m p l e   q u e r y s t r i n g   i n t o   a n   o b j e c t \ r \ n   * \ r \ n   *   @ p a r a m   { S t r i n g }   q s \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n e x p o r t s . d e c o d e   =   f u n c t i o n ( q s ) { \ r \ n     v a r   q r y   =   { } ; \ r \ n     v a r   p a i r s   =   q s . s p l i t ( ' & ' ) ; \ r \ n     f o r   ( v a r   i   =   0 ,   l   =   p a i r s . l e n g t h ;   i   <   l ;   i + + )   { \ r \ n         v a r   p a i r   =   p a i r s [ i ] . s p l i t ( ' = ' ) ; \ r \ n         q r y [ d e c o d e U R I C o m p o n e n t ( p a i r [ 0 ] ) ]   =   d e c o d e U R I C o m p o n e n t ( p a i r [ 1 ] ) ; \ r \ n     } \ r \ n     r e t u r n   q r y ; \ r \ n } ; \ r \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p a r s e q s / i n d e x . j s \ n / /   m o d u l e   i d   =   3 6 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( a ,   b ) { \ n     v a r   f n   =   f u n c t i o n ( ) { } ; \ n     f n . p r o t o t y p e   =   b . p r o t o t y p e ; \ n     a . p r o t o t y p e   =   n e w   f n ; \ n     a . p r o t o t y p e . c o n s t r u c t o r   =   a ; \ n } ; \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / c o m p o n e n t - i n h e r i t / i n d e x . j s \ n / /   m o d u l e   i d   =   3 7 \ n / /   m o d u l e   c h u n k s   =   0 " , " ' u s e   s t r i c t ' ; \ n \ n v a r   a l p h a b e t   =   ' 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z - _ ' . s p l i t ( ' ' ) \ n     ,   l e n g t h   =   6 4 \ n     ,   m a p   =   { } \ n     ,   s e e d   =   0 \ n     ,   i   =   0 \ n     ,   p r e v ; \ n \ n / * * \ n   *   R e t u r n   a   s t r i n g   r e p r e s e n t i n g   t h e   s p e c i f i e d   n u m b e r . \ n   * \ n   *   @ p a r a m   { N u m b e r }   n u m   T h e   n u m b e r   t o   c o n v e r t . \ n   *   @ r e t u r n s   { S t r i n g }   T h e   s t r i n g   r e p r e s e n t a t i o n   o f   t h e   n u m b e r . \ n   *   @ a p i   p u b l i c \ n   * / \ n f u n c t i o n   e n c o d e ( n u m )   { \ n     v a r   e n c o d e d   =   ' ' ; \ n \ n     d o   { \ n         e n c o d e d   =   a l p h a b e t [ n u m   %   l e n g t h ]   +   e n c o d e d ; \ n         n u m   =   M a t h . f l o o r ( n u m   /   l e n g t h ) ; \ n     }   w h i l e   ( n u m   >   0 ) ; \ n \ n     r e t u r n   e n c o d e d ; \ n } \ n \ n / * * \ n   *   R e t u r n   t h e   i n t e g e r   v a l u e   s p e c i f i e d   b y   t h e   g i v e n   s t r i n g . \ n   * \ n   *   @ p a r a m   { S t r i n g }   s t r   T h e   s t r i n g   t o   c o n v e r t . \ n   *   @ r e t u r n s   { N u m b e r }   T h e   i n t e g e r   v a l u e   r e p r e s e n t e d   b y   t h e   s t r i n g . \ n   *   @ a p i   p u b l i c \ n   * / \ n f u n c t i o n   d e c o d e ( s t r )   { \ n     v a r   d e c o d e d   =   0 ; \ n \ n     f o r   ( i   =   0 ;   i   <   s t r . l e n g t h ;   i + + )   { \ n         d e c o d e d   =   d e c o d e d   *   l e n g t h   +   m a p [ s t r . c h a r A t ( i ) ] ; \ n     } \ n \ n     r e t u r n   d e c o d e d ; \ n } \ n \ n / * * \ n   *   Y e a s t :   A   t i n y   g r o w i n g   i d   g e n e r a t o r . \ n   * \ n   *   @ r e t u r n s   { S t r i n g }   A   u n i q u e   i d . \ n   *   @ a p i   p u b l i c \ n   * / \ n f u n c t i o n   y e a s t ( )   { \ n     v a r   n o w   =   e n c o d e ( + n e w   D a t e ( ) ) ; \ n \ n     i f   ( n o w   ! = =   p r e v )   r e t u r n   s e e d   =   0 ,   p r e v   =   n o w ; \ n     r e t u r n   n o w   + ' . ' +   e n c o d e ( s e e d + + ) ; \ n } \ n \ n / / \ n / /   M a p   e a c h   c h a r a c t e r   t o   i t s   i n d e x . \ n / / \ n f o r   ( ;   i   <   l e n g t h ;   i + + )   m a p [ a l p h a b e t [ i ] ]   =   i ; \ n \ n / / \ n / /   E x p o s e   t h e   ` y e a s t ` ,   ` e n c o d e `   a n d   ` d e c o d e `   f u n c t i o n s . \ n / / \ n y e a s t . e n c o d e   =   e n c o d e ; \ n y e a s t . d e c o d e   =   d e c o d e ; \ n m o d u l e . e x p o r t s   =   y e a s t ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / y e a s t / i n d e x . j s \ n / /   m o d u l e   i d   =   3 8 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   r e q u i r e m e n t s . \ n   * / \ n \ n v a r   P o l l i n g   =   r e q u i r e ( ' . / p o l l i n g ' ) ; \ n v a r   i n h e r i t   =   r e q u i r e ( ' c o m p o n e n t - i n h e r i t ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   J S O N P P o l l i n g ; \ n \ n / * * \ n   *   C a c h e d   r e g u l a r   e x p r e s s i o n s . \ n   * / \ n \ n v a r   r N e w l i n e   =   / \ \ n / g ; \ n v a r   r E s c a p e d N e w l i n e   =   / \ \ \ \ n / g ; \ n \ n / * * \ n   *   G l o b a l   J S O N P   c a l l b a c k s . \ n   * / \ n \ n v a r   c a l l b a c k s ; \ n \ n / * * \ n   *   N o o p . \ n   * / \ n \ n f u n c t i o n   e m p t y   ( )   {   } \ n \ n / * * \ n   *   J S O N P   P o l l i n g   c o n s t r u c t o r . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t s . \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   J S O N P P o l l i n g   ( o p t s )   { \ n     P o l l i n g . c a l l ( t h i s ,   o p t s ) ; \ n \ n     t h i s . q u e r y   =   t h i s . q u e r y   | |   { } ; \ n \ n     / /   d e f i n e   g l o b a l   c a l l b a c k s   a r r a y   i f   n o t   p r e s e n t \ n     / /   w e   d o   t h i s   h e r e   ( l a z i l y )   t o   a v o i d   u n n e e d e d   g l o b a l   p o l l u t i o n \ n     i f   ( ! c a l l b a c k s )   { \ n         / /   w e   n e e d   t o   c o n s i d e r   m u l t i p l e   e n g i n e s   i n   t h e   s a m e   p a g e \ n         i f   ( ! g l o b a l . _ _ _ e i o )   g l o b a l . _ _ _ e i o   =   [ ] ; \ n         c a l l b a c k s   =   g l o b a l . _ _ _ e i o ; \ n     } \ n \ n     / /   c a l l b a c k   i d e n t i f i e r \ n     t h i s . i n d e x   =   c a l l b a c k s . l e n g t h ; \ n \ n     / /   a d d   c a l l b a c k   t o   j s o n p   g l o b a l \ n     v a r   s e l f   =   t h i s ; \ n     c a l l b a c k s . p u s h ( f u n c t i o n   ( m s g )   { \ n         s e l f . o n D a t a ( m s g ) ; \ n     } ) ; \ n \ n     / /   a p p e n d   t o   q u e r y   s t r i n g \ n     t h i s . q u e r y . j   =   t h i s . i n d e x ; \ n \ n     / /   p r e v e n t   s p u r i o u s   e r r o r s   f r o m   b e i n g   e m i t t e d   w h e n   t h e   w i n d o w   i s   u n l o a d e d \ n     i f   ( g l o b a l . d o c u m e n t   & &   g l o b a l . a d d E v e n t L i s t e n e r )   { \ n         g l o b a l . a d d E v e n t L i s t e n e r ( ' b e f o r e u n l o a d ' ,   f u n c t i o n   ( )   { \ n             i f   ( s e l f . s c r i p t )   s e l f . s c r i p t . o n e r r o r   =   e m p t y ; \ n         } ,   f a l s e ) ; \ n     } \ n } \ n \ n / * * \ n   *   I n h e r i t s   f r o m   P o l l i n g . \ n   * / \ n \ n i n h e r i t ( J S O N P P o l l i n g ,   P o l l i n g ) ; \ n \ n / * \ n   *   J S O N P   o n l y   s u p p o r t s   b i n a r y   a s   b a s e 6 4   e n c o d e d   s t r i n g s \ n   * / \ n \ n J S O N P P o l l i n g . p r o t o t y p e . s u p p o r t s B i n a r y   =   f a l s e ; \ n \ n / * * \ n   *   C l o s e s   t h e   s o c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n J S O N P P o l l i n g . p r o t o t y p e . d o C l o s e   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . s c r i p t )   { \ n         t h i s . s c r i p t . p a r e n t N o d e . r e m o v e C h i l d ( t h i s . s c r i p t ) ; \ n         t h i s . s c r i p t   =   n u l l ; \ n     } \ n \ n     i f   ( t h i s . f o r m )   { \ n         t h i s . f o r m . p a r e n t N o d e . r e m o v e C h i l d ( t h i s . f o r m ) ; \ n         t h i s . f o r m   =   n u l l ; \ n         t h i s . i f r a m e   =   n u l l ; \ n     } \ n \ n     P o l l i n g . p r o t o t y p e . d o C l o s e . c a l l ( t h i s ) ; \ n } ; \ n \ n / * * \ n   *   S t a r t s   a   p o l l   c y c l e . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n J S O N P P o l l i n g . p r o t o t y p e . d o P o l l   =   f u n c t i o n   ( )   { \ n     v a r   s e l f   =   t h i s ; \ n     v a r   s c r i p t   =   d o c u m e n t . c r e a t e E l e m e n t ( ' s c r i p t ' ) ; \ n \ n     i f   ( t h i s . s c r i p t )   { \ n         t h i s . s c r i p t . p a r e n t N o d e . r e m o v e C h i l d ( t h i s . s c r i p t ) ; \ n         t h i s . s c r i p t   =   n u l l ; \ n     } \ n \ n     s c r i p t . a s y n c   =   t r u e ; \ n     s c r i p t . s r c   =   t h i s . u r i ( ) ; \ n     s c r i p t . o n e r r o r   =   f u n c t i o n   ( e )   { \ n         s e l f . o n E r r o r ( ' j s o n p   p o l l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e ) ; \ n     } ; \ n \ n     v a r   i n s e r t A t   =   d o c u m e n t . g e t E l e m e n t s B y T a g N a m e ( ' s c r i p t ' ) [ 0 ] ; \ n     i f   ( i n s e r t A t )   { \ n         i n s e r t A t . p a r e n t N o d e . i n s e r t B e f o r e ( s c r i p t ,   i n s e r t A t ) ; \ n     }   e l s e   { \ n         ( d o c u m e n t . h e a d   | |   d o c u m e n t . b o d y ) . a p p e n d C h i l d ( s c r i p t ) ; \ n     } \ n     t h i s . s c r i p t   =   s c r i p t ; \ n \ n     v a r   i s U A g e c k o   =   ' u n d e f i n e d '   ! = =   t y p e o f   n a v i g a t o r   & &   / g e c k o / i . t e s t ( n a v i g a t o r . u s e r A g e n t ) ; \ n \ n     i f   ( i s U A g e c k o )   { \ n         s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             v a r   i f r a m e   =   d o c u m e n t . c r e a t e E l e m e n t ( ' i f r a m e ' ) ; \ n             d o c u m e n t . b o d y . a p p e n d C h i l d ( i f r a m e ) ; \ n             d o c u m e n t . b o d y . r e m o v e C h i l d ( i f r a m e ) ; \ n         } ,   1 0 0 ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   W r i t e s   w i t h   a   h i d d e n   i f r a m e . \ n   * \ n   *   @ p a r a m   { S t r i n g }   d a t a   t o   s e n d \ n   *   @ p a r a m   { F u n c t i o n }   c a l l e d   u p o n   f l u s h . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n J S O N P P o l l i n g . p r o t o t y p e . d o W r i t e   =   f u n c t i o n   ( d a t a ,   f n )   { \ n     v a r   s e l f   =   t h i s ; \ n \ n     i f   ( ! t h i s . f o r m )   { \ n         v a r   f o r m   =   d o c u m e n t . c r e a t e E l e m e n t ( ' f o r m ' ) ; \ n         v a r   a r e a   =   d o c u m e n t . c r e a t e E l e m e n t ( ' t e x t a r e a ' ) ; \ n         v a r   i d   =   t h i s . i f r a m e I d   =   ' e i o _ i f r a m e _ '   +   t h i s . i n d e x ; \ n         v a r   i f r a m e ; \ n \ n         f o r m . c l a s s N a m e   =   ' s o c k e t i o ' ; \ n         f o r m . s t y l e . p o s i t i o n   =   ' a b s o l u t e ' ; \ n         f o r m . s t y l e . t o p   =   ' - 1 0 0 0 p x ' ; \ n         f o r m . s t y l e . l e f t   =   ' - 1 0 0 0 p x ' ; \ n         f o r m . t a r g e t   =   i d ; \ n         f o r m . m e t h o d   =   ' P O S T ' ; \ n         f o r m . s e t A t t r i b u t e ( ' a c c e p t - c h a r s e t ' ,   ' u t f - 8 ' ) ; \ n         a r e a . n a m e   =   ' d ' ; \ n         f o r m . a p p e n d C h i l d ( a r e a ) ; \ n         d o c u m e n t . b o d y . a p p e n d C h i l d ( f o r m ) ; \ n \ n         t h i s . f o r m   =   f o r m ; \ n         t h i s . a r e a   =   a r e a ; \ n     } \ n \ n     t h i s . f o r m . a c t i o n   =   t h i s . u r i ( ) ; \ n \ n     f u n c t i o n   c o m p l e t e   ( )   { \ n         i n i t I f r a m e ( ) ; \ n         f n ( ) ; \ n     } \ n \ n     f u n c t i o n   i n i t I f r a m e   ( )   { \ n         i f   ( s e l f . i f r a m e )   { \ n             t r y   { \ n                 s e l f . f o r m . r e m o v e C h i l d ( s e l f . i f r a m e ) ; \ n             }   c a t c h   ( e )   { \ n                 s e l f . o n E r r o r ( ' j s o n p   p o l l i n g   i f r a m e   r e m o v a l    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e ) ; \ n             } \ n         } \ n \ n         t r y   { \ n             / /   i e 6   d y n a m i c   i f r a m e s   w i t h   t a r g e t = \ " \ "   s u p p o r t   ( t h a n k s   C h r i s   L a m b a c h e r ) \ n             v a r   h t m l   =   ' < i f r a m e   s r c = \ " j a v a s c r i p t : 0 \ "   n a m e = \ " '   +   s e l f . i f r a m e I d   +   ' \ " > ' ; \ n             i f r a m e   =   d o c u m e n t . c r e a t e E l e m e n t ( h t m l ) ; \ n         }   c a t c h   ( e )   { \ n             i f r a m e   =   d o c u m e n t . c r e a t e E l e m e n t ( ' i f r a m e ' ) ; \ n             i f r a m e . n a m e   =   s e l f . i f r a m e I d ; \ n             i f r a m e . s r c   =   ' j a v a s c r i p t : 0 ' ; \ n         } \ n \ n         i f r a m e . i d   =   s e l f . i f r a m e I d ; \ n \ n         s e l f . f o r m . a p p e n d C h i l d ( i f r a m e ) ; \ n         s e l f . i f r a m e   =   i f r a m e ; \ n     } \ n \ n     i n i t I f r a m e ( ) ; \ n \ n     / /   e s c a p e   \ \ n   t o   p r e v e n t   i t   f r o m   b e i n g   c o n v e r t e d   i n t o   \ \ r \ \ n   b y   s o m e   U A s \ n     / /   d o u b l e   e s c a p i n g   i s    [ 1 m  [ 3 3 m r e q u i r e d  [ 3 9 m  [ 2 2 m  [ 1 m   f o r   e s c a p e d   n e w   l i n e s   b e c a u s e   u n e s c a p i n g   o f   n e w   l i n e s   c a n   b e   d o n e   s a f e l y   o n   s e r v e r - s i d e \ n     d a t a   =   d a t a . r e p l a c e ( r E s c a p e d N e w l i n e ,   ' \ \ \ \ \ \ n ' ) ; \ n     t h i s . a r e a . v a l u e   =   d a t a . r e p l a c e ( r N e w l i n e ,   ' \ \ \ \ n ' ) ; \ n \ n     t r y   { \ n         t h i s . f o r m . s u b m i t ( ) ; \ n     }   c a t c h   ( e )   { } \ n \ n     i f   ( t h i s . i f r a m e . a t t a c h E v e n t )   { \ n         t h i s . i f r a m e . o n r e a d y s t a t e c h a n g e   =   f u n c t i o n   ( )   { \ n             i f   ( s e l f . i f r a m e . r e a d y S t a t e   = = =   ' c o m p l e t e ' )   { \ n                 c o m p l e t e ( ) ; \ n             } \ n         } ; \ n     }   e l s e   { \ n         t h i s . i f r a m e . o n l o a d   =   c o m p l e t e ; \ n     } \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / p o l l i n g - j s o n p . j s \ n / /   m o d u l e   i d   =   3 9 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   T r a n s p o r t   =   r e q u i r e ( ' . . / t r a n s p o r t ' ) ; \ n v a r   p a r s e r   =   r e q u i r e ( ' e n g i n e . i o - p a r s e r ' ) ; \ n v a r   p a r s e q s   =   r e q u i r e ( ' p a r s e q s ' ) ; \ n v a r   i n h e r i t   =   r e q u i r e ( ' c o m p o n e n t - i n h e r i t ' ) ; \ n v a r   y e a s t   =   r e q u i r e ( ' y e a s t ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' e n g i n e . i o - c l i e n t : w e b s o c k e t ' ) ; \ n v a r   B r o w s e r W e b S o c k e t   =   g l o b a l . W e b S o c k e t   | |   g l o b a l . M o z W e b S o c k e t ; \ n v a r   N o d e W e b S o c k e t ; \ n i f   ( t y p e o f   w i n d o w   = = =   ' u n d e f i n e d ' )   { \ n     t r y   { \ n         N o d e W e b S o c k e t   =   r e q u i r e ( ' w s ' ) ; \ n     }   c a t c h   ( e )   {   } \ n } \ n \ n / * * \ n   *   G e t   e i t h e r   t h e   ` W e b S o c k e t `   o r   ` M o z W e b S o c k e t `   g l o b a l s \ n   *   i n   t h e   b r o w s e r   o r   t r y   t o   r e s o l v e   W e b S o c k e t - c o m p a t i b l e \ n   *   i n t e r f a c e   e x p o s e d   b y   ` w s `   f o r   N o d e - l i k e   e n v i r o n m e n t . \ n   * / \ n \ n v a r   W e b S o c k e t   =   B r o w s e r W e b S o c k e t ; \ n i f   ( ! W e b S o c k e t   & &   t y p e o f   w i n d o w   = = =   ' u n d e f i n e d ' )   { \ n     W e b S o c k e t   =   N o d e W e b S o c k e t ; \ n } \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   W S ; \ n \ n / * * \ n   *   W e b S o c k e t   t r a n s p o r t   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   { O b j e c t }   c o n n e c t i o n   o p t i o n s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   W S   ( o p t s )   { \ n     v a r   f o r c e B a s e 6 4   =   ( o p t s   & &   o p t s . f o r c e B a s e 6 4 ) ; \ n     i f   ( f o r c e B a s e 6 4 )   { \ n         t h i s . s u p p o r t s B i n a r y   =   f a l s e ; \ n     } \ n     t h i s . p e r M e s s a g e D e f l a t e   =   o p t s . p e r M e s s a g e D e f l a t e ; \ n     t h i s . u s i n g B r o w s e r W e b S o c k e t   =   B r o w s e r W e b S o c k e t   & &   ! o p t s . f o r c e N o d e ; \ n     i f   ( ! t h i s . u s i n g B r o w s e r W e b S o c k e t )   { \ n         W e b S o c k e t   =   N o d e W e b S o c k e t ; \ n     } \ n     T r a n s p o r t . c a l l ( t h i s ,   o p t s ) ; \ n } \ n \ n / * * \ n   *   I n h e r i t s   f r o m   T r a n s p o r t . \ n   * / \ n \ n i n h e r i t ( W S ,   T r a n s p o r t ) ; \ n \ n / * * \ n   *   T r a n s p o r t   n a m e . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n W S . p r o t o t y p e . n a m e   =   ' w e b s o c k e t ' ; \ n \ n / * \ n   *   W e b S o c k e t s   s u p p o r t   b i n a r y \ n   * / \ n \ n W S . p r o t o t y p e . s u p p o r t s B i n a r y   =   t r u e ; \ n \ n / * * \ n   *   O p e n s   s o c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . d o O p e n   =   f u n c t i o n   ( )   { \ n     i f   ( ! t h i s . c h e c k ( ) )   { \ n         / /   l e t   p r o b e   t i m e o u t \ n         r e t u r n ; \ n     } \ n \ n     v a r   u r i   =   t h i s . u r i ( ) ; \ n     v a r   p r o t o c o l s   =   v o i d   ( 0 ) ; \ n     v a r   o p t s   =   { \ n         a g e n t :   t h i s . a g e n t , \ n         p e r M e s s a g e D e f l a t e :   t h i s . p e r M e s s a g e D e f l a t e \ n     } ; \ n \ n     / /   S S L   o p t i o n s   f o r   N o d e . j s   c l i e n t \ n     o p t s . p f x   =   t h i s . p f x ; \ n     o p t s . k e y   =   t h i s . k e y ; \ n     o p t s . p a s s p h r a s e   =   t h i s . p a s s p h r a s e ; \ n     o p t s . c e r t   =   t h i s . c e r t ; \ n     o p t s . c a   =   t h i s . c a ; \ n     o p t s . c i p h e r s   =   t h i s . c i p h e r s ; \ n     o p t s . r e j e c t U n a u t h o r i z e d   =   t h i s . r e j e c t U n a u t h o r i z e d ; \ n     i f   ( t h i s . e x t r a H e a d e r s )   { \ n         o p t s . h e a d e r s   =   t h i s . e x t r a H e a d e r s ; \ n     } \ n     i f   ( t h i s . l o c a l A d d r e s s )   { \ n         o p t s . l o c a l A d d r e s s   =   t h i s . l o c a l A d d r e s s ; \ n     } \ n \ n     t r y   { \ n         t h i s . w s   =   t h i s . u s i n g B r o w s e r W e b S o c k e t   ?   n e w   W e b S o c k e t ( u r i )   :   n e w   W e b S o c k e t ( u r i ,   p r o t o c o l s ,   o p t s ) ; \ n     }   c a t c h   ( e r r )   { \ n         r e t u r n   t h i s . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e r r ) ; \ n     } \ n \ n     i f   ( t h i s . w s . b i n a r y T y p e   = = =   u n d e f i n e d )   { \ n         t h i s . s u p p o r t s B i n a r y   =   f a l s e ; \ n     } \ n \ n     i f   ( t h i s . w s . s u p p o r t s   & &   t h i s . w s . s u p p o r t s . b i n a r y )   { \ n         t h i s . s u p p o r t s B i n a r y   =   t r u e ; \ n         t h i s . w s . b i n a r y T y p e   =   ' n o d e b u f f e r ' ; \ n     }   e l s e   { \ n         t h i s . w s . b i n a r y T y p e   =   ' a r r a y b u f f e r ' ; \ n     } \ n \ n     t h i s . a d d E v e n t L i s t e n e r s ( ) ; \ n } ; \ n \ n / * * \ n   *   A d d s   e v e n t   l i s t e n e r s   t o   t h e   s o c k e t \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . a d d E v e n t L i s t e n e r s   =   f u n c t i o n   ( )   { \ n     v a r   s e l f   =   t h i s ; \ n \ n     t h i s . w s . o n o p e n   =   f u n c t i o n   ( )   { \ n         s e l f . o n O p e n ( ) ; \ n     } ; \ n     t h i s . w s . o n c l o s e   =   f u n c t i o n   ( )   { \ n         s e l f . o n C l o s e ( ) ; \ n     } ; \ n     t h i s . w s . o n m e s s a g e   =   f u n c t i o n   ( e v )   { \ n         s e l f . o n D a t a ( e v . d a t a ) ; \ n     } ; \ n     t h i s . w s . o n e r r o r   =   f u n c t i o n   ( e )   { \ n         s e l f . o n E r r o r ( ' w e b s o c k e t    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   e ) ; \ n     } ; \ n } ; \ n \ n / * * \ n   *   W r i t e s   d a t a   t o   s o c k e t . \ n   * \ n   *   @ p a r a m   { A r r a y }   a r r a y   o f   p a c k e t s . \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . w r i t e   =   f u n c t i o n   ( p a c k e t s )   { \ n     v a r   s e l f   =   t h i s ; \ n     t h i s . w r i t a b l e   =   f a l s e ; \ n \ n     / /   e n c o d e P a c k e t   e f f i c i e n t   a s   i t   u s e s   W S   f r a m i n g \ n     / /   n o   n e e d   f o r   e n c o d e P a y l o a d \ n     v a r   t o t a l   =   p a c k e t s . l e n g t h ; \ n     f o r   ( v a r   i   =   0 ,   l   =   t o t a l ;   i   <   l ;   i + + )   { \ n         ( f u n c t i o n   ( p a c k e t )   { \ n             p a r s e r . e n c o d e P a c k e t ( p a c k e t ,   s e l f . s u p p o r t s B i n a r y ,   f u n c t i o n   ( d a t a )   { \ n                 i f   ( ! s e l f . u s i n g B r o w s e r W e b S o c k e t )   { \ n                     / /   a l w a y s   c r e a t e   a   n e w   o b j e c t   ( G H - 4 3 7 ) \ n                     v a r   o p t s   =   { } ; \ n                     i f   ( p a c k e t . o p t i o n s )   { \ n                         o p t s . c o m p r e s s   =   p a c k e t . o p t i o n s . c o m p r e s s ; \ n                     } \ n \ n                     i f   ( s e l f . p e r M e s s a g e D e f l a t e )   { \ n                         v a r   l e n   =   ' s t r i n g '   = = =   t y p e o f   d a t a   ?   g l o b a l . B u f f e r . b y t e L e n g t h ( d a t a )   :   d a t a . l e n g t h ; \ n                         i f   ( l e n   <   s e l f . p e r M e s s a g e D e f l a t e . t h r e s h o l d )   { \ n                             o p t s . c o m p r e s s   =   f a l s e ; \ n                         } \ n                     } \ n                 } \ n \ n                 / /   S o m e t i m e s   t h e   w e b s o c k e t   h a s   a l r e a d y   b e e n   c l o s e d   b u t   t h e   b r o w s e r   d i d n ' t \ n                 / /   h a v e   a   c h a n c e   o f   i n f o r m i n g   u s   a b o u t   i t   y e t ,   i n   t h a t   c a s e   s e n d   w i l l \ n                 / /   t h r o w   a n    [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m \ n                 t r y   { \ n                     i f   ( s e l f . u s i n g B r o w s e r W e b S o c k e t )   { \ n                         / /   T y p e E r r o r   i s   t h r o w n   w h e n   p a s s i n g   t h e   s e c o n d   a r g u m e n t   o n   S a f a r i \ n                         s e l f . w s . s e n d ( d a t a ) ; \ n                     }   e l s e   { \ n                         s e l f . w s . s e n d ( d a t a ,   o p t s ) ; \ n                     } \ n                 }   c a t c h   ( e )   { \ n                     d e b u g ( ' w e b s o c k e t   c l o s e d   b e f o r e   o n c l o s e   e v e n t ' ) ; \ n                 } \ n \ n                 - - t o t a l   | |   d o n e ( ) ; \ n             } ) ; \ n         } ) ( p a c k e t s [ i ] ) ; \ n     } \ n \ n     f u n c t i o n   d o n e   ( )   { \ n         s e l f . e m i t ( ' f l u s h ' ) ; \ n \ n         / /   f a k e   d r a i n \ n         / /   d e f e r   t o   n e x t   t i c k   t o   a l l o w   S o c k e t   t o   c l e a r   w r i t e B u f f e r \ n         s e t T i m e o u t ( f u n c t i o n   ( )   { \ n             s e l f . w r i t a b l e   =   t r u e ; \ n             s e l f . e m i t ( ' d r a i n ' ) ; \ n         } ,   0 ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   c l o s e \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . o n C l o s e   =   f u n c t i o n   ( )   { \ n     T r a n s p o r t . p r o t o t y p e . o n C l o s e . c a l l ( t h i s ) ; \ n } ; \ n \ n / * * \ n   *   C l o s e s   s o c k e t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . d o C l o s e   =   f u n c t i o n   ( )   { \ n     i f   ( t y p e o f   t h i s . w s   ! = =   ' u n d e f i n e d ' )   { \ n         t h i s . w s . c l o s e ( ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   G e n e r a t e s   u r i   f o r   c o n n e c t i o n . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n W S . p r o t o t y p e . u r i   =   f u n c t i o n   ( )   { \ n     v a r   q u e r y   =   t h i s . q u e r y   | |   { } ; \ n     v a r   s c h e m a   =   t h i s . s e c u r e   ?   ' w s s '   :   ' w s ' ; \ n     v a r   p o r t   =   ' ' ; \ n \ n     / /   a v o i d   p o r t   i f   d e f a u l t   f o r   s c h e m a \ n     i f   ( t h i s . p o r t   & &   ( ( ' w s s '   = = =   s c h e m a   & &   N u m b e r ( t h i s . p o r t )   ! = =   4 4 3 )   | | \ n         ( ' w s '   = = =   s c h e m a   & &   N u m b e r ( t h i s . p o r t )   ! = =   8 0 ) ) )   { \ n         p o r t   =   ' : '   +   t h i s . p o r t ; \ n     } \ n \ n     / /   a p p e n d   t i m e s t a m p   t o   U R I \ n     i f   ( t h i s . t i m e s t a m p R e q u e s t s )   { \ n         q u e r y [ t h i s . t i m e s t a m p P a r a m ]   =   y e a s t ( ) ; \ n     } \ n \ n     / /   c o m m u n i c a t e   b i n a r y   s u p p o r t   c a p a b i l i t i e s \ n     i f   ( ! t h i s . s u p p o r t s B i n a r y )   { \ n         q u e r y . b 6 4   =   1 ; \ n     } \ n \ n     q u e r y   =   p a r s e q s . e n c o d e ( q u e r y ) ; \ n \ n     / /   p r e p e n d   ?   t o   q u e r y \ n     i f   ( q u e r y . l e n g t h )   { \ n         q u e r y   =   ' ? '   +   q u e r y ; \ n     } \ n \ n     v a r   i p v 6   =   t h i s . h o s t n a m e . i n d e x O f ( ' : ' )   ! = =   - 1 ; \ n     r e t u r n   s c h e m a   +   ' : / / '   +   ( i p v 6   ?   ' [ '   +   t h i s . h o s t n a m e   +   ' ] '   :   t h i s . h o s t n a m e )   +   p o r t   +   t h i s . p a t h   +   q u e r y ; \ n } ; \ n \ n / * * \ n   *   F e a t u r e   d e t e c t i o n   f o r   W e b S o c k e t . \ n   * \ n   *   @ r e t u r n   { B o o l e a n }   w h e t h e r   t h i s   t r a n s p o r t   i s   a v a i l a b l e . \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n W S . p r o t o t y p e . c h e c k   =   f u n c t i o n   ( )   { \ n     r e t u r n   ! ! W e b S o c k e t   & &   ! ( ' _ _ i n i t i a l i z e '   i n   W e b S o c k e t   & &   t h i s . n a m e   = = =   W S . p r o t o t y p e . n a m e ) ; \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / e n g i n e . i o - c l i e n t / l i b / t r a n s p o r t s / w e b s o c k e t . j s \ n / /   m o d u l e   i d   =   4 0 \ n / /   m o d u l e   c h u n k s   =   0 " , " / *   ( i g n o r e d )   * / \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   w s   ( i g n o r e d ) \ n / /   m o d u l e   i d   =   4 1 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n v a r   i n d e x O f   =   [ ] . i n d e x O f ; \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( a r r ,   o b j ) { \ n     i f   ( i n d e x O f )   r e t u r n   a r r . i n d e x O f ( o b j ) ; \ n     f o r   ( v a r   i   =   0 ;   i   <   a r r . l e n g t h ;   + + i )   { \ n         i f   ( a r r [ i ]   = = =   o b j )   r e t u r n   i ; \ n     } \ n     r e t u r n   - 1 ; \ n } ; \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / i n d e x o f / i n d e x . j s \ n / /   m o d u l e   i d   =   4 2 \ n / /   m o d u l e   c h u n k s   =   0 " , " / * * \ r \ n   *   J S O N   p a r s e . \ r \ n   * \ r \ n   *   @ s e e   B a s e d   o n   j Q u e r y # p a r s e J S O N   ( M I T )   a n d   J S O N 2 \ r \ n   *   @ a p i   p r i v a t e \ r \ n   * / \ r \ n \ r \ n v a r   r v a l i d c h a r s   =   / ^ [ \ \ ] , : { } \ \ s ] * $ / ; \ r \ n v a r   r v a l i d e s c a p e   =   / \ \ \ \ ( ? : [ \ " \ \ \ \ \ \ / b f n r t ] | u [ 0 - 9 a - f A - F ] { 4 } ) / g ; \ r \ n v a r   r v a l i d t o k e n s   =   / \ " [ ^ \ " \ \ \ \ \ \ n \ \ r ] * \ " | t r u e | f a l s e | n u l l | - ? \ \ d + ( ? : \ \ . \ \ d * ) ? ( ? : [ e E ] [ + \ \ - ] ? \ \ d + ) ? / g ; \ r \ n v a r   r v a l i d b r a c e s   =   / ( ? : ^ | : | , ) ( ? : \ \ s * \ \ [ ) + / g ; \ r \ n v a r   r t r i m L e f t   =   / ^ \ \ s + / ; \ r \ n v a r   r t r i m R i g h t   =   / \ \ s + $ / ; \ r \ n \ r \ n m o d u l e . e x p o r t s   =   f u n c t i o n   p a r s e j s o n ( d a t a )   { \ r \ n     i f   ( ' s t r i n g '   ! =   t y p e o f   d a t a   | |   ! d a t a )   { \ r \ n         r e t u r n   n u l l ; \ r \ n     } \ r \ n \ r \ n     d a t a   =   d a t a . r e p l a c e ( r t r i m L e f t ,   ' ' ) . r e p l a c e ( r t r i m R i g h t ,   ' ' ) ; \ r \ n \ r \ n     / /   A t t e m p t   t o   p a r s e   u s i n g   t h e   n a t i v e   J S O N   p a r s e r   f i r s t \ r \ n     i f   ( g l o b a l . J S O N   & &   J S O N . p a r s e )   { \ r \ n         r e t u r n   J S O N . p a r s e ( d a t a ) ; \ r \ n     } \ r \ n \ r \ n     i f   ( r v a l i d c h a r s . t e s t ( d a t a . r e p l a c e ( r v a l i d e s c a p e ,   ' @ ' ) \ r \ n             . r e p l a c e ( r v a l i d t o k e n s ,   ' ] ' ) \ r \ n             . r e p l a c e ( r v a l i d b r a c e s ,   ' ' ) ) )   { \ r \ n         r e t u r n   ( n e w   F u n c t i o n ( ' r e t u r n   '   +   d a t a ) ) ( ) ; \ r \ n     } \ r \ n } ; \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / p a r s e j s o n / i n d e x . j s \ n / /   m o d u l e   i d   =   4 3 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   d e p e n d e n c i e s . \ n   * / \ n \ n v a r   p a r s e r   =   r e q u i r e ( ' s o c k e t . i o - p a r s e r ' ) ; \ n v a r   E m i t t e r   =   r e q u i r e ( ' c o m p o n e n t - e m i t t e r ' ) ; \ n v a r   t o A r r a y   =   r e q u i r e ( ' t o - a r r a y ' ) ; \ n v a r   o n   =   r e q u i r e ( ' . / o n ' ) ; \ n v a r   b i n d   =   r e q u i r e ( ' c o m p o n e n t - b i n d ' ) ; \ n v a r   d e b u g   =   r e q u i r e ( ' d e b u g ' ) ( ' s o c k e t . i o - c l i e n t : s o c k e t ' ) ; \ n v a r   h a s B i n   =   r e q u i r e ( ' h a s - b i n a r y ' ) ; \ n \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   e x p o r t s   =   S o c k e t ; \ n \ n / * * \ n   *   I n t e r n a l   e v e n t s   ( b l a c k l i s t e d ) . \ n   *   T h e s e   e v e n t s   c a n ' t   b e   e m i t t e d   b y   t h e   u s e r . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n v a r   e v e n t s   =   { \ n     c o n n e c t :   1 , \ n     c o n n e c t _ e r r o r :   1 , \ n     c o n n e c t _ t i m e o u t :   1 , \ n     c o n n e c t i n g :   1 , \ n     d i s c o n n e c t :   1 , \ n      [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m :   1 , \ n     r e c o n n e c t :   1 , \ n     r e c o n n e c t _ a t t e m p t :   1 , \ n     r e c o n n e c t _ f a i l e d :   1 , \ n     r e c o n n e c t _ e r r o r :   1 , \ n     r e c o n n e c t i n g :   1 , \ n     p i n g :   1 , \ n     p o n g :   1 \ n } ; \ n \ n / * * \ n   *   S h o r t c u t   t o   ` E m i t t e r # e m i t ` . \ n   * / \ n \ n v a r   e m i t   =   E m i t t e r . p r o t o t y p e . e m i t ; \ n \ n / * * \ n   *   ` S o c k e t `   c o n s t r u c t o r . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   S o c k e t   ( i o ,   n s p ,   o p t s )   { \ n     t h i s . i o   =   i o ; \ n     t h i s . n s p   =   n s p ; \ n     t h i s . j s o n   =   t h i s ;   / /   c o m p a t \ n     t h i s . i d s   =   0 ; \ n     t h i s . a c k s   =   { } ; \ n     t h i s . r e c e i v e B u f f e r   =   [ ] ; \ n     t h i s . s e n d B u f f e r   =   [ ] ; \ n     t h i s . c o n n e c t e d   =   f a l s e ; \ n     t h i s . d i s c o n n e c t e d   =   t r u e ; \ n     i f   ( o p t s   & &   o p t s . q u e r y )   { \ n         t h i s . q u e r y   =   o p t s . q u e r y ; \ n     } \ n     i f   ( t h i s . i o . a u t o C o n n e c t )   t h i s . o p e n ( ) ; \ n } \ n \ n / * * \ n   *   M i x   i n   ` E m i t t e r ` . \ n   * / \ n \ n E m i t t e r ( S o c k e t . p r o t o t y p e ) ; \ n \ n / * * \ n   *   S u b s c r i b e   t o   o p e n ,   c l o s e   a n d   p a c k e t   e v e n t s \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . s u b E v e n t s   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . s u b s )   r e t u r n ; \ n \ n     v a r   i o   =   t h i s . i o ; \ n     t h i s . s u b s   =   [ \ n         o n ( i o ,   ' o p e n ' ,   b i n d ( t h i s ,   ' o n o p e n ' ) ) , \ n         o n ( i o ,   ' p a c k e t ' ,   b i n d ( t h i s ,   ' o n p a c k e t ' ) ) , \ n         o n ( i o ,   ' c l o s e ' ,   b i n d ( t h i s ,   ' o n c l o s e ' ) ) \ n     ] ; \ n } ; \ n \ n / * * \ n   *   \ " O p e n s \ "   t h e   s o c k e t . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o p e n   = \ n S o c k e t . p r o t o t y p e . c o n n e c t   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . c o n n e c t e d )   r e t u r n   t h i s ; \ n \ n     t h i s . s u b E v e n t s ( ) ; \ n     t h i s . i o . o p e n ( ) ;   / /   e n s u r e   o p e n \ n     i f   ( ' o p e n '   = = =   t h i s . i o . r e a d y S t a t e )   t h i s . o n o p e n ( ) ; \ n     t h i s . e m i t ( ' c o n n e c t i n g ' ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e n d s   a   ` m e s s a g e `   e v e n t . \ n   * \ n   *   @ r e t u r n   { S o c k e t }   s e l f \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . s e n d   =   f u n c t i o n   ( )   { \ n     v a r   a r g s   =   t o A r r a y ( a r g u m e n t s ) ; \ n     a r g s . u n s h i f t ( ' m e s s a g e ' ) ; \ n     t h i s . e m i t . a p p l y ( t h i s ,   a r g s ) ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   O v e r r i d e   ` e m i t ` . \ n   *   I f   t h e   e v e n t   i s   i n   ` e v e n t s ` ,   i t ' s   e m i t t e d   n o r m a l l y . \ n   * \ n   *   @ p a r a m   { S t r i n g }   e v e n t   n a m e \ n   *   @ r e t u r n   { S o c k e t }   s e l f \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . e m i t   =   f u n c t i o n   ( e v )   { \ n     i f   ( e v e n t s . h a s O w n P r o p e r t y ( e v ) )   { \ n         e m i t . a p p l y ( t h i s ,   a r g u m e n t s ) ; \ n         r e t u r n   t h i s ; \ n     } \ n \ n     v a r   a r g s   =   t o A r r a y ( a r g u m e n t s ) ; \ n     v a r   p a r s e r T y p e   =   p a r s e r . E V E N T ;   / /   d e f a u l t \ n     i f   ( h a s B i n ( a r g s ) )   {   p a r s e r T y p e   =   p a r s e r . B I N A R Y _ E V E N T ;   }   / /   b i n a r y \ n     v a r   p a c k e t   =   {   t y p e :   p a r s e r T y p e ,   d a t a :   a r g s   } ; \ n \ n     p a c k e t . o p t i o n s   =   { } ; \ n     p a c k e t . o p t i o n s . c o m p r e s s   =   ! t h i s . f l a g s   | |   f a l s e   ! = =   t h i s . f l a g s . c o m p r e s s ; \ n \ n     / /   e v e n t   a c k   c a l l b a c k \ n     i f   ( ' f u n c t i o n '   = = =   t y p e o f   a r g s [ a r g s . l e n g t h   -   1 ] )   { \ n         d e b u g ( ' e m i t t i n g   p a c k e t   w i t h   a c k   i d   % d ' ,   t h i s . i d s ) ; \ n         t h i s . a c k s [ t h i s . i d s ]   =   a r g s . p o p ( ) ; \ n         p a c k e t . i d   =   t h i s . i d s + + ; \ n     } \ n \ n     i f   ( t h i s . c o n n e c t e d )   { \ n         t h i s . p a c k e t ( p a c k e t ) ; \ n     }   e l s e   { \ n         t h i s . s e n d B u f f e r . p u s h ( p a c k e t ) ; \ n     } \ n \ n     d e l e t e   t h i s . f l a g s ; \ n \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e n d s   a   p a c k e t . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . p a c k e t   =   f u n c t i o n   ( p a c k e t )   { \ n     p a c k e t . n s p   =   t h i s . n s p ; \ n     t h i s . i o . p a c k e t ( p a c k e t ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   e n g i n e   ` o p e n ` . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n o p e n   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' t r a n s p o r t   i s   o p e n   -   c o n n e c t i n g ' ) ; \ n \ n     / /   w r i t e   c o n n e c t   p a c k e t   i f   n e c e s s a r y \ n     i f   ( ' / '   ! = =   t h i s . n s p )   { \ n         i f   ( t h i s . q u e r y )   { \ n             t h i s . p a c k e t ( { t y p e :   p a r s e r . C O N N E C T ,   q u e r y :   t h i s . q u e r y } ) ; \ n         }   e l s e   { \ n             t h i s . p a c k e t ( { t y p e :   p a r s e r . C O N N E C T } ) ; \ n         } \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   e n g i n e   ` c l o s e ` . \ n   * \ n   *   @ p a r a m   { S t r i n g }   r e a s o n \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n c l o s e   =   f u n c t i o n   ( r e a s o n )   { \ n     d e b u g ( ' c l o s e   ( % s ) ' ,   r e a s o n ) ; \ n     t h i s . c o n n e c t e d   =   f a l s e ; \ n     t h i s . d i s c o n n e c t e d   =   t r u e ; \ n     d e l e t e   t h i s . i d ; \ n     t h i s . e m i t ( ' d i s c o n n e c t ' ,   r e a s o n ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   w i t h   s o c k e t   p a c k e t . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n p a c k e t   =   f u n c t i o n   ( p a c k e t )   { \ n     i f   ( p a c k e t . n s p   ! = =   t h i s . n s p )   r e t u r n ; \ n \ n     s w i t c h   ( p a c k e t . t y p e )   { \ n         c a s e   p a r s e r . C O N N E C T : \ n             t h i s . o n c o n n e c t ( ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r . E V E N T : \ n             t h i s . o n e v e n t ( p a c k e t ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r . B I N A R Y _ E V E N T : \ n             t h i s . o n e v e n t ( p a c k e t ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r . A C K : \ n             t h i s . o n a c k ( p a c k e t ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r . B I N A R Y _ A C K : \ n             t h i s . o n a c k ( p a c k e t ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r . D I S C O N N E C T : \ n             t h i s . o n d i s c o n n e c t ( ) ; \ n             b r e a k ; \ n \ n         c a s e   p a r s e r .  [ 1 m  [ 3 1 m E R R O R  [ 3 9 m  [ 2 2 m  [ 1 m : \ n             t h i s . e m i t ( '  [ 1 m  [ 3 1 m e r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ' ,   p a c k e t . d a t a ) ; \ n             b r e a k ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   a   s e r v e r   e v e n t . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n e v e n t   =   f u n c t i o n   ( p a c k e t )   { \ n     v a r   a r g s   =   p a c k e t . d a t a   | |   [ ] ; \ n     d e b u g ( ' e m i t t i n g   e v e n t   % j ' ,   a r g s ) ; \ n \ n     i f   ( n u l l   ! =   p a c k e t . i d )   { \ n         d e b u g ( ' a t t a c h i n g   a c k   c a l l b a c k   t o   e v e n t ' ) ; \ n         a r g s . p u s h ( t h i s . a c k ( p a c k e t . i d ) ) ; \ n     } \ n \ n     i f   ( t h i s . c o n n e c t e d )   { \ n         e m i t . a p p l y ( t h i s ,   a r g s ) ; \ n     }   e l s e   { \ n         t h i s . r e c e i v e B u f f e r . p u s h ( a r g s ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   P r o d u c e s   a n   a c k   c a l l b a c k   t o   e m i t   w i t h   a n   e v e n t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . a c k   =   f u n c t i o n   ( i d )   { \ n     v a r   s e l f   =   t h i s ; \ n     v a r   s e n t   =   f a l s e ; \ n     r e t u r n   f u n c t i o n   ( )   { \ n         / /   p r e v e n t   d o u b l e   c a l l b a c k s \ n         i f   ( s e n t )   r e t u r n ; \ n         s e n t   =   t r u e ; \ n         v a r   a r g s   =   t o A r r a y ( a r g u m e n t s ) ; \ n         d e b u g ( ' s e n d i n g   a c k   % j ' ,   a r g s ) ; \ n \ n         v a r   t y p e   =   h a s B i n ( a r g s )   ?   p a r s e r . B I N A R Y _ A C K   :   p a r s e r . A C K ; \ n         s e l f . p a c k e t ( { \ n             t y p e :   t y p e , \ n             i d :   i d , \ n             d a t a :   a r g s \ n         } ) ; \ n     } ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   a   s e r v e r   a c k n o w l e g e m e n t . \ n   * \ n   *   @ p a r a m   { O b j e c t }   p a c k e t \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n a c k   =   f u n c t i o n   ( p a c k e t )   { \ n     v a r   a c k   =   t h i s . a c k s [ p a c k e t . i d ] ; \ n     i f   ( ' f u n c t i o n '   = = =   t y p e o f   a c k )   { \ n         d e b u g ( ' c a l l i n g   a c k   % s   w i t h   % j ' ,   p a c k e t . i d ,   p a c k e t . d a t a ) ; \ n         a c k . a p p l y ( t h i s ,   p a c k e t . d a t a ) ; \ n         d e l e t e   t h i s . a c k s [ p a c k e t . i d ] ; \ n     }   e l s e   { \ n         d e b u g ( ' b a d   a c k   % s ' ,   p a c k e t . i d ) ; \ n     } \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   s e r v e r   c o n n e c t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n c o n n e c t   =   f u n c t i o n   ( )   { \ n     t h i s . c o n n e c t e d   =   t r u e ; \ n     t h i s . d i s c o n n e c t e d   =   f a l s e ; \ n     t h i s . e m i t ( ' c o n n e c t ' ) ; \ n     t h i s . e m i t B u f f e r e d ( ) ; \ n } ; \ n \ n / * * \ n   *   E m i t   b u f f e r e d   e v e n t s   ( r e c e i v e d   a n d   e m i t t e d ) . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . e m i t B u f f e r e d   =   f u n c t i o n   ( )   { \ n     v a r   i ; \ n     f o r   ( i   =   0 ;   i   <   t h i s . r e c e i v e B u f f e r . l e n g t h ;   i + + )   { \ n         e m i t . a p p l y ( t h i s ,   t h i s . r e c e i v e B u f f e r [ i ] ) ; \ n     } \ n     t h i s . r e c e i v e B u f f e r   =   [ ] ; \ n \ n     f o r   ( i   =   0 ;   i   <   t h i s . s e n d B u f f e r . l e n g t h ;   i + + )   { \ n         t h i s . p a c k e t ( t h i s . s e n d B u f f e r [ i ] ) ; \ n     } \ n     t h i s . s e n d B u f f e r   =   [ ] ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   s e r v e r   d i s c o n n e c t . \ n   * \ n   *   @ a p i   p r i v a t e \ n   * / \ n \ n S o c k e t . p r o t o t y p e . o n d i s c o n n e c t   =   f u n c t i o n   ( )   { \ n     d e b u g ( ' s e r v e r   d i s c o n n e c t   ( % s ) ' ,   t h i s . n s p ) ; \ n     t h i s . d e s t r o y ( ) ; \ n     t h i s . o n c l o s e ( ' i o   s e r v e r   d i s c o n n e c t ' ) ; \ n } ; \ n \ n / * * \ n   *   C a l l e d   u p o n   f o r c e d   c l i e n t / s e r v e r   s i d e   d i s c o n n e c t i o n s , \ n   *   t h i s   m e t h o d   e n s u r e s   t h e   m a n a g e r   s t o p s   t r a c k i n g   u s   a n d \ n   *   t h a t   r e c o n n e c t i o n s   d o n ' t   g e t   t r i g g e r e d   f o r   t h i s . \ n   * \ n   *   @ a p i   p r i v a t e . \ n   * / \ n \ n S o c k e t . p r o t o t y p e . d e s t r o y   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . s u b s )   { \ n         / /   c l e a n   s u b s c r i p t i o n s   t o   a v o i d   r e c o n n e c t i o n s \ n         f o r   ( v a r   i   =   0 ;   i   <   t h i s . s u b s . l e n g t h ;   i + + )   { \ n             t h i s . s u b s [ i ] . d e s t r o y ( ) ; \ n         } \ n         t h i s . s u b s   =   n u l l ; \ n     } \ n \ n     t h i s . i o . d e s t r o y ( t h i s ) ; \ n } ; \ n \ n / * * \ n   *   D i s c o n n e c t s   t h e   s o c k e t   m a n u a l l y . \ n   * \ n   *   @ r e t u r n   { S o c k e t }   s e l f \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . c l o s e   = \ n S o c k e t . p r o t o t y p e . d i s c o n n e c t   =   f u n c t i o n   ( )   { \ n     i f   ( t h i s . c o n n e c t e d )   { \ n         d e b u g ( ' p e r f o r m i n g   d i s c o n n e c t   ( % s ) ' ,   t h i s . n s p ) ; \ n         t h i s . p a c k e t ( {   t y p e :   p a r s e r . D I S C O N N E C T   } ) ; \ n     } \ n \ n     / /   r e m o v e   s o c k e t   f r o m   p o o l \ n     t h i s . d e s t r o y ( ) ; \ n \ n     i f   ( t h i s . c o n n e c t e d )   { \ n         / /   f i r e   e v e n t s \ n         t h i s . o n c l o s e ( ' i o   c l i e n t   d i s c o n n e c t ' ) ; \ n     } \ n     r e t u r n   t h i s ; \ n } ; \ n \ n / * * \ n   *   S e t s   t h e   c o m p r e s s   f l a g . \ n   * \ n   *   @ p a r a m   { B o o l e a n }   i f   ` t r u e ` ,   c o m p r e s s e s   t h e   s e n d i n g   d a t a \ n   *   @ r e t u r n   { S o c k e t }   s e l f \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n S o c k e t . p r o t o t y p e . c o m p r e s s   =   f u n c t i o n   ( c o m p r e s s )   { \ n     t h i s . f l a g s   =   t h i s . f l a g s   | |   { } ; \ n     t h i s . f l a g s . c o m p r e s s   =   c o m p r e s s ; \ n     r e t u r n   t h i s ; \ n } ; \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / s o c k e t . j s " , " m o d u l e . e x p o r t s   =   t o A r r a y \ n \ n f u n c t i o n   t o A r r a y ( l i s t ,   i n d e x )   { \ n         v a r   a r r a y   =   [ ] \ n \ n         i n d e x   =   i n d e x   | |   0 \ n \ n         f o r   ( v a r   i   =   i n d e x   | |   0 ;   i   <   l i s t . l e n g t h ;   i + + )   { \ n                 a r r a y [ i   -   i n d e x ]   =   l i s t [ i ] \ n         } \ n \ n         r e t u r n   a r r a y \ n } \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / t o - a r r a y / i n d e x . j s \ n / /   m o d u l e   i d   =   4 5 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   M o d u l e   e x p o r t s . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   o n ; \ n \ n / * * \ n   *   H e l p e r   f o r   s u b s c r i p t i o n s . \ n   * \ n   *   @ p a r a m   { O b j e c t | E v e n t E m i t t e r }   o b j   w i t h   ` E m i t t e r `   m i x i n   o r   ` E v e n t E m i t t e r ` \ n   *   @ p a r a m   { S t r i n g }   e v e n t   n a m e \ n   *   @ p a r a m   { F u n c t i o n }   c a l l b a c k \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   o n   ( o b j ,   e v ,   f n )   { \ n     o b j . o n ( e v ,   f n ) ; \ n     r e t u r n   { \ n         d e s t r o y :   f u n c t i o n   ( )   { \ n             o b j . r e m o v e L i s t e n e r ( e v ,   f n ) ; \ n         } \ n     } ; \ n } \ n \ n \ n \ n / /   W E B P A C K   F O O T E R   / / \ n / /   l i b / o n . j s " , " / * * \ n   *   S l i c e   r e f e r e n c e . \ n   * / \ n \ n v a r   s l i c e   =   [ ] . s l i c e ; \ n \ n / * * \ n   *   B i n d   ` o b j `   t o   ` f n ` . \ n   * \ n   *   @ p a r a m   { O b j e c t }   o b j \ n   *   @ p a r a m   { F u n c t i o n | S t r i n g }   f n   o r   s t r i n g \ n   *   @ r e t u r n   { F u n c t i o n } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n m o d u l e . e x p o r t s   =   f u n c t i o n ( o b j ,   f n ) { \ n     i f   ( ' s t r i n g '   = =   t y p e o f   f n )   f n   =   o b j [ f n ] ; \ n     i f   ( ' f u n c t i o n '   ! =   t y p e o f   f n )   t h r o w   n e w    [ 1 m  [ 3 1 m E r r o r  [ 3 9 m  [ 2 2 m  [ 1 m ( ' b i n d ( )   r e q u i r e s   a   f u n c t i o n ' ) ; \ n     v a r   a r g s   =   s l i c e . c a l l ( a r g u m e n t s ,   2 ) ; \ n     r e t u r n   f u n c t i o n ( ) { \ n         r e t u r n   f n . a p p l y ( o b j ,   a r g s . c o n c a t ( s l i c e . c a l l ( a r g u m e n t s ) ) ) ; \ n     } \ n } ; \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / c o m p o n e n t - b i n d / i n d e x . j s \ n / /   m o d u l e   i d   =   4 7 \ n / /   m o d u l e   c h u n k s   =   0 " , " \ n / * * \ n   *   E x p o s e   ` B a c k o f f ` . \ n   * / \ n \ n m o d u l e . e x p o r t s   =   B a c k o f f ; \ n \ n / * * \ n   *   I n i t i a l i z e   b a c k o f f   t i m e r   w i t h   ` o p t s ` . \ n   * \ n   *   -   ` m i n `   i n i t i a l   t i m e o u t   i n   m i l l i s e c o n d s   [ 1 0 0 ] \ n   *   -   ` m a x `   m a x   t i m e o u t   [ 1 0 0 0 0 ] \ n   *   -   ` j i t t e r `   [ 0 ] \ n   *   -   ` f a c t o r `   [ 2 ] \ n   * \ n   *   @ p a r a m   { O b j e c t }   o p t s \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n f u n c t i o n   B a c k o f f ( o p t s )   { \ n     o p t s   =   o p t s   | |   { } ; \ n     t h i s . m s   =   o p t s . m i n   | |   1 0 0 ; \ n     t h i s . m a x   =   o p t s . m a x   | |   1 0 0 0 0 ; \ n     t h i s . f a c t o r   =   o p t s . f a c t o r   | |   2 ; \ n     t h i s . j i t t e r   =   o p t s . j i t t e r   >   0   & &   o p t s . j i t t e r   < =   1   ?   o p t s . j i t t e r   :   0 ; \ n     t h i s . a t t e m p t s   =   0 ; \ n } \ n \ n / * * \ n   *   R e t u r n   t h e   b a c k o f f   d u r a t i o n . \ n   * \ n   *   @ r e t u r n   { N u m b e r } \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n B a c k o f f . p r o t o t y p e . d u r a t i o n   =   f u n c t i o n ( ) { \ n     v a r   m s   =   t h i s . m s   *   M a t h . p o w ( t h i s . f a c t o r ,   t h i s . a t t e m p t s + + ) ; \ n     i f   ( t h i s . j i t t e r )   { \ n         v a r   r a n d   =     M a t h . r a n d o m ( ) ; \ n         v a r   d e v i a t i o n   =   M a t h . f l o o r ( r a n d   *   t h i s . j i t t e r   *   m s ) ; \ n         m s   =   ( M a t h . f l o o r ( r a n d   *   1 0 )   &   1 )   = =   0     ?   m s   -   d e v i a t i o n   :   m s   +   d e v i a t i o n ; \ n     } \ n     r e t u r n   M a t h . m i n ( m s ,   t h i s . m a x )   |   0 ; \ n } ; \ n \ n / * * \ n   *   R e s e t   t h e   n u m b e r   o f   a t t e m p t s . \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n B a c k o f f . p r o t o t y p e . r e s e t   =   f u n c t i o n ( ) { \ n     t h i s . a t t e m p t s   =   0 ; \ n } ; \ n \ n / * * \ n   *   S e t   t h e   m i n i m u m   d u r a t i o n \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n B a c k o f f . p r o t o t y p e . s e t M i n   =   f u n c t i o n ( m i n ) { \ n     t h i s . m s   =   m i n ; \ n } ; \ n \ n / * * \ n   *   S e t   t h e   m a x i m u m   d u r a t i o n \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n B a c k o f f . p r o t o t y p e . s e t M a x   =   f u n c t i o n ( m a x ) { \ n     t h i s . m a x   =   m a x ; \ n } ; \ n \ n / * * \ n   *   S e t   t h e   j i t t e r \ n   * \ n   *   @ a p i   p u b l i c \ n   * / \ n \ n B a c k o f f . p r o t o t y p e . s e t J i t t e r   =   f u n c t i o n ( j i t t e r ) { \ n     t h i s . j i t t e r   =   j i t t e r ; \ n } ; \ n \ n \ n \ n \ n / / / / / / / / / / / / / / / / / / \ n / /   W E B P A C K   F O O T E R \ n / /   . / ~ / b a c k o 2 / i n d e x . j s \ n / /   m o d u l e   i d   =   4 8 \ n / /   m o d u l e   c h u n k s   =   0 " ] , " m a p p i n g s " : " A A A A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A C V A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; ; ; A C r C A ; ; ; ; A A I A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; ; ; ; ; A A a A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; A A K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; ; ; ; ; ; ; ; ; A C 1 G A ; ; ; ; A A I A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; A A S A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A C z E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C t C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C l L A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C n L A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C v M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C p J A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C n Z A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C v K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C p M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C 5 H A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C 3 4 B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C T A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C n K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C 9 I A ; A A C A ; A A C A ; ; ; ; ; ; ; A C F A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; ; A C b A ; ; ; ; A A I A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A H A ; A A K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A H A ; A A K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A A A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A H A ; A A K A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C 9 i B A ; A A C A ; ; ; ; ; ; ; A C D A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C T A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C n u B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C t D A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C t C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C h B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C z a A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C p P A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C 5 J A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C l m B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C l B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C 5 D A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C 5 B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C 3 B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C z O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C l E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C j G A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C l K A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C p C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C N A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C n E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C x O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C 9 R A ; ; ; ; ; ; A C A A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A C T A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A C / B A ; ; ; ; A A I A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A b A ; A A C A ; A A e A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A K A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; A A S A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A A A ; A A A A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A 3 B A ; A A 6 B A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A H A ; A A K A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; A A M A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A A O A ; A A E A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; A A Q A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C j a A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; A C X A ; ; ; ; A A I A ; A A C A ; A A C A ; ; ; ; ; ; ; ; ; A A S A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A H A ; A A K A ; ; ; ; ; ; A C v B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; ; A C t B A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; A A C A ; ; ; ; ; ; " , " s o u r c e R o o t " : " " }  [ 3 9 m  [ 2 2 m 
 
   @   . / n o d e _ m o d u l e s / s o c k e t i o / n o d e _ m o d u l e s / s o c k e t . i o / l i b / i n d e x . j s   1 0 3 : 2 9 - 8 6 
 
   @   . / n o d e _ m o d u l e s / s o c k e t i o / i n d e x . j s   3 : 9 - 2 9 
 
   @   d l l   r e n d e r e r   r e n d e r e r [ 2 1 ] 
 
 
 
 w e b p a c k   c o m p i l e d   w i t h    [ 1 m  [ 3 1 m 3   e r r o r s  [ 3 9 m  [ 2 2 m 
 
 